5

I am new to maven and wanted to create a spring project using maven. Below mentioned is the command I am using:

mvn archetype:generate -DgroupId=com.rakesh.core -DartifactId=Spring3Example 
-DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

It is asking for :

  • Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains):

What it is asking for? I tried all the numbers, I am getting this message:

Your filter doesn't match any archetype (hint: enter to return to initial list)

Please help.

Imane Fateh
  • 2,418
  • 3
  • 19
  • 23
Rakesh Ss
  • 51
  • 1
  • 1
  • 3
  • 1
    possible duplicate of [Newbie: maven archetype:generate](http://stackoverflow.com/questions/8194257/newbie-maven-archetypegenerate) – reto Jul 20 '13 at 14:46

3 Answers3

20

I was having the same problem while copy and pasting an example from a tutorial. After fiddling around with it I found out it was a whitespace issue. I pasted the command into a text editor and deleted a few whitespaces:

mvn archetype:generate -DgroupId=com.mkyong.common -DartifactId=RESTfulExample -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

That did the trick for me.

Rutger Huijsmans
  • 2,330
  • 2
  • 30
  • 67
0

When you have these kind of questions, it is always wise to add the version of Maven, so other are able to reproduce the issue. You can get the info by execution

mvn --version

I wasn't able to reproduce it with Maven 3.0.5, so you're probably using an older version of Maven. Maybe Maven picked up an older version of the archetype-plugin as well. If you run it like this (with the groupId, artifactId and version of the plugin), you are 100% sure it using the specified version:

mvn org.apache.maven.plugins:maven-archetype-plugin:2.2:generate 
    -DgroupId=com.rakesh.core 
    -DartifactId=Spring3Example
    -DarchetypeArtifactId=maven-archetype-quickstart
    -DinteractiveMode=false
Robert Scholte
  • 11,889
  • 2
  • 35
  • 44
  • thanks Robert for your reply. I'm using Apache Maven 3.0.3 version. Still I am not able to resolve the issue which I am facing. – Rakesh Ss Jul 20 '13 at 17:11
  • I succeed with Maven 3.0.3, so it is not the version of Maven which is causing the issue. Are you using an empty folder? What the OS/JDK you're using? – Robert Scholte Jul 20 '13 at 18:03
0

Rakesh,

Are you trying to load an archetype .jar file you downloaded? I believe that is what maven expects when the -DarchetypeArtifactId=maven-archetype-quickstart command is used.

Check this similar post for a possible solution:

Maven 3: Stripes Archetype - cannot create project?.

As an alternative I would suggest this excellent tutorial in which a maven Java web application project is generated from the command line:

http://www.mkyong.com/maven/how-to-create-a-web-application-project-with-maven/

Community
  • 1
  • 1
wSchmidt
  • 100
  • 5