Adventures in CS

Maven tidbits

11 Mar 2019

Useful maven tidbits

Updated on: 11-03-2019

Using a local version of the dependency

Sometimes you just need to use a local version of the dependency rather than fetching it from the maven central repository. You can add a local repository by providing the path to the local repository folder by adding the following to pom.xmla:


Building a specific module

If you want to build a single module ‘B’ and the module required by ‘B’ then you can use the following command:

mvn install -pl B -am

Working with SNAPSHOT artifacts of an Apache project

SNAPSHOT artifacts from Apache have dedicated Maven repository. You would need to add the information about the following repository to get them through maven. Add the following to pom.xml:

      <name>Apache Development Snapshot Repository</name>

Adding target bytecode version info

In specific situation IntelliJ IDEA causes the following error with Maven, Error:java: javacTask: source release 8 requires target release 1.8. You can resolve that error by adding the compiler plugin to pom.xml under the top-level project node:


Disable checkstyle

While not recommended, in some cases you might be look to do some quick modifications and test them for a maven project. You can disable the checkstyle plugin Using mvn [target] -Dcheckstyle.skip



Tweet me @mb_ce if you like this post.

comments powered by Disqus