4

I have installed maven :

C:\Windows\System32>mvn --version
Apache Maven 3.3.3 (7994120775791599e405a7528ec3e0dke21dja06; 2015-04-22T13:57:3
7+02:00)
Maven home: C:\Program Files\Apache Software Foundation\apache-maven-3.3.3
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_51\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 8", version: "6.2", arch: "amd64", family: "windows"

I am trying to generate Jersey glassfish project with the aid of maven prompt but when I type the following:

D:\maven>mvn archetype:generate  -DarchetypeGroupId=org.glassfish.jersey.archety
pes -DinteractiveMode=false \ -DarchetypeVersion=2.17

I am getting this error:

The goal you specified requires a project to execute but there is no POM in this directory (D:\maven). Please verify you invoked Maven from the correct directory. -> [Help 1]

I dont understand the error: Which project is required here since I am trying to generate one? And how should I create the pom.xml file? I thought it is created by the project generation.

I appreciate any help.

Edit when I type it without \

D:\maven>mvn archetype:generate  -DarchetypeGroupId=org.glassfish.jersey.archety
pes  -DinteractiveMode=false -DarchetypeVersion=2.17
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.3:generate (default-cli) > generate-sources
@ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.3:generate (default-cli) < generate-sources
@ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.3:generate (default-cli) @ standalone-pom --
-
[INFO] Generating project in Batch mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.glassfish.jer
sey.archetypes:maven-archetype-quickstart:2.17)
Downloading: https://repo.maven.apache.org/maven2/org/glassfish/jersey/archetype
s/maven-archetype-quickstart/2.17/maven-archetype-quickstart-2.17.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.542 s
[INFO] Finished at: 2015-05-12T16:39:51+02:00
[INFO] Final Memory: 17M/152M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2
.3:generate (default-cli) on project standalone-pom: The desired archetype does
not exist (org.glassfish.jersey.archetypes:maven-archetype-quickstart:2.17) -> [
Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption

D:\maven>
7
  • 1
    Can you try mvn archetype:generate without any arguments? My idea is maybe you didn't specify the right arguments for this command line. (maybe missing archetypeArtifactId). Tell me when you're done
    – RPresle
    May 12, 2015 at 13:23
  • @RPresle: I am getting much of stuff with number but I cant find my flassfish version below just this one 1303: remote -> org.xaloon.archetype:xaloon-archetype-wicket-jpa-glassfish (-)
    – MrPencil
    May 12, 2015 at 13:29
  • ntains): 598: 1303 Choose org.xaloon.archetype:xaloon-archetype-wicket-jpa-glassfish version: 1: 1.5.0 2: 1.5.1 3: 1.5.2 4: 1.6.0 5: 1.6.1 Choose a number: 5:
    – MrPencil
    May 12, 2015 at 13:30
  • Ok so you're Maven is completely ok, it's just the way you call the command and the content of it. Can you try this mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archety pes -DarchetypeArtifactId=jersey-quickstart-webapp. From http://mvnrepository.com/artifact/org.glassfish.jersey.archetypes
    – RPresle
    May 12, 2015 at 13:39
  • I am getting the same error 'The goal you specified requires a project to execute but there is no POM in this directory (D:\maven). Please verify you invoked Maven from the correct directory.`
    – MrPencil
    May 12, 2015 at 13:43

1 Answer 1

1

I'll go for an answer now.

So the first part of your problem was the caracter "\". See this thread

Then for your second problem : it is said The desired archetype does not exist. This archetype maven-archetype-quickstart doesn't exist in maven repository. Please refer to this link to choose the archetype you are looking for and put it in your command.

At the end you command must have at least 2 argument -DarchetypeGroupId and -DarchetypeArtifactId. For example :

mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes -DarchetypeArtifactId=jersey-quickstart-webapp
2
  • At the end of the line what do you mean with code here? it works now I have created it Thanks but I cant import it into eclipse.
    – MrPencil
    May 12, 2015 at 15:44
  • Was a type. Corrected. Can you explain this eclipse thing? here or in an another question an link it here
    – RPresle
    May 12, 2015 at 16:15

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.