---
schema_version: "1"
id: 97e3ad36cba7d258fbb56f5a2d1733da3a10e0ea42950951b8051c283eefd645
title: Archetype Error When Creating Policies
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/api-manager/latest/troubleshooting-archetype-error-when-creating-policy.md
canonical_url: https://docs.mulesoft.com/api-manager/latest/troubleshooting-archetype-error-when-creating-policy
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 80e6966aa099a30ee1afb40144c6e0a56d7bffd558d54c7b605ed7bc97d64d7f
description: MuleSoft Documentation Site
release: 2.x
latest: true
---
---
product: API Manager
version: 2.x
is-latest-version: true
keywords: alert
---

# Archetype Error When Creating Policies

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

If you attempt to run Archetype from a directory with existing files when you create a policy, you
might encounter a “Directory already exists” error. The error might differ based on the Maven
version installed in your environment.

The following code snippet shows an error generated for maven-archetype-plugin version 3.1.1:

```text
mvn -Parchetype-repository archetype:generate \
[INFO] Parameter: basedir, Value: C:\Users\32481\AnypointStudio\studio-workspace\mycustompolicy
[INFO] Parameter: package, Value: mule-policy
[INFO] Parameter: groupId, Value: 6344d2e6-eff9-4020-b792-719c463d5b92
[INFO] Parameter: artifactId, Value: ClientIdCustomPolicy
[INFO] Parameter: packageName, Value: mule-policy
[INFO] Parameter: version, Value: 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Skipping mycustompolicy
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:14 min
[INFO] Finished at: 2019-07-03T14:07:26+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.1:generate (default-cli) on project mycustompolicy: Directory ClientIdCustomPolicy already exists - please run from a clean directory -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException.
```

## Cause

This issue occurs because the directory in which Archetype is located already exists. The directory
might have been created during a previous attempt to run Archetype.

## Solution

To resolve this issue, delete the existing Archetype directory and run the command again.

## See Also

- [Known Issues](https://help.salesforce.com/s/issues)
