Open minds leads to freedom

Communicating my thoughts on software development

Some interesting Maven tips

Posted by rnaufal on 24th August 2011

Here are some Maven tips, extracted from Javalobby:

  • Maven rf option: If your project has some modules and the build fails at one of them, it’s possible to run the build only at this module, preventing from running the entire build. You can achieve this behavior by executing this command:
  • mvn -rf my-project clean install

  • Maven pl option: This option allows you to build specific modules instead of building all projects. You can execute the following command to have this behavior:
  • mvn -pl my-project-A,my-project-B clean install

    This command will build only my-project-A and my-project-B.

Tags: , , , , ,
Posted in Uncategorized | No Comments »

Maven Eclipse plugin using project dependencies

Posted by rnaufal on 22nd August 2011

Some months ago I was noting the behavior of the Maven Eclipse plugin during the eclipse:eclipse goal.

I realized that its default behavior is to build the dependencies based on the Eclipse projects instead of the installed packages on the repository. During development time, it’s the behavior we need, but if you want to build the Eclipse files using the packages on the repository, you have to use the following command:

mvn eclipse:eclipse -Declipse.useProjectReferences=false

By default, the useProjectReferences flag is set to true, in other words, the plugin will create and reference the projects in Eclipse. Without it you’ll have to use mvn install to make changes available for dependent projects. Very interesting to note.

Update *: After creating the project dependencies, you have to execute mvn install to make it available for mvn eclipse:eclipse on dependent projects for the first time.

Tags: , , , , ,
Posted in Uncategorized | No Comments »