Re: Filtering web.xml?
On Tue, Nov 6, 2012 at 4:45 PM, Billy Newman wrote: > I am trying to filter my web.xml with no luck. > > Current structure: > pom.xml > --> src > --->main > >webapp > ->WEB-INF > -->web.xml > > I have the war plugin defined as follows: > > > org.apache.maven.plugins > maven-war-plugin > 2.3 > > > > ${basedir}/src/main/webapp/WEB-INF > true > > *.xml > > > > > > > After I build I can look in the target directory and the web.xml that > lives in the exploded dir is correctly filtered. However the web.xml > that gets packaged up in the war is not filtered. So its like my > filtered web.xml got copied into target after the war was built. I > imagine that I am not filtering the web.xml correctly, any ideas? web.xml is a special file. You have to set filteringDeploymentDescriptors to true to filter it (and no need to mess up with then) http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#filteringDeploymentDescriptors -- Thomas Broyer /tɔ.ma.bʁwa.je/ - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Filtering web.xml?
On Tue, Nov 6, 2012 at 4:45 PM, Billy Newman wrote: > I am trying to filter my web.xml with no luck. > > Current structure: > pom.xml > --> src > --->main > >webapp > ->WEB-INF > -->web.xml > > I have the war plugin defined as follows: > > > org.apache.maven.plugins > maven-war-plugin > 2.3 > > > > ${basedir}/src/main/webapp/WEB-INF > true > > *.xml > > > Please, try to add second section of resources: ${basedir}/src/main/webapp/WEB-INF false *.xml Regards, Tomek > > > > > After I build I can look in the target directory and the web.xml that > lives in the exploded dir is correctly filtered. However the web.xml > that gets packaged up in the war is not filtered. So its like my > filtered web.xml got copied into target after the war was built. I > imagine that I am not filtering the web.xml correctly, any ideas? > > Thanks! > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >
Re: filtering web.xml
Hi, Just to build on this a bit, the maven plugin definitely supports the filtering of resources (outside of WEB-INF/classes). Here is a full config which filters web.xml (*.xml, actually) and places it in the WEB-INF directory: org.apache.maven.plugins maven-war-plugin ${basedir}/src/main/webapp/WEB-INF *.xml WEB-INF true src/main/filters/filter-${env}.properties src/main/resources true Todd Fulton Tim Kettler wrote: > > Hi, > > I do it like this: > > > > > org.apache.maven.plugins > maven-war-plugin > > > >${basedir}/src/main/webapp/WEB-INF > > web.xml > >WEB-INF >true > > > > > > > > and I think this is the right way to do it since standard resources end > up somewhere under 'target/classes' and I don't want that polluted with > a web.xml file. > > -Tim > > Henri Gomez schrieb: >> Hi to all, >> >> In a war project I'd like to filter the src/main/webapp/WEB-INF/web.xml : >> >> ie : update the display name to include the pom version >> >> My Site Application v${pom.version} >> >> I read some threads and it's not clear if it should be done by >> web-resources or standard filtering. >> >> ie : >> http://www.nabble.com/War-plugin-and-filtering-webapp-files-to4384723.html >> >> >> Advice welcome, I'm using maven-war-plugin 2.0.2 >> >> regards and thanks for your help, I'm being crasy :) >> >> - >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >> For additional commands, e-mail: users-h...@maven.apache.org >> > > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > > -- View this message in context: http://www.nabble.com/filtering-web.xml-tp17263714p2341.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: filtering web.xml
Any news about this problem ? 2008/5/17 Henri Gomez <[EMAIL PROTECTED]>: > 2008/5/17 Tim Kettler <[EMAIL PROTECTED]>: >> There's currently a discussion on the dev list [1] about releasing the next >> version of the war plugin. I posted there yesterday that this bug should be >> fixed before a release, you can express your opinion there as well. > > I'll send a note on the dev list > >> Additionally, you can vote on the bug report in jira, to make it more >> visible to the developers that this is an urgent issue for users. > > Done > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml
2008/5/17 Tim Kettler <[EMAIL PROTECTED]>: > There's currently a discussion on the dev list [1] about releasing the next > version of the war plugin. I posted there yesterday that this bug should be > fixed before a release, you can express your opinion there as well. I'll send a note on the dev list > Additionally, you can vote on the bug report in jira, to make it more > visible to the developers that this is an urgent issue for users. Done - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml
There's currently a discussion on the dev list [1] about releasing the next version of the war plugin. I posted there yesterday that this bug should be fixed before a release, you can express your opinion there as well. Additionally, you can vote on the bug report in jira, to make it more visible to the developers that this is an urgent issue for users. -Tim [1] http://www.nabble.com/Releasng-the-war-and-deploy-plugins-to17155510.html Henri Gomez schrieb: There is a patch provided in http://jira.codehaus.org/browse/MWAR-133. How can I contact the maintener for a fix ? 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: I tested with 2.1-alpha and same problem ;( 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: It's a bug in the war plugin. The resource filtering is seriously borked there, see here [1] for a bug report back from Nov 2007. The obvious and simple workaround would be to filter web.xml as a normal resource in a custom invocation of the resource plugin. But unfortunately there is a bug in the resource plugin as well [2] (open since 2006), causing it to not recognize a resources element in the plugin configuration. Sometimes maven is no fun at all :-( [1] http://jira.codehaus.org/browse/MWAR-133 [2] http://jira.codehaus.org/browse/MRESOURCES-8 Henri Gomez schrieb: I suspect something weird in maven-war plugin (2.0.2) since I get the same error from m2eclipse which use maven 2.1 embedded 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: *.version => pom.version *.name => pom.name 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: Problem in maven-war 2.0.2 or in maven 2.0.9 ? 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: Strange, indeed. Looks like a bug to me. I tried with this in web.xml and no filter property files: pom.name: ${pom.name} user.name: ${user.name} name: ${name} foo.name: ${foo.name} pom.version: ${pom.version} os.version: ${os.version} version: ${version} foo.version: ${foo.version} And the filtered result is this: pom.name: servlet user.name: servlet name: servlet foo.name: servlet pom.version: 1.0 os.version: 1.0 version: 1.0 foo.version: 1.0 It seems that the system properties get somehow shadowed by the standard pom properties. This seems to be the case even for custom properties like foo.version that are not defined anywhere. -Tim Henri Gomez schrieb: Strange. I could get thru filter ${user.home} or ${java.version} but not ${user.name} Any idea ? 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: Many thanks Tim. I was using the same thing, excepted WEB-INF It works now ! 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: Hi, I do it like this: org.apache.maven.plugins maven-war-plugin ${basedir}/src/main/webapp/WEB-INF web.xml WEB-INF true and I think this is the right way to do it since standard resources end up somewhere under 'target/classes' and I don't want that polluted with a web.xml file. -Tim Henri Gomez schrieb: Hi to all, In a war project I'd like to filter the src/main/webapp/WEB-INF/web.xml : ie : update the display name to include the pom version My Site Application v${pom.version} I read some threads and it's not clear if it should be done by web-resources or standard filtering. ie : http://www.nabble.com/War-plugin-and-filtering-webapp-files-to4384723.html Advice welcome, I'm using maven-war-plugin 2.0.2 regards and thanks for your help, I'm being crasy :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml
There is a patch provided in http://jira.codehaus.org/browse/MWAR-133. How can I contact the maintener for a fix ? 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: > I tested with 2.1-alpha and same problem ;( > > 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: >> It's a bug in the war plugin. The resource filtering is seriously borked >> there, see here [1] for a bug report back from Nov 2007. The obvious and >> simple workaround would be to filter web.xml as a normal resource in a >> custom invocation of the resource plugin. But unfortunately there is a bug >> in the resource plugin as well [2] (open since 2006), causing it to not >> recognize a resources element in the plugin configuration. >> >> Sometimes maven is no fun at all :-( >> >> [1] http://jira.codehaus.org/browse/MWAR-133 >> [2] http://jira.codehaus.org/browse/MRESOURCES-8 >> >> Henri Gomez schrieb: >>> >>> I suspect something weird in maven-war plugin (2.0.2) since I get the >>> same error from m2eclipse which use maven 2.1 embedded >>> >>> 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: *.version => pom.version *.name => pom.name 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: > > Problem in maven-war 2.0.2 or in maven 2.0.9 ? > > 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: >> >> Strange, indeed. >> >> Looks like a bug to me. I tried with this in web.xml and no filter >> property >> files: >> >> pom.name: ${pom.name} >> user.name: ${user.name} >> name: ${name} >> foo.name: ${foo.name} >> >> pom.version: ${pom.version} >> os.version: ${os.version} >> version: ${version} >> foo.version: ${foo.version} >> >> And the filtered result is this: >> >> pom.name: servlet >> user.name: servlet >> name: servlet >> foo.name: servlet >> >> pom.version: 1.0 >> os.version: 1.0 >> version: 1.0 >> foo.version: 1.0 >> >> It seems that the system properties get somehow shadowed by the >> standard pom >> properties. This seems to be the case even for custom properties like >> foo.version that are not defined anywhere. >> >> -Tim >> >> Henri Gomez schrieb: >>> >>> Strange. >>> >>> I could get thru filter ${user.home} or ${java.version} but not >>> ${user.name} >>> >>> Any idea ? >>> >>> 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: Many thanks Tim. I was using the same thing, excepted WEB-INF It works now ! 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: > > Hi, > > I do it like this: > > > > > org.apache.maven.plugins > maven-war-plugin > > > >${basedir}/src/main/webapp/WEB-INF > > web.xml > >WEB-INF >true > > > > > > > > and I think this is the right way to do it since standard resources > end > up > somewhere under 'target/classes' and I don't want that polluted with > a > web.xml file. > > -Tim > > Henri Gomez schrieb: >> >> Hi to all, >> >> In a war project I'd like to filter the >> src/main/webapp/WEB-INF/web.xml >> : >> >> ie : update the display name to include the pom version >> >> My Site Application >> v${pom.version} >> >> I read some threads and it's not clear if it should be done by >> web-resources or standard filtering. >> >> ie : >> >> >> http://www.nabble.com/War-plugin-and-filtering-webapp-files-to4384723.html >> >> >> Advice welcome, I'm using maven-war-plugin 2.0.2 >> >> regards and thanks for your help, I'm being crasy :) >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PRO
Re: filtering web.xml
I tested with 2.1-alpha and same problem ;( 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: > It's a bug in the war plugin. The resource filtering is seriously borked > there, see here [1] for a bug report back from Nov 2007. The obvious and > simple workaround would be to filter web.xml as a normal resource in a > custom invocation of the resource plugin. But unfortunately there is a bug > in the resource plugin as well [2] (open since 2006), causing it to not > recognize a resources element in the plugin configuration. > > Sometimes maven is no fun at all :-( > > [1] http://jira.codehaus.org/browse/MWAR-133 > [2] http://jira.codehaus.org/browse/MRESOURCES-8 > > Henri Gomez schrieb: >> >> I suspect something weird in maven-war plugin (2.0.2) since I get the >> same error from m2eclipse which use maven 2.1 embedded >> >> 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: >>> >>> *.version => pom.version >>> >>> *.name => pom.name >>> >>> 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: Problem in maven-war 2.0.2 or in maven 2.0.9 ? 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: > > Strange, indeed. > > Looks like a bug to me. I tried with this in web.xml and no filter > property > files: > > pom.name: ${pom.name} > user.name: ${user.name} > name: ${name} > foo.name: ${foo.name} > > pom.version: ${pom.version} > os.version: ${os.version} > version: ${version} > foo.version: ${foo.version} > > And the filtered result is this: > > pom.name: servlet > user.name: servlet > name: servlet > foo.name: servlet > > pom.version: 1.0 > os.version: 1.0 > version: 1.0 > foo.version: 1.0 > > It seems that the system properties get somehow shadowed by the > standard pom > properties. This seems to be the case even for custom properties like > foo.version that are not defined anywhere. > > -Tim > > Henri Gomez schrieb: >> >> Strange. >> >> I could get thru filter ${user.home} or ${java.version} but not >> ${user.name} >> >> Any idea ? >> >> 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: >>> >>> Many thanks Tim. >>> >>> I was using the same thing, excepted WEB-INF >>> >>> It works now ! >>> >>> 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: Hi, I do it like this: org.apache.maven.plugins maven-war-plugin ${basedir}/src/main/webapp/WEB-INF web.xml WEB-INF true and I think this is the right way to do it since standard resources end up somewhere under 'target/classes' and I don't want that polluted with a web.xml file. -Tim Henri Gomez schrieb: > > Hi to all, > > In a war project I'd like to filter the > src/main/webapp/WEB-INF/web.xml > : > > ie : update the display name to include the pom version > > My Site Application > v${pom.version} > > I read some threads and it's not clear if it should be done by > web-resources or standard filtering. > > ie : > > > http://www.nabble.com/War-plugin-and-filtering-webapp-files-to4384723.html > > > Advice welcome, I'm using maven-war-plugin 2.0.2 > > regards and thanks for your help, I'm being crasy :) > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For add
Re: filtering web.xml
It's a bug in the war plugin. The resource filtering is seriously borked there, see here [1] for a bug report back from Nov 2007. The obvious and simple workaround would be to filter web.xml as a normal resource in a custom invocation of the resource plugin. But unfortunately there is a bug in the resource plugin as well [2] (open since 2006), causing it to not recognize a resources element in the plugin configuration. Sometimes maven is no fun at all :-( [1] http://jira.codehaus.org/browse/MWAR-133 [2] http://jira.codehaus.org/browse/MRESOURCES-8 Henri Gomez schrieb: I suspect something weird in maven-war plugin (2.0.2) since I get the same error from m2eclipse which use maven 2.1 embedded 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: *.version => pom.version *.name => pom.name 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: Problem in maven-war 2.0.2 or in maven 2.0.9 ? 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: Strange, indeed. Looks like a bug to me. I tried with this in web.xml and no filter property files: pom.name: ${pom.name} user.name: ${user.name} name: ${name} foo.name: ${foo.name} pom.version: ${pom.version} os.version: ${os.version} version: ${version} foo.version: ${foo.version} And the filtered result is this: pom.name: servlet user.name: servlet name: servlet foo.name: servlet pom.version: 1.0 os.version: 1.0 version: 1.0 foo.version: 1.0 It seems that the system properties get somehow shadowed by the standard pom properties. This seems to be the case even for custom properties like foo.version that are not defined anywhere. -Tim Henri Gomez schrieb: Strange. I could get thru filter ${user.home} or ${java.version} but not ${user.name} Any idea ? 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: Many thanks Tim. I was using the same thing, excepted WEB-INF It works now ! 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: Hi, I do it like this: org.apache.maven.plugins maven-war-plugin ${basedir}/src/main/webapp/WEB-INF web.xml WEB-INF true and I think this is the right way to do it since standard resources end up somewhere under 'target/classes' and I don't want that polluted with a web.xml file. -Tim Henri Gomez schrieb: Hi to all, In a war project I'd like to filter the src/main/webapp/WEB-INF/web.xml : ie : update the display name to include the pom version My Site Application v${pom.version} I read some threads and it's not clear if it should be done by web-resources or standard filtering. ie : http://www.nabble.com/War-plugin-and-filtering-webapp-files-to4384723.html Advice welcome, I'm using maven-war-plugin 2.0.2 regards and thanks for your help, I'm being crasy :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml
I suspect something weird in maven-war plugin (2.0.2) since I get the same error from m2eclipse which use maven 2.1 embedded 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: > *.version => pom.version > > *.name => pom.name > > 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: >> Problem in maven-war 2.0.2 or in maven 2.0.9 ? >> >> 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: >>> Strange, indeed. >>> >>> Looks like a bug to me. I tried with this in web.xml and no filter property >>> files: >>> >>> pom.name: ${pom.name} >>> user.name: ${user.name} >>> name: ${name} >>> foo.name: ${foo.name} >>> >>> pom.version: ${pom.version} >>> os.version: ${os.version} >>> version: ${version} >>> foo.version: ${foo.version} >>> >>> And the filtered result is this: >>> >>> pom.name: servlet >>> user.name: servlet >>> name: servlet >>> foo.name: servlet >>> >>> pom.version: 1.0 >>> os.version: 1.0 >>> version: 1.0 >>> foo.version: 1.0 >>> >>> It seems that the system properties get somehow shadowed by the standard pom >>> properties. This seems to be the case even for custom properties like >>> foo.version that are not defined anywhere. >>> >>> -Tim >>> >>> Henri Gomez schrieb: Strange. I could get thru filter ${user.home} or ${java.version} but not ${user.name} Any idea ? 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: > > Many thanks Tim. > > I was using the same thing, excepted WEB-INF > > It works now ! > > 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: >> >> Hi, >> >> I do it like this: >> >> >> >> >> org.apache.maven.plugins >> maven-war-plugin >> >> >> >> ${basedir}/src/main/webapp/WEB-INF >> >> web.xml >> >> WEB-INF >> true >> >> >> >> >> >> >> >> and I think this is the right way to do it since standard resources end >> up >> somewhere under 'target/classes' and I don't want that polluted with a >> web.xml file. >> >> -Tim >> >> Henri Gomez schrieb: >>> >>> Hi to all, >>> >>> In a war project I'd like to filter the src/main/webapp/WEB-INF/web.xml >>> : >>> >>> ie : update the display name to include the pom version >>> >>> My Site Application v${pom.version} >>> >>> I read some threads and it's not clear if it should be done by >>> web-resources or standard filtering. >>> >>> ie : >>> >>> http://www.nabble.com/War-plugin-and-filtering-webapp-files-to4384723.html >>> >>> >>> Advice welcome, I'm using maven-war-plugin 2.0.2 >>> >>> regards and thanks for your help, I'm being crasy :) >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml
*.version => pom.version *.name => pom.name 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: > Problem in maven-war 2.0.2 or in maven 2.0.9 ? > > 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: >> Strange, indeed. >> >> Looks like a bug to me. I tried with this in web.xml and no filter property >> files: >> >> pom.name: ${pom.name} >> user.name: ${user.name} >> name: ${name} >> foo.name: ${foo.name} >> >> pom.version: ${pom.version} >> os.version: ${os.version} >> version: ${version} >> foo.version: ${foo.version} >> >> And the filtered result is this: >> >> pom.name: servlet >> user.name: servlet >> name: servlet >> foo.name: servlet >> >> pom.version: 1.0 >> os.version: 1.0 >> version: 1.0 >> foo.version: 1.0 >> >> It seems that the system properties get somehow shadowed by the standard pom >> properties. This seems to be the case even for custom properties like >> foo.version that are not defined anywhere. >> >> -Tim >> >> Henri Gomez schrieb: >>> >>> Strange. >>> >>> I could get thru filter ${user.home} or ${java.version} but not >>> ${user.name} >>> >>> Any idea ? >>> >>> 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: Many thanks Tim. I was using the same thing, excepted WEB-INF It works now ! 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: > > Hi, > > I do it like this: > > > > > org.apache.maven.plugins > maven-war-plugin > > > > ${basedir}/src/main/webapp/WEB-INF > > web.xml > > WEB-INF > true > > > > > > > > and I think this is the right way to do it since standard resources end > up > somewhere under 'target/classes' and I don't want that polluted with a > web.xml file. > > -Tim > > Henri Gomez schrieb: >> >> Hi to all, >> >> In a war project I'd like to filter the src/main/webapp/WEB-INF/web.xml >> : >> >> ie : update the display name to include the pom version >> >> My Site Application v${pom.version} >> >> I read some threads and it's not clear if it should be done by >> web-resources or standard filtering. >> >> ie : >> >> http://www.nabble.com/War-plugin-and-filtering-webapp-files-to4384723.html >> >> >> Advice welcome, I'm using maven-war-plugin 2.0.2 >> >> regards and thanks for your help, I'm being crasy :) >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml
Problem in maven-war 2.0.2 or in maven 2.0.9 ? 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: > Strange, indeed. > > Looks like a bug to me. I tried with this in web.xml and no filter property > files: > > pom.name: ${pom.name} > user.name: ${user.name} > name: ${name} > foo.name: ${foo.name} > > pom.version: ${pom.version} > os.version: ${os.version} > version: ${version} > foo.version: ${foo.version} > > And the filtered result is this: > > pom.name: servlet > user.name: servlet > name: servlet > foo.name: servlet > > pom.version: 1.0 > os.version: 1.0 > version: 1.0 > foo.version: 1.0 > > It seems that the system properties get somehow shadowed by the standard pom > properties. This seems to be the case even for custom properties like > foo.version that are not defined anywhere. > > -Tim > > Henri Gomez schrieb: >> >> Strange. >> >> I could get thru filter ${user.home} or ${java.version} but not >> ${user.name} >> >> Any idea ? >> >> 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: >>> >>> Many thanks Tim. >>> >>> I was using the same thing, excepted WEB-INF >>> >>> It works now ! >>> >>> 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: Hi, I do it like this: org.apache.maven.plugins maven-war-plugin ${basedir}/src/main/webapp/WEB-INF web.xml WEB-INF true and I think this is the right way to do it since standard resources end up somewhere under 'target/classes' and I don't want that polluted with a web.xml file. -Tim Henri Gomez schrieb: > > Hi to all, > > In a war project I'd like to filter the src/main/webapp/WEB-INF/web.xml > : > > ie : update the display name to include the pom version > > My Site Application v${pom.version} > > I read some threads and it's not clear if it should be done by > web-resources or standard filtering. > > ie : > > http://www.nabble.com/War-plugin-and-filtering-webapp-files-to4384723.html > > > Advice welcome, I'm using maven-war-plugin 2.0.2 > > regards and thanks for your help, I'm being crasy :) > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml
Strange, indeed. Looks like a bug to me. I tried with this in web.xml and no filter property files: pom.name: ${pom.name} user.name: ${user.name} name: ${name} foo.name: ${foo.name} pom.version: ${pom.version} os.version: ${os.version} version: ${version} foo.version: ${foo.version} And the filtered result is this: pom.name: servlet user.name: servlet name: servlet foo.name: servlet pom.version: 1.0 os.version: 1.0 version: 1.0 foo.version: 1.0 It seems that the system properties get somehow shadowed by the standard pom properties. This seems to be the case even for custom properties like foo.version that are not defined anywhere. -Tim Henri Gomez schrieb: Strange. I could get thru filter ${user.home} or ${java.version} but not ${user.name} Any idea ? 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: Many thanks Tim. I was using the same thing, excepted WEB-INF It works now ! 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: Hi, I do it like this: org.apache.maven.plugins maven-war-plugin ${basedir}/src/main/webapp/WEB-INF web.xml WEB-INF true and I think this is the right way to do it since standard resources end up somewhere under 'target/classes' and I don't want that polluted with a web.xml file. -Tim Henri Gomez schrieb: Hi to all, In a war project I'd like to filter the src/main/webapp/WEB-INF/web.xml : ie : update the display name to include the pom version My Site Application v${pom.version} I read some threads and it's not clear if it should be done by web-resources or standard filtering. ie : http://www.nabble.com/War-plugin-and-filtering-webapp-files-to4384723.html Advice welcome, I'm using maven-war-plugin 2.0.2 regards and thanks for your help, I'm being crasy :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml
Strange. I could get thru filter ${user.home} or ${java.version} but not ${user.name} Any idea ? 2008/5/16 Henri Gomez <[EMAIL PROTECTED]>: > Many thanks Tim. > > I was using the same thing, excepted WEB-INF > > It works now ! > > 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: >> Hi, >> >> I do it like this: >> >> >> >> >>org.apache.maven.plugins >>maven-war-plugin >> >> >> >> ${basedir}/src/main/webapp/WEB-INF >> >>web.xml >> >> WEB-INF >> true >> >> >> >> >> >> >> >> and I think this is the right way to do it since standard resources end up >> somewhere under 'target/classes' and I don't want that polluted with a >> web.xml file. >> >> -Tim >> >> Henri Gomez schrieb: >>> >>> Hi to all, >>> >>> In a war project I'd like to filter the src/main/webapp/WEB-INF/web.xml : >>> >>> ie : update the display name to include the pom version >>> >>>My Site Application v${pom.version} >>> >>> I read some threads and it's not clear if it should be done by >>> web-resources or standard filtering. >>> >>> ie : >>> http://www.nabble.com/War-plugin-and-filtering-webapp-files-to4384723.html >>> >>> >>> Advice welcome, I'm using maven-war-plugin 2.0.2 >>> >>> regards and thanks for your help, I'm being crasy :) >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml
Many thanks Tim. I was using the same thing, excepted WEB-INF It works now ! 2008/5/16 Tim Kettler <[EMAIL PROTECTED]>: > Hi, > > I do it like this: > > > > >org.apache.maven.plugins >maven-war-plugin > > > > ${basedir}/src/main/webapp/WEB-INF > >web.xml > > WEB-INF > true > > > > > > > > and I think this is the right way to do it since standard resources end up > somewhere under 'target/classes' and I don't want that polluted with a > web.xml file. > > -Tim > > Henri Gomez schrieb: >> >> Hi to all, >> >> In a war project I'd like to filter the src/main/webapp/WEB-INF/web.xml : >> >> ie : update the display name to include the pom version >> >>My Site Application v${pom.version} >> >> I read some threads and it's not clear if it should be done by >> web-resources or standard filtering. >> >> ie : >> http://www.nabble.com/War-plugin-and-filtering-webapp-files-to4384723.html >> >> >> Advice welcome, I'm using maven-war-plugin 2.0.2 >> >> regards and thanks for your help, I'm being crasy :) >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml
Hi, I do it like this: org.apache.maven.plugins maven-war-plugin ${basedir}/src/main/webapp/WEB-INF web.xml WEB-INF true and I think this is the right way to do it since standard resources end up somewhere under 'target/classes' and I don't want that polluted with a web.xml file. -Tim Henri Gomez schrieb: Hi to all, In a war project I'd like to filter the src/main/webapp/WEB-INF/web.xml : ie : update the display name to include the pom version My Site Application v${pom.version} I read some threads and it's not clear if it should be done by web-resources or standard filtering. ie : http://www.nabble.com/War-plugin-and-filtering-webapp-files-to4384723.html Advice welcome, I'm using maven-war-plugin 2.0.2 regards and thanks for your help, I'm being crasy :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml
for sake of completeness, i also tried with maven-war-plugin version 2.0.1 . here is the stacktrace: [INFO] Failure Embedded error: IOException parsing XML document from ServletContext resource [/${dbms.filter}]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/${ dbms.filter}] i also tried putting this: dbms.filter = classpath*:/springapp-pgdb.xml in the webxml-filter.xml (that is the filter definition file), without any luck. On 10/30/06, Valerio Schiavoni <[EMAIL PROTECTED]> wrote: hello everyone, i know this has been discussed recently (also here: http://www.nabble.com/War-plugin-and-filtering-webapp-files-t1617964.html ) , but thevarious solutions and hacks proposed haven't solved my issue :( Consider this snippet of web.xml: contextConfigLocation classpath*:/acegi.xml classpath*:/springapp-servlet.xml classpath*:/datasource-populator.xml ${dbms.filter} I'd like to change the value of the dbms.filter variable value depending on a given profile. So i have the following in my pom.xml: //configuration for the maven-war-plugin ${basedir}/src/main/filters/webxml-filter.xml org.apache.maven.plugins maven-war-plugin 2.0 true ${basedir}/src/main/webapp **/*.xml then, a profile : postgres dbms postgres classpath*:/springapp-pgdb.xml so that when I issue : mvn clean -Ddbms=postgres i'm expecting the web.xmlfile to be filled with the value specified in the postgres profile. which actually is not happening. the element is there only because I read it fixes some current issues, and it actually refers to an empty filter file. any suggestion is very appreciated. -- http://valerioschiavoni.blogspot.com http://jroller.com/page/vschiavoni -- http://valerioschiavoni.blogspot.com http://jroller.com/page/vschiavoni
Re: filtering web.xml with profile properties
ertnutler wrote: > > strange. i got it to work by changing the resource directory from > ${basedir}/src/main/webapp/WEB-INF to ${basedir}/src/main/webapp. i can't > explain why it doesn't work for WEB-INF... > Good day to you, ertnutler, If it works with a property file, then that's most likely the bug i mentioned before ([1]). I made a patch in [1] so that you can use the properties in your poms without having to specify a property file ^_^ Try it if it works ^_^ Regarding the ${basedir}/src/main/webapp only, and ${basedir}/src/main/webapp/WEB-INF dirs, I guess maybe because filtering for the former is done by maven-resource-plugin, and not by maven-war-plugin...not sure about this though. Cheers, Franz [1] http://jira.codehaus.org/browse/MWAR-67 -- View this message in context: http://www.nabble.com/filtering-web.xml-with-profile-properties-tf2272626.html#a6356093 Sent from the Maven - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml with profile properties
strange. i got it to work by changing the resource directory from ${basedir}/src/main/webapp/WEB-INF to ${basedir}/src/main/webapp. i can't explain why it doesn't work for WEB-INF... -- View this message in context: http://www.nabble.com/filtering-web.xml-with-profile-properties-tf2272626.html#a6325123 Sent from the Maven - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml with profile properties
it works fine when i use a filter file, but i want to use properties defined in profiles. the resources plugin uses them appropriately. any idea when the war plugin will do the same? -- View this message in context: http://www.nabble.com/filtering-web.xml-with-profile-properties-tf2272626.html#a6324912 Sent from the Maven - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml with profile properties
ertnutler wrote: > > I can't for the life of me figure out how to have the maven-war-plugin > filter my web.xml with properties from my profiles. i've read this > thread: > > http://www.nabble.com/War-plugin-and-filtering-webapp-files-t1617964.html > > and i've tried all the configuration options mentioned there--except > providing the filter files. this thread seems to provide a solution if i > want to have properties files as my filter source, but i want to have > profiles, so i can take advantage of the inheritance of them to avoid > having to redefine variables multiple times. this works fine for files in > my webapp that aren't web.xml (i.e., those in src/main/resources). i was > hoping that the solution to MWAR-41 would provide what i'm looking for, > but it doesn't. > > does anybody have web.xml filtering with profile properties working? if > so, can you post an example? > > thanks in advance... > Good day to you, ertnutler, Try creating a property file and have your pom reference that. If the filtering suddenly works, then what you're experiencing is a bug (see [1]). Cheers, Franz [1] http://jira.codehaus.org/browse/MWAR-67 -- View this message in context: http://www.nabble.com/filtering-web.xml-with-profile-properties-tf2272626.html#a6317667 Sent from the Maven - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml
Hello Mark, thx... it worked just fine rgds marco On 5/21/06, Mark Hobson <[EMAIL PROTECTED]> wrote: Just tested whether web resource filtering also filters web.xml and it does. Check this thread for details on web resource filtering itself: http://www.nabble.com/War+plugin+and+filtering+webapp+files-t1617964.html Mark On 21/05/06, Kevin Galligan <[EMAIL PROTECTED]> wrote: > I've been having some issues with things like this in the war build. There > is a way to process resources in the war build plugin. You'll have to dig > around the mailing list for 'webResources'. > > If what you want to do is more complicated, you can take a look at this > thread... > > http://www.nabble.com/war+lifecycle-t1646489.html#a4471351 > > I'm using this for processing on some jsp files, as mentioned in the > thread. It works. > > On 5/21/06, Marco Mistroni <[EMAIL PROTECTED]> wrote: > > > > hello all, > > i was wonderring, is there a way, in Maven2, to filter also web.xml (i > > placed it in src/main/webapp/WEB-INF) directory without resortingto a > > hardcocded ant task taht copies the file from /resources/ to > > webapp/WEB-INF? > > > > thanks and regards > > marco > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml
Just tested whether web resource filtering also filters web.xml and it does. Check this thread for details on web resource filtering itself: http://www.nabble.com/War+plugin+and+filtering+webapp+files-t1617964.html Mark On 21/05/06, Kevin Galligan <[EMAIL PROTECTED]> wrote: I've been having some issues with things like this in the war build. There is a way to process resources in the war build plugin. You'll have to dig around the mailing list for 'webResources'. If what you want to do is more complicated, you can take a look at this thread... http://www.nabble.com/war+lifecycle-t1646489.html#a4471351 I'm using this for processing on some jsp files, as mentioned in the thread. It works. On 5/21/06, Marco Mistroni <[EMAIL PROTECTED]> wrote: > > hello all, > i was wonderring, is there a way, in Maven2, to filter also web.xml (i > placed it in src/main/webapp/WEB-INF) directory without resortingto a > hardcocded ant task taht copies the file from /resources/ to > webapp/WEB-INF? > > thanks and regards > marco > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: filtering web.xml
I've been having some issues with things like this in the war build. There is a way to process resources in the war build plugin. You'll have to dig around the mailing list for 'webResources'. If what you want to do is more complicated, you can take a look at this thread... http://www.nabble.com/war+lifecycle-t1646489.html#a4471351 I'm using this for processing on some jsp files, as mentioned in the thread. It works. On 5/21/06, Marco Mistroni <[EMAIL PROTECTED]> wrote: hello all, i was wonderring, is there a way, in Maven2, to filter also web.xml (i placed it in src/main/webapp/WEB-INF) directory without resortingto a hardcocded ant task taht copies the file from /resources/ to webapp/WEB-INF? thanks and regards marco