I am using maven version 3.0.4.I am beginner in maven.I created a Hello world Java project using eclipse.
Now using maven I want to make a executable jar of it and run it.I am not getting how to do. I also googled for it but what I got is how to create a java project not how to build an existing a java project.
Help me out.
Download the Maven eclipse Sonatype plugin, and create a Maven project from there.
Use the default Java project archetype usually provided in the list of available archetypes. Upon project creation you will be given a pom.xml.
With the Maven Eclipse plugin, you can build from Eclipse IDE, again the process is simple through build configuration. You will be able to see Maven build configs from there, the build command for Java project should be clean build. (Off my mind) by default, the build e.g. a JAR would be placed in the target folder after successful build.
For existing projects that need to be converted to Maven, you will have to hand create a pom.xml descriptor if you are not using the plugin.
One way is to tweak the jar plugin:
http://maven.apache.org/shared/maven-archiver/examples/classpath.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With