# replace-artifact

## Purpose

The `replace-artifact` command will overwrite or rename the artifact with the given base name.

## Examples

    griffon replace-artifact book -type=Service -fileType=java

## Description

Either overwrites an existing artifact that matches the specified criteria or renames it with a different file type and applies the matching template.

> This command does not prompt you to confirm if the operation should proceed or not. Renamed files are placed under `$basedir/renamed`.

Usage:

    griffon replace-artifact [name] [-type=type] [-fileType=fileType]

Arguments

- `archetype` - The name of an archetype, defaults to 'default'
- `name` - The name of the artifact, i.e, book
- `type` - The type of the artifact, i.e, Service
- `fileType` - The file type of the artifact, i.e, groovy|java|etc

Fired Events:

- `CreatedFile` - When the artifact has been replaced