Maven p1

So, after one has installed maven, and put it in one's path, you can start by simply creating a new directory.

In that directory, you need a pom.xml.


Maven's default directory for java source code is src/main/java. Create that and put in a simple

	public class Hello {
		public static void main(String[] args) {
		public int testMethod() {
			return 42;

Then if you run 'mvn install' you'll build, test (if there were tests) and installed a jar file. To actually run this, call:

	java -cp target/test-1.jar Hello

Edit on github
comments powered by Disqus
Click me