Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven Project creation command stuck

Tags:

java

maven

I am trying to create a Jave Web project with following Maven command

mvn archetype:generate -DgroupId=com.mazhar.event -DartifactId=EventBook2 -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

and the process is stuck on Genrating project in batch mode

[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) @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.3:generate (default-cli) @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.3:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Batch mode

Here is my system details

mvn -vsersion
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 20:22:22+0500)
Maven home: D:\servers\apache-maven\bin\..
Java version: 1.6.0_32, vendor: Sun Microsystems Inc.
Java home: C:\Program Files (x86)\Java\jdk1.6.0_32\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
like image 969
PHP Avenger Avatar asked Jul 16 '15 11:07

PHP Avenger


2 Answers

Add -X to your command to enable Maven's debug logging.

If it's stuck on something like

[DEBUG] Searching for remote catalog: http://repo.maven.apache.org/maven2/archetype-catalog.xml

you probably have a connection problem. Since it has been working for you before, you obviously don't need to configure a proxy. Instead - since you are using Windows - my guess is, that your virus scanner/personal firewall is blocking or rather "scanning" the connection, resulting in a slow response. Try temporarily disabling your virus scanner/personal firewall and see if that helps.

like image 101
hzpz Avatar answered Sep 22 '22 23:09

hzpz


You can simply use local archetype-catalog.xml file instead of the remote one.

The option -DarchetypeCatalog=internal can do it well.

So, you are going to generate your project instantly now:

mvn -B archetype:generate -DarchetypeCatalog=internal -DgroupId=com.mycompany.app -DartifactId=my-app
like image 42
Wray Zheng Avatar answered Sep 24 '22 23:09

Wray Zheng