You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Zachary Smith (JIRA)" <ji...@codehaus.org> on 2008/12/09 19:17:19 UTC

[jira] Commented: (MNG-1775) No property expansion in profile activation

    [ http://jira.codehaus.org/browse/MNG-1775?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=157445#action_157445 ] 

Zachary Smith commented on MNG-1775:
------------------------------------

I'd also like to chime in and request a fix to this.  I've been pulling my hair out on this all morning.   Hard coding the path does work but will not be easily used in our environment so I'm sort of stuck.   

The profile is supposed to run to make sure that no dev domain is running when the CI tests run because CI generates its own domain.

		<profile>
			<!-- if a developer runs CI on there machine make sure the dev domain is stopped -->
			<id>ci-setup</id>
			<activation>
				<file>
                                       <!-- dev.domain.dir is set in a parent pom from:  ${glassfish.home}/domains/${dev.domain.name} -->
					<exists>${dev.domain.dir}</exists>
				</file>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.glassfish.maven.plugin</groupId>
						<artifactId>maven-glassfish-plugin</artifactId>
						<executions>
							<execution>
								<id>stop-domain</id>
								<inherited>true</inherited>
								<goals>
									<goal>stop-domain</goal>
								</goals>
								<phase>pre-integration-test</phase>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>


> 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