You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "hugo lassiege (JIRA)" <ji...@codehaus.org> on 2009/06/25 13:59:54 UTC

[jira] Created: (MWAR-200) Filtering resource don't work as expected

Filtering resource don't work as expected
-----------------------------------------

                 Key: MWAR-200
                 URL: http://jira.codehaus.org/browse/MWAR-200
             Project: Maven 2.x WAR Plugin
          Issue Type: Bug
    Affects Versions: 2.1-beta-1, 2.1-alpha-1
         Environment: windows and unix
            Reporter: hugo lassiege
         Attachments: toto.txt

Hi,

I try to use maven war plugin and cargo however I have a problem with maven-war-plugin and the filtering.
I tried with 2.1-beta-1 and alpha1

My configuration for the maven-war-plugin is the following :

{code:xml}
			<!-- pour tout les projets d'intégration, il faut ajouter un fichier context.xml qui sera filtré -->	
	        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
			<version>2.1-beta-1</version>
            <configuration>
                <webResources>
                    <resource>
                        <directory>${basedir}/src/main/webapp/META-INF</directory>
                        <filtering>true</filtering>
                        <includes>
                            <include>context.xml</include>
                        </includes>
                        <targetPath>META-INF/</targetPath>
                    </resource>
                </webResources>
            </configuration>
        </plugin>  
{code}

My goal is to filter the context.xml to modify the name of the datasource

My context.xml unfiltered is :

{code:xml}
<!-- Context configuration file for the Webintake services -->
<Context path="/myWebapp" debug="0" privileged="true" reloadable="false">
	<Resource auth="Container" name="jdbc/DATABASEHTTP" factory="org.apache.commons.dbcp.BasicDataSourceFactory"
		type="javax.sql.DataSource" driverClassName="${connection.driver_class}"
		url="${connection.url}" username="${connection.username}" password="${connection.password}" maxActive="50" maxIdle="2"
		maxWait="10000" />
</Context>
{code}

I use mvn clean install to launch the build
In DEBUG mode I have :

{code}
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-war-plugin:2.1-alpha-1:war' -->
[DEBUG]   (f) addDefaultSpecificationEntries = true
[DEBUG]   (f) addDefaultImplementationEntries = true
[DEBUG]   (s) manifest = org.apache.maven.archiver.ManifestConfiguration@1d50fd2
[DEBUG]   (f) archive = org.apache.maven.archiver.MavenArchiveConfiguration@101ac1c
[DEBUG]   (s) archiveClasses = true
[DEBUG]   (s) cacheFile = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\war\work\webapp-cache.xml
[DEBUG]   (s) classesDirectory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\classes
[DEBUG]   (s) filters = []
[DEBUG]   (f) outputDirectory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target
[DEBUG]   (f) primaryArtifact = true
[DEBUG]   (s) project = MavenProject: fr.sgf.wit:webintake-security-integration:3.5.0-alpha3-SNAPSHOT @ E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\pom.xml
[DEBUG]   (s) useCache = true
[DEBUG]   (f) warName = webintake-security-integration-3.5.0-alpha3-SNAPSHOT
[DEBUG]   (s) warSourceDirectory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\src\main\webapp
[DEBUG]   (s) directory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration/src/main/webapp/META-INF
[DEBUG]   (s) filtering = true
[DEBUG]   (s) includes = [context.xml]
[DEBUG]   (s) targetPath = META-INF/
[DEBUG]   (s) webResources = [Resource {targetPath: META-INF/, filtering: true, FileSet {directory: E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration/src/main/webapp/META-INF, PatternSet [includes: {context.xml}, excludes: {}]}}]
[DEBUG]   (s) webappDirectory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\webintake-security-integration-3.5.0-alpha3-SNAPSHOT
[DEBUG]   (s) workDirectory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\war\work
[DEBUG] -- end configuration --
[INFO] [war:war]
[INFO] Packaging webapp
[INFO] Assembling webapp[webintake-security-integration] in [E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\webintake-security-integration-3.5.0-alpha3-SNAPSHOT]
[INFO] Processing war project
[INFO] Copy webapp webResources[E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration/src/main/webapp/META-INF] to[E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\webintake-security-integration-3.5.0-alpha3-SNAPSHOT]
[DEBUG]  + META-INF/\context.xml has been copied.
[DEBUG]  + META-INF/context.xml has been copied.
{code}

So the filtering is active and the context.xml is copied as expected but not filtered !
The file is not modified, I still have the variable not filtered.

If I make mvn install (removing the clean) it works the second time, I guess the file is read from the right place the second time ?

I attached the mvn command with option -X  



-- 
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-200) Filtering resource don't work as expected

Posted by "Stephane Nicoll (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MWAR-200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=184892#action_184892 ] 

Stephane Nicoll commented on MWAR-200:
--------------------------------------

Well, that's the weird thing about *external* web resource.  src/main/webapp is *already* handled as a resource so you're defining it a second time. I assume we need a way to filter those out of the box or to define a special token for it or something.



> Filtering resource don't work as expected
> -----------------------------------------
>
>                 Key: MWAR-200
>                 URL: http://jira.codehaus.org/browse/MWAR-200
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1-alpha-1, 2.1-beta-1
>         Environment: windows and unix
>            Reporter: hugo lassiege
>         Attachments: toto.txt
>
>
> Hi,
> I try to use maven war plugin and cargo however I have a problem with maven-war-plugin and the filtering.
> I tried with 2.1-beta-1 and alpha1
> My configuration for the maven-war-plugin is the following :
> {code:xml}
> 			<!-- pour tout les projets d'intégration, il faut ajouter un fichier context.xml qui sera filtré -->	
> 	        <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-war-plugin</artifactId>
> 			<version>2.1-beta-1</version>
>             <configuration>
>                 <webResources>
>                     <resource>
>                         <directory>${basedir}/src/main/webapp/META-INF</directory>
>                         <filtering>true</filtering>
>                         <includes>
>                             <include>context.xml</include>
>                         </includes>
>                         <targetPath>META-INF/</targetPath>
>                     </resource>
>                 </webResources>
>             </configuration>
>         </plugin>  
> {code}
> My goal is to filter the context.xml to modify the name of the datasource
> My context.xml unfiltered is :
> {code:xml}
> <!-- Context configuration file for the Webintake services -->
> <Context path="/myWebapp" debug="0" privileged="true" reloadable="false">
> 	<Resource auth="Container" name="jdbc/DATABASEHTTP" factory="org.apache.commons.dbcp.BasicDataSourceFactory"
> 		type="javax.sql.DataSource" driverClassName="${connection.driver_class}"
> 		url="${connection.url}" username="${connection.username}" password="${connection.password}" maxActive="50" maxIdle="2"
> 		maxWait="10000" />
> </Context>
> {code}
> I use mvn clean install to launch the build
> In DEBUG mode I have :
> {code}
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-war-plugin:2.1-alpha-1:war' -->
> [DEBUG]   (f) addDefaultSpecificationEntries = true
> [DEBUG]   (f) addDefaultImplementationEntries = true
> [DEBUG]   (s) manifest = org.apache.maven.archiver.ManifestConfiguration@1d50fd2
> [DEBUG]   (f) archive = org.apache.maven.archiver.MavenArchiveConfiguration@101ac1c
> [DEBUG]   (s) archiveClasses = true
> [DEBUG]   (s) cacheFile = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\war\work\webapp-cache.xml
> [DEBUG]   (s) classesDirectory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\classes
> [DEBUG]   (s) filters = []
> [DEBUG]   (f) outputDirectory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target
> [DEBUG]   (f) primaryArtifact = true
> [DEBUG]   (s) project = MavenProject: fr.sgf.wit:webintake-security-integration:3.5.0-alpha3-SNAPSHOT @ E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\pom.xml
> [DEBUG]   (s) useCache = true
> [DEBUG]   (f) warName = webintake-security-integration-3.5.0-alpha3-SNAPSHOT
> [DEBUG]   (s) warSourceDirectory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\src\main\webapp
> [DEBUG]   (s) directory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration/src/main/webapp/META-INF
> [DEBUG]   (s) filtering = true
> [DEBUG]   (s) includes = [context.xml]
> [DEBUG]   (s) targetPath = META-INF/
> [DEBUG]   (s) webResources = [Resource {targetPath: META-INF/, filtering: true, FileSet {directory: E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration/src/main/webapp/META-INF, PatternSet [includes: {context.xml}, excludes: {}]}}]
> [DEBUG]   (s) webappDirectory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\webintake-security-integration-3.5.0-alpha3-SNAPSHOT
> [DEBUG]   (s) workDirectory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\war\work
> [DEBUG] -- end configuration --
> [INFO] [war:war]
> [INFO] Packaging webapp
> [INFO] Assembling webapp[webintake-security-integration] in [E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\webintake-security-integration-3.5.0-alpha3-SNAPSHOT]
> [INFO] Processing war project
> [INFO] Copy webapp webResources[E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration/src/main/webapp/META-INF] to[E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\webintake-security-integration-3.5.0-alpha3-SNAPSHOT]
> [DEBUG]  + META-INF/\context.xml has been copied.
> [DEBUG]  + META-INF/context.xml has been copied.
> {code}
> So the filtering is active and the context.xml is copied as expected but not filtered !
> The file is not modified, I still have the variable not filtered.
> If I make mvn install (removing the clean) it works the second time, I guess the file is read from the right place the second time ?
> I attached the mvn command with option -X  

-- 
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-200) Filtering resource don't work as expected

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MWAR-200?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg updated MWAR-200:
---------------------------------

    Component/s: filtering

> Filtering resource don't work as expected
> -----------------------------------------
>
>                 Key: MWAR-200
>                 URL: https://jira.codehaus.org/browse/MWAR-200
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Bug
>          Components: filtering
>    Affects Versions: 2.1-alpha-1, 2.1-beta-1
>         Environment: windows and unix
>            Reporter: hugo lassiege
>         Attachments: toto.txt
>
>
> Hi,
> I try to use maven war plugin and cargo however I have a problem with maven-war-plugin and the filtering.
> I tried with 2.1-beta-1 and alpha1
> My configuration for the maven-war-plugin is the following :
> {code:xml}
> 			<!-- pour tout les projets d'intégration, il faut ajouter un fichier context.xml qui sera filtré -->	
> 	        <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-war-plugin</artifactId>
> 			<version>2.1-beta-1</version>
>             <configuration>
>                 <webResources>
>                     <resource>
>                         <directory>${basedir}/src/main/webapp/META-INF</directory>
>                         <filtering>true</filtering>
>                         <includes>
>                             <include>context.xml</include>
>                         </includes>
>                         <targetPath>META-INF/</targetPath>
>                     </resource>
>                 </webResources>
>             </configuration>
>         </plugin>  
> {code}
> My goal is to filter the context.xml to modify the name of the datasource
> My context.xml unfiltered is :
> {code:xml}
> <!-- Context configuration file for the Webintake services -->
> <Context path="/myWebapp" debug="0" privileged="true" reloadable="false">
> 	<Resource auth="Container" name="jdbc/DATABASEHTTP" factory="org.apache.commons.dbcp.BasicDataSourceFactory"
> 		type="javax.sql.DataSource" driverClassName="${connection.driver_class}"
> 		url="${connection.url}" username="${connection.username}" password="${connection.password}" maxActive="50" maxIdle="2"
> 		maxWait="10000" />
> </Context>
> {code}
> I use mvn clean install to launch the build
> In DEBUG mode I have :
> {code}
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-war-plugin:2.1-alpha-1:war' -->
> [DEBUG]   (f) addDefaultSpecificationEntries = true
> [DEBUG]   (f) addDefaultImplementationEntries = true
> [DEBUG]   (s) manifest = org.apache.maven.archiver.ManifestConfiguration@1d50fd2
> [DEBUG]   (f) archive = org.apache.maven.archiver.MavenArchiveConfiguration@101ac1c
> [DEBUG]   (s) archiveClasses = true
> [DEBUG]   (s) cacheFile = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\war\work\webapp-cache.xml
> [DEBUG]   (s) classesDirectory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\classes
> [DEBUG]   (s) filters = []
> [DEBUG]   (f) outputDirectory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target
> [DEBUG]   (f) primaryArtifact = true
> [DEBUG]   (s) project = MavenProject: fr.sgf.wit:webintake-security-integration:3.5.0-alpha3-SNAPSHOT @ E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\pom.xml
> [DEBUG]   (s) useCache = true
> [DEBUG]   (f) warName = webintake-security-integration-3.5.0-alpha3-SNAPSHOT
> [DEBUG]   (s) warSourceDirectory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\src\main\webapp
> [DEBUG]   (s) directory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration/src/main/webapp/META-INF
> [DEBUG]   (s) filtering = true
> [DEBUG]   (s) includes = [context.xml]
> [DEBUG]   (s) targetPath = META-INF/
> [DEBUG]   (s) webResources = [Resource {targetPath: META-INF/, filtering: true, FileSet {directory: E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration/src/main/webapp/META-INF, PatternSet [includes: {context.xml}, excludes: {}]}}]
> [DEBUG]   (s) webappDirectory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\webintake-security-integration-3.5.0-alpha3-SNAPSHOT
> [DEBUG]   (s) workDirectory = E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\war\work
> [DEBUG] -- end configuration --
> [INFO] [war:war]
> [INFO] Packaging webapp
> [INFO] Assembling webapp[webintake-security-integration] in [E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\webintake-security-integration-3.5.0-alpha3-SNAPSHOT]
> [INFO] Processing war project
> [INFO] Copy webapp webResources[E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration/src/main/webapp/META-INF] to[E:\Developpement\checkout\webintakeTrunk\webintake-security\webintake-security-integration\target\webintake-security-integration-3.5.0-alpha3-SNAPSHOT]
> [DEBUG]  + META-INF/\context.xml has been copied.
> [DEBUG]  + META-INF/context.xml has been copied.
> {code}
> So the filtering is active and the context.xml is copied as expected but not filtered !
> The file is not modified, I still have the variable not filtered.
> If I make mvn install (removing the clean) it works the second time, I guess the file is read from the right place the second time ?
> I attached the mvn command with option -X  

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