This page collects various things learned about Maven and tips on how we use it.
Parent Poms
These can serve as a common spot to put shared things inherited by child poms.
These can serve as a place to specify (in the <modules> element) children to recursively process.
- These two functions need not be the same POM, but are in our current implementation
- You can install the shared, parent POM without running the install on the children by using the parameter -N, e.g.
- mvn -N install
This will install the parent to your local repository (which you need to do if you change it) without running the install on the children.
- mvn -N install
The mvn command
The mvn command documention appears when you type mvn -help. Besides the options, it takes 0 or more goals to run, and/or 0 or more life-cycle phases to run. If given a life cycle phase, such as "install", it runs all the previous phases in the life cycle, up to that point. If given a goal, such as "eclipse:eclipse", it may run life-cycle phases up to a specified point, depending on the goal implementation. For eclipse:eclipse, the documentation says it runs the phase "generate-resources" - meaning it runs all the life cycle phases up to that point.
Coding dependency scopes: compile vs. provided
compile:
- the dependency mechanism operates transitively, and dependencies of the dependent artifact are located and included, too.
- the eclipse:eclipse for Eclipse plug-in projects puts <link>s to the jars in the local repository into the .project file
provided:
- the dependency mechanism doesn't fetch the dependents of the dependent artifact - the chain stops here
- the eclipse:eclipse for Eclipse plugin projects doesn't put any <link>s in the .project file. The .classpath file has an entry for the required plugins container, and the plugin container is set up to reference the other project directly