You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Guillaume Doumenc (JIRA)" <ji...@codehaus.org> on 2011/06/29 08:39:42 UTC

[jira] Created: (MNG-5126) parent.name variable

parent.name variable
--------------------

                 Key: MNG-5126
                 URL: https://jira.codehaus.org/browse/MNG-5126
             Project: Maven 2 & 3
          Issue Type: Bug
          Components: Inheritance and Interpolation, Plugins and Lifecycle
    Affects Versions: 3.0.2
         Environment: Apache Maven 3.0.2 (r1056850; 2011-01-09 01:58:10+0100)
Java version: 1.6.0_22, vendor: Sun Microsystems Inc.
Java home: C:\Program Files (x86)\Java\Glassfish\jdk\jre
Default locale: fr_FR, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
            Reporter: Guillaume Doumenc
            Priority: Minor


Following code use ${parent.name} for war name and values in web.xml

				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.1.1</version>
				<configuration>
					<warName>${parent.name}</warName>
					<outputDirectory>deploy</outputDirectory>
					<webResources>
						<resource>
							<directory>src/main/webapp/WEB-INF</directory>
							<filtering>true</filtering>
							<includes>
								<include>web.xml</include>
							</includes>
							<targetPath>WEB-INF</targetPath>
						</resource>
					</webResources>
				</configuration>

The "issue" is the expanded value is not same for <warName> and <filtering>
The POM parent has name = "coworks.new"
In web.xml ${parent.name} is replaced by "coworks.new" but war name is coworks-1.0-SNAPSHOT.war



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

        

[jira] Closed: (MNG-5126) parent.name variable

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MNG-5126?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MNG-5126.
----------------------------------

    Resolution: Not A Bug
      Assignee: Benjamin Bentmann

{{$\{parent.\*\}}} is not a supported expression, what you actually want is {{$\{project.parent.name\}}}.

In general though, expressions of the form {{$\{project.parent.*}}} are a bad practice as they rely on a certain build state and do not generally work throughout the POM, giving rise to surprises. Instead, consider to define a dedicated property {{myWarName}} or such in the parent POM, that you initialize with the desired value, and referencing that property where needed.

> parent.name variable
> --------------------
>
>                 Key: MNG-5126
>                 URL: https://jira.codehaus.org/browse/MNG-5126
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Inheritance and Interpolation, Plugins and Lifecycle
>    Affects Versions: 3.0.2
>         Environment: Apache Maven 3.0.2 (r1056850; 2011-01-09 01:58:10+0100)
> Java version: 1.6.0_22, vendor: Sun Microsystems Inc.
> Java home: C:\Program Files (x86)\Java\Glassfish\jdk\jre
> Default locale: fr_FR, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
>            Reporter: Guillaume Doumenc
>            Assignee: Benjamin Bentmann
>            Priority: Minor
>
> Following code use ${parent.name} for war name and values in web.xml
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-war-plugin</artifactId>
> 				<version>2.1.1</version>
> 				<configuration>
> 					<warName>${parent.name}</warName>
> 					<outputDirectory>deploy</outputDirectory>
> 					<webResources>
> 						<resource>
> 							<directory>src/main/webapp/WEB-INF</directory>
> 							<filtering>true</filtering>
> 							<includes>
> 								<include>web.xml</include>
> 							</includes>
> 							<targetPath>WEB-INF</targetPath>
> 						</resource>
> 					</webResources>
> 				</configuration>
> The "issue" is the expanded value is not same for <warName> and <filtering>
> The POM parent has name = "coworks.new"
> In web.xml ${parent.name} is replaced by "coworks.new" but war name is coworks-1.0-SNAPSHOT.war

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