[ http://jira.codehaus.org/browse/MNG-1775?page=comments#action_72375 ] 
            
James Olsen commented on MNG-1775:
----------------------------------

I think I have a similar problem.  I have 'version' properties defined in 
settings.xml which aren't always expanded, e.g:

<<<<<
[INFO] -------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] -------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: com.cognotec.common
ArtifactId: cognotec-common
Version: ${cognotec-common.version}

Reason: Unable to download the artifact from any repository

  com.cognotec.common:cognotec-common:pom:${cognotec-common.version}
>>>>>

... where cognotec-common.version has been defined in the settings.xml in an 
active profile.

If I build from a top level aggregator pom, it works fine.  If I build an 
individual module the expansion fails as shown above.

I use a flat directory structure with 'logical' parent directories:

trunk/build/pom.xml (master pom for inheritance)

trunk/subsystem1/subsystem1-root-module/pom.xml (inherits from 
../../build/pom.xml and aggregates module1 and module2)
trunk/subsystem1/module1/pom.xml (inherits from 
../subsystem1-root-module/pom.xml)
trunk/subsystem1/module2/pom.xml (inherits from 
../subsystem1-root-module/pom.xml)

trunk/subsystem2/subsystem2-root-module/pom.xml (inherits from 
../../build/pom.xml and aggregates module3 and module4)
trunk/subsystem2/module3/pom.xml (inherits from 
../subsystem2-root-module/pom.xml)
trunk/subsystem2/module4/pom.xml (inherits from 
../subsystem2-root-module/pom.xml)

trunk/pom.xml (aggregates build, subsystem1-root-module and 
subsystem2-root-module)

Works if I build trunk/pom.xml or one of the subsystemX-root-module/pom.xml 
files but not if I build a leaf module directly.


> No property expansion in profile activation
> -------------------------------------------
>
>                 Key: MNG-1775
>                 URL: http://jira.codehaus.org/browse/MNG-1775
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Inheritence and Interpolation
>    Affects Versions: 2.0, 2.0.1
>         Environment: Linux
>            Reporter: Eric Andresen
>             Fix For: 2.0.5
>
>
> 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

        

Reply via email to