You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "KlaasJan Elzinga (JIRA)" <ji...@codehaus.org> on 2007/04/03 08:26:06 UTC

[jira] Created: (MWAR-96) WebResource not filtered with system properties.

WebResource not filtered with system properties.
------------------------------------------------

                 Key: MWAR-96
                 URL: http://jira.codehaus.org/browse/MWAR-96
             Project: Maven 2.x War Plugin
          Issue Type: Bug
    Affects Versions: 2.0.2
         Environment: java 5.0, Windows XP
            Reporter: KlaasJan Elzinga


When filtering a resource:
          <webResources>        
            <resource>
              <directory>${basedir}/src/main/resources/</directory>
              <filtering>true</filtering>
              <includes>
                 <include>index.jsp</include>
              </includes>                  
            </resource>
          </webResources>

The index.jsp contains:
	<tr><td>java version</td><td>${java.version}</td></tr>
	<tr><td>Project</td><td>${pom.name}</td></tr>
	<tr><td>Version</td><td>${pom.version}</td></tr>

After mvn clean install the filtered index.jsp looks like:
	<tr><td>java version</td><td>1.0.0.SNAPSHOT</td></tr>
	<tr><td>Project</td><td>FrieslandBank TMS TNS WebApp</td></tr>
	<tr><td>Version</td><td>1.0.0.SNAPSHOT</td></tr>

The value java.version is filtered to the version of the pom and not  the system property. The same goes for os.name which is translated to pom.name.

-- 
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

        

[jira] Updated: (MWAR-96) WebResource not filtered with system properties.

Posted by "KlaasJan Elzinga (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MWAR-96?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

KlaasJan Elzinga updated MWAR-96:
---------------------------------

    Attachment: patch-junit-test.txt

Patch for junit test (patch-junit-test.txt). It shows that the java.version is not filtered. 

I investigated a little further and found the following:
CompositeMap uses a dominant map and a recessive map. The dominant map is the pom (basically). It uses reflection to locate for example java.version. This value is found in the project since the ReflectionExtractor is stripping any root comments (java. in this case).  So for java.version the pom.version value is found.

I tried calling ReflectionValueExtractor with trimToken = false, but then no dominant values were found.

> WebResource not filtered with system properties.
> ------------------------------------------------
>
>                 Key: MWAR-96
>                 URL: http://jira.codehaus.org/browse/MWAR-96
>             Project: Maven 2.x War Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: java 5.0, Windows XP
>            Reporter: KlaasJan Elzinga
>         Attachments: patch-junit-test.txt
>
>
> When filtering a resource:
>           <webResources>        
>             <resource>
>               <directory>${basedir}/src/main/resources/</directory>
>               <filtering>true</filtering>
>               <includes>
>                  <include>index.jsp</include>
>               </includes>                  
>             </resource>
>           </webResources>
> The index.jsp contains:
> 	<tr><td>java version</td><td>${java.version}</td></tr>
> 	<tr><td>Project</td><td>${pom.name}</td></tr>
> 	<tr><td>Version</td><td>${pom.version}</td></tr>
> After mvn clean install the filtered index.jsp looks like:
> 	<tr><td>java version</td><td>1.0.0.SNAPSHOT</td></tr>
> 	<tr><td>Project</td><td>FrieslandBank TMS TNS WebApp</td></tr>
> 	<tr><td>Version</td><td>1.0.0.SNAPSHOT</td></tr>
> The value java.version is filtered to the version of the pom and not  the system property. The same goes for os.name which is translated to pom.name.

-- 
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

        

[jira] Updated: (MWAR-96) WebResource not filtered with system properties.

Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MWAR-96?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Lamy updated MWAR-96:
-----------------------------

    Fix Version/s: 2.1-alpha-2

> WebResource not filtered with system properties.
> ------------------------------------------------
>
>                 Key: MWAR-96
>                 URL: http://jira.codehaus.org/browse/MWAR-96
>             Project: Maven 2.x War Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: java 5.0, Windows XP
>            Reporter: KlaasJan Elzinga
>             Fix For: 2.1-alpha-2
>
>         Attachments: patch-CompositeMapa.txt, patch-junit-test.txt
>
>
> When filtering a resource:
>           <webResources>        
>             <resource>
>               <directory>${basedir}/src/main/resources/</directory>
>               <filtering>true</filtering>
>               <includes>
>                  <include>index.jsp</include>
>               </includes>                  
>             </resource>
>           </webResources>
> The index.jsp contains:
> 	<tr><td>java version</td><td>${java.version}</td></tr>
> 	<tr><td>Project</td><td>${pom.name}</td></tr>
> 	<tr><td>Version</td><td>${pom.version}</td></tr>
> After mvn clean install the filtered index.jsp looks like:
> 	<tr><td>java version</td><td>1.0.0.SNAPSHOT</td></tr>
> 	<tr><td>Project</td><td>FrieslandBank TMS TNS WebApp</td></tr>
> 	<tr><td>Version</td><td>1.0.0.SNAPSHOT</td></tr>
> The value java.version is filtered to the version of the pom and not  the system property. The same goes for os.name which is translated to pom.name.

-- 
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

        

[jira] Closed: (MWAR-96) WebResource not filtered with system properties.

Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MWAR-96?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Lamy closed MWAR-96.
----------------------------

      Assignee: Olivier Lamy
    Resolution: Fixed

fixed in rev 617677. Now the plugin use the maven-filtering component.

> WebResource not filtered with system properties.
> ------------------------------------------------
>
>                 Key: MWAR-96
>                 URL: http://jira.codehaus.org/browse/MWAR-96
>             Project: Maven 2.x War Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: java 5.0, Windows XP
>            Reporter: KlaasJan Elzinga
>            Assignee: Olivier Lamy
>             Fix For: 2.1-alpha-2
>
>         Attachments: patch-CompositeMapa.txt, patch-junit-test.txt
>
>
> When filtering a resource:
>           <webResources>        
>             <resource>
>               <directory>${basedir}/src/main/resources/</directory>
>               <filtering>true</filtering>
>               <includes>
>                  <include>index.jsp</include>
>               </includes>                  
>             </resource>
>           </webResources>
> The index.jsp contains:
> 	<tr><td>java version</td><td>${java.version}</td></tr>
> 	<tr><td>Project</td><td>${pom.name}</td></tr>
> 	<tr><td>Version</td><td>${pom.version}</td></tr>
> After mvn clean install the filtered index.jsp looks like:
> 	<tr><td>java version</td><td>1.0.0.SNAPSHOT</td></tr>
> 	<tr><td>Project</td><td>FrieslandBank TMS TNS WebApp</td></tr>
> 	<tr><td>Version</td><td>1.0.0.SNAPSHOT</td></tr>
> The value java.version is filtered to the version of the pom and not  the system property. The same goes for os.name which is translated to pom.name.

-- 
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

        

[jira] Updated: (MWAR-96) WebResource not filtered with system properties.

Posted by "KlaasJan Elzinga (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MWAR-96?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

KlaasJan Elzinga updated MWAR-96:
---------------------------------

    Attachment: patch-CompositeMapa.txt

Attached fix. I'm not sure if the original preferences regarding the dominant and the recessive are still there. With the patch applied the recessive Map gains preference if a conflict in propertynames is signalled. A better solution is probably to enhance the call to ReflectionValueExtractor in the dominant Map.

> WebResource not filtered with system properties.
> ------------------------------------------------
>
>                 Key: MWAR-96
>                 URL: http://jira.codehaus.org/browse/MWAR-96
>             Project: Maven 2.x War Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: java 5.0, Windows XP
>            Reporter: KlaasJan Elzinga
>         Attachments: patch-CompositeMapa.txt, patch-junit-test.txt
>
>
> When filtering a resource:
>           <webResources>        
>             <resource>
>               <directory>${basedir}/src/main/resources/</directory>
>               <filtering>true</filtering>
>               <includes>
>                  <include>index.jsp</include>
>               </includes>                  
>             </resource>
>           </webResources>
> The index.jsp contains:
> 	<tr><td>java version</td><td>${java.version}</td></tr>
> 	<tr><td>Project</td><td>${pom.name}</td></tr>
> 	<tr><td>Version</td><td>${pom.version}</td></tr>
> After mvn clean install the filtered index.jsp looks like:
> 	<tr><td>java version</td><td>1.0.0.SNAPSHOT</td></tr>
> 	<tr><td>Project</td><td>FrieslandBank TMS TNS WebApp</td></tr>
> 	<tr><td>Version</td><td>1.0.0.SNAPSHOT</td></tr>
> The value java.version is filtered to the version of the pom and not  the system property. The same goes for os.name which is translated to pom.name.

-- 
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

        

[jira] Commented: (MWAR-96) WebResource not filtered with system properties.

Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MWAR-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_115971 ] 

Olivier Lamy commented on MWAR-96:
----------------------------------

We must have a common place for this CompositeMap job because the same code it's used/duplicate in some place : resources plugin assembly plugin.
WDYT about maven-collections in shared ?


> WebResource not filtered with system properties.
> ------------------------------------------------
>
>                 Key: MWAR-96
>                 URL: http://jira.codehaus.org/browse/MWAR-96
>             Project: Maven 2.x War Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: java 5.0, Windows XP
>            Reporter: KlaasJan Elzinga
>         Attachments: patch-CompositeMapa.txt, patch-junit-test.txt
>
>
> When filtering a resource:
>           <webResources>        
>             <resource>
>               <directory>${basedir}/src/main/resources/</directory>
>               <filtering>true</filtering>
>               <includes>
>                  <include>index.jsp</include>
>               </includes>                  
>             </resource>
>           </webResources>
> The index.jsp contains:
> 	<tr><td>java version</td><td>${java.version}</td></tr>
> 	<tr><td>Project</td><td>${pom.name}</td></tr>
> 	<tr><td>Version</td><td>${pom.version}</td></tr>
> After mvn clean install the filtered index.jsp looks like:
> 	<tr><td>java version</td><td>1.0.0.SNAPSHOT</td></tr>
> 	<tr><td>Project</td><td>FrieslandBank TMS TNS WebApp</td></tr>
> 	<tr><td>Version</td><td>1.0.0.SNAPSHOT</td></tr>
> The value java.version is filtered to the version of the pom and not  the system property. The same goes for os.name which is translated to pom.name.

-- 
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

        

[jira] Updated: (MWAR-96) WebResource not filtered with system properties.

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MWAR-96?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Herve Boutemy updated MWAR-96:
------------------------------

    Description: 
When filtering a resource:
{code:xml}          <webResources>        
            <resource>
              <directory>${basedir}/src/main/resources/</directory>
              <filtering>true</filtering>
              <includes>
                 <include>index.jsp</include>
              </includes>                  
            </resource>
          </webResources>{code}

The index.jsp contains:
{code:xml}	<tr><td>java version</td><td>${java.version}</td></tr>
	<tr><td>Project</td><td>${pom.name}</td></tr>
	<tr><td>Version</td><td>${pom.version}</td></tr>{code}

After mvn clean install the filtered index.jsp looks like:
{code:xml}	<tr><td>java version</td><td>1.0.0.SNAPSHOT</td></tr>
	<tr><td>Project</td><td>FrieslandBank TMS TNS WebApp</td></tr>
	<tr><td>Version</td><td>1.0.0.SNAPSHOT</td></tr>{code}

The value java.version is filtered to the version of the pom and not the system property. The same goes for os.name which is translated to pom.name.

  was:
When filtering a resource:
          <webResources>        
            <resource>
              <directory>${basedir}/src/main/resources/</directory>
              <filtering>true</filtering>
              <includes>
                 <include>index.jsp</include>
              </includes>                  
            </resource>
          </webResources>

The index.jsp contains:
	<tr><td>java version</td><td>${java.version}</td></tr>
	<tr><td>Project</td><td>${pom.name}</td></tr>
	<tr><td>Version</td><td>${pom.version}</td></tr>

After mvn clean install the filtered index.jsp looks like:
	<tr><td>java version</td><td>1.0.0.SNAPSHOT</td></tr>
	<tr><td>Project</td><td>FrieslandBank TMS TNS WebApp</td></tr>
	<tr><td>Version</td><td>1.0.0.SNAPSHOT</td></tr>

The value java.version is filtered to the version of the pom and not  the system property. The same goes for os.name which is translated to pom.name.


> WebResource not filtered with system properties.
> ------------------------------------------------
>
>                 Key: MWAR-96
>                 URL: http://jira.codehaus.org/browse/MWAR-96
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: java 5.0, Windows XP
>            Reporter: KlaasJan Elzinga
>            Assignee: Olivier Lamy
>             Fix For: 2.1-alpha-2
>
>         Attachments: patch-CompositeMapa.txt, patch-junit-test.txt
>
>
> When filtering a resource:
> {code:xml}          <webResources>        
>             <resource>
>               <directory>${basedir}/src/main/resources/</directory>
>               <filtering>true</filtering>
>               <includes>
>                  <include>index.jsp</include>
>               </includes>                  
>             </resource>
>           </webResources>{code}
> The index.jsp contains:
> {code:xml}	<tr><td>java version</td><td>${java.version}</td></tr>
> 	<tr><td>Project</td><td>${pom.name}</td></tr>
> 	<tr><td>Version</td><td>${pom.version}</td></tr>{code}
> After mvn clean install the filtered index.jsp looks like:
> {code:xml}	<tr><td>java version</td><td>1.0.0.SNAPSHOT</td></tr>
> 	<tr><td>Project</td><td>FrieslandBank TMS TNS WebApp</td></tr>
> 	<tr><td>Version</td><td>1.0.0.SNAPSHOT</td></tr>{code}
> The value java.version is filtered to the version of the pom and not the system property. The same goes for os.name which is translated to pom.name.

-- 
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