maven pom.xml settings

Adding main class to manifest


Customize java source directory:

Some project’s source directory is not following the maven convention. Instead of being inside src/main/java

Just add this to your pom in the build section.


Here’s the relevant section of the POM doc on configuring the directories.

Including local JAR files as dependency in a Maven project

To avoid fetch dependency from remote repository is to use Maven’s system scope and systemPath feature:


This will reference a dependency from the local filesystem, which means you do not have to install the JAR into the repository in order to use it. This is particularly useful when you’re doing some prototyping or research into a new technology.

Skipping Tests

If you want to skip tests by default but want the ability to re-enable tests from the command line, you need to go via a properties section in the pom:


This will allow you to run with tests disabled by default and to run them with this command:

mvn install -DskipTests=false

If you absolutely must, you can also use the maven.test.skip property to skip compiling the tests. maven.test.skip is honored by Surefire, Failsafe and the Compiler Plugin.

mvn install -Dmaven.test.skip=true

For details see Skipping Tests