[ 
https://jira.codehaus.org/browse/MNG-2363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=285044#comment-285044
 ] 

David Biesack commented on MNG-2363:
------------------------------------

Can someone identify which released version (of what plugin) this is fixed?
I still see this bug (however, I do not have a multi-project config); just a 
pom.xml and a parent pom.
In my <profiles> in the project pom.xml I have 

  <profile>
            <id>cobertura.off</id>
            <activation>
                <file> 
                    <exists>${basedir}/cobertura.off</exists>
                </file>
            </activation>
            <properties>
              <skip.cobertura>true</skip.cobertura>
            </properties>
        </profile>
        <profile>
            <id>cobertura.on</id>
            <activation>
                <file>
                    <missing>${basedir}/cobertura.off</missing>
                </file>
            </activation>
            <properties>
              <skip.cobertura>false</skip.cobertura>
            </properties>
        </profile>

but even if the file cobertura.off exists (same dir as pom.xml), mvn 
help:active-profiles shows that cobertura.on is active and cobertura.off is not 
active.

This does work if I use <exists>cobertura.off</exists> and  
<missing>cobertura.off</missing> respectively

Thus the doc at http://maven.apache.org/pom.html#Activation is (still) wrong as 
it shows use of ${basedir}/

I'm using apache-maven-2.2.1

> <profile><activation><file><exists/> does not work in a multi-project build
> ---------------------------------------------------------------------------
>
>                 Key: MNG-2363
>                 URL: https://jira.codehaus.org/browse/MNG-2363
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Profiles
>            Reporter: David Boden
>            Assignee: Benjamin Bentmann
>            Priority: Critical
>             Fix For: 3.0-alpha-3
>
>         Attachments: DefaultMavenProjectBuilder.java, 
> DefaultMavenProjectBuilder.java, DefaultMavenProjectBuilder.java.diff, 
> problemactivation.zip, screenshot-1.jpg
>
>
> I would expect each subproject to have the profile turned on or off depending 
> on whether ${basedir}/file-to-check-for exists.
> Instead, during a multi-project build the profile is either on or off 
> depending on whether the file exists relative to the *aggregator pom*. The 
> decision is made once.
> Variable substitution doesn't work, so I can't explicitly use 
> <exists>${basedir}/file-to-check-for</exists> or any variation on this theme 
> to workaround the bug.
> Some background to my particular problem. I have 10 modules to build. Some of 
> them are GUI modules and contain a file called plugin.xml in the subproject 
> directory. I want to package these up specially and sign them, ready for 
> deployment to webstart. The other modules are shared and server code and I 
> don't want these packaged in the same way. So, I've got a dependency in my 
> *parent* pom file which activates a profile called "guibundle" if a 
> plugin.xml file exists in the subproject directory.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to