Maven Tutorial – a recap – II

Please find the previous part of this post here.

After creating the project, lets package it now

mvn package -Djava.net.preferIPv4Stack=true
[INFO] Building jar: D:\maven\my-app\target\my-app-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.918s
[INFO] Finished at: Wed Jun 26 10:02:28 IST 2013
[INFO] Final Memory: 8M/154M
[INFO] ------------------------------------------------------------------------

Now run it,

D:\maven\my-app>java -cp target\my-app-1.0-SNAPSHOT.jar org.grassfield.mvn.App
Hello World!

DSC00196

Build it along with dependencies. Run the SureFire tests and generate test reports

D:\maven\my-app>mvn clean dependency:copy-dependencies package -Djava.net.preferIPv4Stack=true
[INFO]
[INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ my-app ---
[INFO] Building jar: D:\maven\my-app\target\my-app-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:48.675s
[INFO] Finished at: Wed Jun 26 10:15:47 IST 2013
[INFO] Final Memory: 16M/155M
[INFO] ------------------------------------------------------------------------

and finally
mvn package -Djava.net.preferIPv4Stack=true

to be continued….

Advertisements

One thought on “Maven Tutorial – a recap – II

  1. Pingback: Maven Tutorial – 3 | JavaShine

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s