maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Rohlfs (JIRA)" <>
Subject [jira] Commented: (MNG-1775) No property expansion in profile activation
Date Thu, 04 Feb 2010 14:55:56 GMT


Marc Rohlfs commented on MNG-1775:

Hi Karel, just some comments:

Without the basedir property it works, however, the test would not work when building a multi-module

test (module)

When running from 'myproject', the file myproject/pom.xml would be checked
When running from 'test', the file myproject/test/pom.xml would be checked.
The {{basedir}} property always points to the directory of the POM that is currently processed,
not depending if You initiate the build from a parent module. If You want to check the {{myproject/pom.xml}}
in {{myproject/test/pom.xml}}, You should use another property (like e.g. {{multiproject.basedir}})
and define it like
in the parent POM and
in the 1st level submodules and so on ...
This means that it wouldn't help You to work on the expansion of just the {{basedir}} property.
I didn't check the patch You attached today, but I wonder if it worked.

One possible solution would go along these lines:
1. originalModel = cloneModel(model)
2. interpolate(model)
3. determine active profiles, add their properties to the list of properties for interpolation
4. interpolate(model) again.

But then you would have weird situations ...
I'm totally with You on this, I'd really like to have a two-step interpolation just like You
described it. But I also see undefined situation coming up. And I think that's the reason
why (by now) they only consider the expansion of the {{basedir}} property for profile activations.
I'd suggest to discuss this on the Maven Developers mailing list first, because otherwise
Maven Comitters might just decline any patch You invent on this.

About the patch You attached: Was it really a patch for the trunk (respectively for Maven
3)? Somehow I think that it is for Maven 2 ({{maven-2/branches/maven-2.2.x}}). Did You read
the page about [Creating and submitting a patch|]?

Kind regards

> No property expansion in profile activation
> -------------------------------------------
>                 Key: MNG-1775
>                 URL:
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 2.0, 2.0.1
>         Environment: Linux
>            Reporter: Eric Andresen
>             Fix For: 3.0-alpha-7
>         Attachments: basedir_in_activation.patch,,
> I have a profile specified in the pom.xml of a project. It is inteded to be activated
based on the presence or absence of a file, using the <file> profile activator.
> The profiles are simple:
>       <profile>
>           <id>metis</id>
>           <activation>
>               <file><missing>${basedir}/../</missing></file>
>           </activation>
>           <build>
>               <filters><filter>${basedir}/../</filter></filters>
>           </build>
>       </profile>
>       <profile>
>           <id>dev</id>
>           <activation>
>               <file><exists>${basedir}/../</exists></file>
>           </activation>
>           <build>
>               <filters><filter>${basedir}/../</filter></filters>
>           </build>
>       </profile>
> The problem comes in with ${basedir} -- it isn't being expanded for purposes of evaluating
the file. It's trying to look for a file named "${basedir}/../", rather than
"/home/joe/projectX/projY/../"; as a result, the "missing" directive is always
true, and the dev profile is never activated. When the filter path is evaluated, the ${basedir}
property *is* evaluated, however.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message