Suppose I have a module A:jar
, whose runtime and compilation set of dependencies depends on the JDK version. In my example, I have a pre-jdk6-profile
a) In a multi-module build, you should always build from the top pom, never from an individual module. If you want to build only one module, use advanced reactor options (see mvn --help) like this:
mvn -pl mymodule
b) Define and activate the profile in the parent pom, but add the configuration in the child pom.
parent pom.xml
pre-jdk-6
(,1.6.0)
child pom.xml
pre-jdk-6
javax.xml.ws
jaxws-api