Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Won't Fix
-
Affects Version/s: 2.0.2
-
Fix Version/s: None
-
Component/s: POM
-
Labels:None
-
Complexity:Intermediate
-
Number of attachments :
Description
I have a multi-module build, and at the top-level I have a profile called 'release-environment', which is activated by -Denv=release.
I need the local release build to use different values for JDBC configuration to run integration tests, and defined them in a profiles.xml:
<?xml version="1.0" encoding="UTF-8"?> <settings> <profiles> <profile> <id>local-release-environment</id> <activation> <property> <name>env</name> <value>release</value> </property> </activation> <properties> <jdbc.username>mif_jason</jdbc.username> <jdbc.password>mif_jason</jdbc.password> <jdbc.schema>MIF_JASON</jdbc.schema> </properties> </profile> </profiles> </settings>
My project looks like:
pom.xml
merchant/pom.xml
merchant/core/pom.xml
merchant/services/pom.xml
If i put profiles.xml as a peer to pom.xml and run mvn clean install -Denv=release from the top-level, I get errors because the properties are not propagated to the merchant/core/pom.xml module.
If I put profiles.xml as a peer to merchant/core/pom.xml and run mvn clean install -Denv=release, then it works as expected... properties are set as they are defined in profiles.xml.
But, this is not manageable, as I need to set some properties for all of the modules in a multi-module build... But I don't want to use those properties for all Maven2 projects, so I can not really put it into ~/.m2/settings.xml
I had expected that a top-level profiles.xml would work, but it does not. Is this by design, is there another recommend way to provide per-top-level multi-module project configuration on a local user basis (ie. no pom.xml modifications)?
Issue Links
| This issue is duplicated by: | ||||
| MNG-2982 | Profile of a pom doesn't execute when running a reactor build of a child pom |
|
|
|
I am seeing a similar problem, related to this, but slightly different. My project looks like this:
app/pom.xml – root pom
app/profiles.xml
app/java/pom.xml - also a pom
app/java/project1/pom.xml – a jar project
app/java/project2/pom.xml – also jar
If I build from app, the properties are defined. They are also defined when I build from project1 or project2, however, if I decide to build from java, the profiles are not loaded. I had to move my profiles into ~/.m2/settings.xml; I don't believe they belong there, since they are project scoped variables, and are not applicable to my plugins project, for example. We also build our app project from multiple branches, each branch requires it's own profiles. We define various paths that are different between branches.