Teamcity Issue :Unable to add module to the current project as it is not of packaging type 'pom'

Viewed 1094

I am trying to add Maven build step in TeamCity to generate Maven archetype.

mvn archetype:generate

This works fine in command prompt.

Unfortunately it throws below error in TeamCity:

Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on project pso-jms-listener-archetype: org.apache.maven.archetype.exception.InvalidPackaging: Unable to add module to the current project as it is not of packaging type 'pom'

I created a new folder and tried executing it there, but still throws the same error

Any suggestions would help.

1 Answers

You may already have a POM file in the directory where mvn archetype:generate is executed.

For Maven, archetype is

a Maven project templating toolkit. An archetype is defined as an original pattern or model from which all other things of the same kind are made.

In short, you are creating a project (from a template) in an other project. In your project folder, delete the file pom.xml and use mvn archetype:generate again.

Related