I\'m following Maven in 5 Minutes manual with the following:
mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-a
I am using Windows 7 SP1.
I was having the problem because I ran it using PowerShell.
It works fine when I ran it using CMD.EXE.
Thanks for everyone's help.
I ran into the same problem, and it looks like we have the similar setup
here is what I have to do:
Wrap all the "-D..."
inside double quotes, e.g.
mvn archetype:generate "-DarchetypeGroupId=org.apache.maven.archetypes" "-DarchetypeArtifactId=maven-archetype-quickstart" "-DgroupId=com.mycompany.app" "-DartifactId=my-app"
Make sure you have "HTTP_PROXY"
set properly in your envrironment variables
(check it by typing "echo $Env:HTTP_PROXY"
)
I am not sure that you are running "mvn compile" from POM directory and that is why it is asking for POM.
If so, simply go to directory where pom is located and then fire "mvn install" or any other Maven commands.
It just took me 75 minutes to create a Maven quickstart project on Windows 10 using PowerShell in batch mode. Apparently I made three different mistakes.
Do the following:
-B
for batch mode or -DinteractiveMode=false
instead-DarchetypeGroupId=org.apache.maven.archetypes
-DarchetypeArtifactId=maven-archetype-quickstart
-DarchetypeVersion=1.1
-DgroupId=com.example
-DartifactId=app
-Dversion=1.0-SNAPSHOT
-Dpackage=com.example.project
"-DgroupId=com.example"
archetype:generate
commandFull example:
mvn archetype:generate -B "-DarchetypeGroupId=org.apache.maven.archetypes" "-DarchetypeArtifactId=maven-archetype-quickstart" "-DarchetypeVersion=1.1" "-DgroupId=com.example" "-DartifactId=app" "-Dversion=1.0-SNAPSHOT" "-Dpackage=com.example.project"
First, you should follow the advice of the error message. Call Maven with the additional flags to get more information.
Second, you should ensure that your internet connection is working from the command line. Are you able for example to download http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/2.2/maven-archetype-plugin-2.2.pom
from your browser? If not, Maven is not able to download the necessary plugins, and so the normal bootstrapping that is necessary before your project can be build is not done. Check if your browser is using a proxy, and you don't have defined an environment variable HTTP_PROXY
. If that is the case, define in the shell you are using your variable HTTP_PROXY
by the command:
set HTTP_PROXY=http://<my.proxy.host>:<port>
with the right values for my.proxy.host
and port
. If that works then well, define the environment variable for the system, so that every open shell has that environment variable defined.
Please add that information to your question, and sorry for the wrong advice to call ping http://....
, that cannot work.
I had a similar error and tried using double quotes to wrap all -D
and it worked for me..
Example:
mvn archetype:create "-DarchetypeGroupId=org.springframework.ws" "-DarchetypeArtifactId=spring-ws-archetype" "-DarchetypeVersion=2.1.4.RELEASE" "-DgroupId=com.mycompany.hr" "-DartifactId=holidayService"