Maven archetype generate and open in eclipse

1.9k views Asked by At

I found an eclipse archetype under github (https://github.com/alapierre/altkom). I downloaded the zip file and try to generate a project from this archetype and run it in my eclipse. The point is I get "archetype not found" all the time? Could you help with a way to generate a project from this artifact?

What I`ve tried are some variatios of:

mvn archetype:generate -DarchetypeGroupId=pl.com.softproject.archetypes.springmvc -DarchetypeArtifactId=spring-mvc-spring-data-archetype -DarchetypeVersion=1.0-SNAPSHOT -DgroupId=com.test -DartifactId=myNewProject

Eventually I got also

Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2
.2:generate (default-cli) on project spring-mvc-spring-data-archetype: org.apach
e.maven.archetype.exception.InvalidPackaging: Unable to add module to the curren
t project as it is not of packaging type 'pom'

Any ideas?

2

There are 2 answers

2
Aaron Digulla On

Before you can use the archetype, you need to install it somewhere where Maven can find it.

Run mvn install in the folder of the archetype which contains the pom.xml file. Afterwards, it should work.

0
kamil.rak On

Ok, the problem was I tried to run mvn generate in the same directory as the archetype was and that was the problem.