maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marat Radchenko (JIRA)" <j...@codehaus.org>
Subject [jira] Commented: (MWAR-89) filtering ${something.url} ignores my property value and writes http://maven.apache.org/something
Date Fri, 17 Aug 2007 14:52:47 GMT

    [ http://jira.codehaus.org/browse/MWAR-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_105095
] 

Marat Radchenko commented on MWAR-89:
-------------------------------------

I've encountered this error too. It is easy to workaround but very annoying :(

To reproduce:
mvn  archetype:create -DgroupId=sample.group.id -DartifactId=sample-artifact-id -DarchetypeArtifactId=maven-archetype-webapp
&& cd sample-artifact-id && echo 'test=${test.url}' > src/main/resources/test.properties

then manually add this to <build> into pom.xml:
{code:xml}
    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <webResources>
            <resource>
              <directory>src/main/resources</directory>
              <includes>
                <include>test.properties</include>
              </includes>
              <targetPath>WEB-INF</targetPath>
              <filtering>true</filtering>
            </resource>
          </webResources>
        </configuration>
      </plugin>
    </plugins>
{code}

And then run
mvn war:exploded && cat target/sample-artifact-id/WEB-INF/test.properties
you'll see test=http://maven.apache.org which is absolutely incorrect.

> filtering ${something.url} ignores my property value and writes http://maven.apache.org/something
> -------------------------------------------------------------------------------------------------
>
>                 Key: MWAR-89
>                 URL: http://jira.codehaus.org/browse/MWAR-89
>             Project: Maven 2.x War Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>            Reporter: Paul Jungwirth
>            Assignee: Stephane Nicoll
>            Priority: Minor
>
> I have a multimodule build, and one of the modules is a war. That module has an artifactId
of "aardvark." This is aardvark's pom:
> <project>
>   ...
>   <properties>
>     <something.url>http://anywhere.com/</something.url>
>     <another.property>whatever</another.property>
>   </properties>
>   ...
>   <build>
>     <plugins>
>       <plugin>
>         <artifactId>maven-war-plugin</artifactId>
>         <configuration>
>           <webResources>
>             <resource>
>                <directory>${basedir}/src/main/resources</directory>
>                <filtering>true</filtering>
>             </resource>
>           </webResources>
>        </configuration>
>       </plugin>
>     </plugins>
>   </builg>
> </project>
> Inside src/main/resources, I have a file that includes both ${something.url} and ${another.property}.
But when I run maven, ${another.property} is filtered correctly, while ${something.url} becomes
"http://maven.apache.org/aardvark." It ignores my value and writes a URL to apache.org instead,
appending the artifactId. Weird, huh? This seems to happen with any property that ends in
".url." Is this supposed to be a feature? I've never seen it documented anywhere.
> Thanks,
> Paul

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

        

Mime
View raw message