[
http://jira.codehaus.org/browse/MNG-1775?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=146450#action_146450
]
Shelley Baker commented on MNG-1775:
------------------------------------
I am encountering this issue as well using profiles in Maven 2.0.9 on Windows
Vista with an individual JAR project (it is not a parent/reactor build, nor
does it have a parent). I need to activate a profile based on the existence of
a packaged jar in the build output directory (ie:
${project.build.directory}/${project.build.finalName}). Hard-coding the build
directory, though undesirable, is not a problem, but hard-coding the final name
is error-prone since this will need to manually change during/after every
release.
It looks like there hasn't been any activity on this bug for several years; are
there plans to resolve this, or is this limitation intentional?
> No property expansion in profile activation
> -------------------------------------------
>
> Key: MNG-1775
> URL: http://jira.codehaus.org/browse/MNG-1775
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0, 2.0.1
> Environment: Linux
> Reporter: Eric Andresen
> Fix For: 2.0.x
>
>
> 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}/../build.properties</missing></file>
> </activation>
> <build>
>
> <filters><filter>${basedir}/../build.properties.metis</filter></filters>
> </build>
> </profile>
> <profile>
> <id>dev</id>
> <activation>
> <file><exists>${basedir}/../build.properties</exists></file>
> </activation>
> <build>
>
> <filters><filter>${basedir}/../build.properties</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}/../build.properties", rather than
> "/home/joe/projectX/projY/../build.properties"; 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:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira