Using Maven to build and run Java applications

Using Maven to build and run Java applications

Say you want to have Maven handle the dependencies for your java application containing the well known “public static void main” method. Create a Maven project, put your MyApplication.java file under the “src”-folder, and add something like this to you pom.xml:

Now you can run your application using the exec-maven-plugin, like this:

Leave a Reply

%d bloggers like this: