You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (JIRA)" <ji...@codehaus.org> on 2014/07/02 21:42:10 UTC
[jira] (MNG-2632) Setting property in profiles is not evaluated for
POM validation
[ https://jira.codehaus.org/browse/MNG-2632?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Osipov updated MNG-2632:
--------------------------------
Fix Version/s: (was: Issues to be reviewed for 3.x)
3.0
> Setting property in profiles is not evaluated for POM validation
> ----------------------------------------------------------------
>
> Key: MNG-2632
> URL: https://jira.codehaus.org/browse/MNG-2632
> Project: Maven
> Issue Type: Bug
> Components: POM
> Affects Versions: 2.0.4
> Environment: WinXP
> Reporter: Christoph Amshoff
> Fix For: 3.0
>
> Attachments: fix.patch
>
>
> There seems to be a problem concerning POM validation and setting properties in profiles.xml: when I set a property in my profiles.xml it is not evaluated for POM validation in a multi module build.
> The details: My project C depends on module B, which itself is a child of module A. Module A defines a system scope dependency like this:
> {code}
> <dependency>
> <groupId>db2</groupId>
> <artifactId>db2</artifactId>
> <version>8.2</version>
> <scope>system</scope>
> <systemPath>${path.db2jar}</systemPath>
> </dependency>
> {code}
> The path to db2.jar depends on the developer's machine and is specified in the profiles.xml, toghether with other settings. Both A and B are building and deploying fine.
> Now, when I try to build C, it complains about missing definition for 'path.db2jar':
> {code}
> [WARNING] POM for '...B:pom:4.4.0-SNAPSHOT:compile' is invalid. It will be ignored for artifact resolution. Reason:
> Failed to validate POM
> [DEBUG] Reason: Failed to validate POM
> [DEBUG]
> Validation Errors:
> [DEBUG] For dependency Dependency {groupId=db2, artifactId=db2, version=8.2, type=jar}: system-scoped dependency
> must specify an absolute path systemPath.
> {code}
> I'm using a profiles.xml section like this one:
> {code}
> <profile>
> <id>env-nb</id>
> <activation>
> <property>
> <name>env</name>
> <value>nb</value>
> </property>
> </activation>
> <properties>
> <path.db2jar>c:/programme/IBM/SQLLIB/java/db2java.zip</path.db2jar>
> ...
> </properties>
> </profile>
> {code}
> which is triggered by -Denv=nb, and this activation is working fine since 'help:effective-pom' is correctly showing me something like
> {code}
> <properties>
> <path.db2jar>c:/programme/IBM/SQLLIB/java/db2java.zip</path.db2jar>
> ...
> </properties>
> {code}
> So the profiles.xml seems to be evaluated correctly, but the property is not used for validating the POM of dependent modules.
> And yes, when I run Maven without the profiles.xml, but with specifying the property on command line (like '-Dpath.db2jar=...'), all is working fine! But that's not exactly what we want, since profiles are meant to encapsulate those kind of settings...
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)