jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x WAR Plugin
  • MWAR-96

WebResource not filtered with system properties.

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0.2
  • Fix Version/s: 2.1-alpha-2
  • Component/s: None
  • Labels:
    None
  • Environment:
    java 5.0, Windows XP

Description

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.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    patch-CompositeMapa.txt
    03/Apr/07 4:56 AM
    1 kB
    KlaasJan Elzinga
  2. Text File
    patch-junit-test.txt
    03/Apr/07 3:13 AM
    1 kB
    KlaasJan Elzinga

Issue Links

depends upon

Improvement - An improvement or enhancement to an existing feature or task. MSHARED-46 Create a common component for files filtering

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
KlaasJan Elzinga added a comment - 03/Apr/07 3:13 AM

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.

Show
KlaasJan Elzinga added a comment - 03/Apr/07 3:13 AM 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.
Hide
Permalink
KlaasJan Elzinga added a comment - 03/Apr/07 4:56 AM

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.

Show
KlaasJan Elzinga added a comment - 03/Apr/07 4:56 AM 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.
Hide
Permalink
Olivier Lamy added a comment - 05/Dec/07 5:32 PM

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 ?

Show
Olivier Lamy added a comment - 05/Dec/07 5:32 PM 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 ?
Hide
Permalink
Olivier Lamy added a comment - 01/Feb/08 4:24 PM

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

Show
Olivier Lamy added a comment - 01/Feb/08 4:24 PM fixed in rev 617677. Now the plugin use the maven-filtering component.

People

  • Assignee:
    Olivier Lamy
    Reporter:
    KlaasJan Elzinga
Vote (0)
Watch (1)

Dates

  • Created:
    03/Apr/07 1:25 AM
    Updated:
    01/May/11 3:21 AM
    Resolved:
    01/Feb/08 4:24 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.