Re: Filtering of a SINGLE property
But who stops a developer from still using the very same property as a programm variable? That's still the same solution that I pointed out the the beginning (imho) - it scales down the problem, but it's still there (on the high costs of having to manually select each file to be filtered). Hmm. Seems like there's no such thing as definining a certain property to be filtered. Seems like I've to cope with it. :-( Thanks anyway. Peter
Re: Filtering of a SINGLE property
Well, sure, we COULD do it at runtime, but a) this would cost performance (okay, to be honest, of course, it could once be loaded and runtime and so on, but still it would at least clutter the code with additional stuff we didn't when we were using Maven 1). b) For political reasons It would be good if everything would work as close as possible as it was before I introduced Maven 2... Peter
Re: Filtering of a SINGLE property
Hi, If you absolutely have go the way of filtering Java files, I would probably do it that way: 1. Put the java files to filter in a separate directory (src/main/java-filtered) 2. Add a filtered resource to the pom (target/generated/sources/java-filtered) 3. Make this additional source directory known with the build-helper-maven-plugin [1]. -Tim [1] http://mojo.codehaus.org/build-helper-maven-plugin/ Peter Horlock schrieb: Well, sure, we COULD do it at runtime, but a) this would cost performance (okay, to be honest, of course, it could once be loaded and runtime and so on, but still it would at least clutter the code with additional stuff we didn't when we were using Maven 1). b) For political reasons It would be good if everything would work as close as possible as it was before I introduced Maven 2... Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Filtering of a SINGLE property
Noone? Please, there must be someone able to answer this?! Thanks, Peter 2008/7/3 Peter Horlock [EMAIL PROTECTED]: Hi, I want to let Maven / the Resource plugin ( http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html ) parse my source code to replace {project.version} with the current version of the project as defined in the pom. This works great, but - in JSTL, as well as in OpenLazlo, ${variableName} is also a variable of the language itself - therefore, this leads to collisions - for example, one of our developers used a variable named ${parent} which then was filtered by Maven and booom the code was broken. Yada yada YAda! = Is there a way of telling Maven to JUST filter certain properties? I know I could tell it to just filter certain files, but a) a developer could then STILL use ${parent} as a variable in this very file b) whenever I wanted a new file to be filtered, I would have to add this file to the filter section... Thanks a lot folks, Peter
Re: Filtering of a SINGLE property
One way of achieving this would be to put the properties files that need to be filtered in a folder and the non-filtered ones in another folder. These folders can then be configured for filteringtrue/false/filtering accordingly. Something along the lines of: resource directorysrc/main/filtered/directory filteringtrue/filtering /resource resource directorysrc/main/unfiltered/directory filteringfalse/filtering /resource -Olivier On Sat, 2008-07-05 at 16:21 +0200, Peter Horlock wrote: Noone? Please, there must be someone able to answer this?! Thanks, Peter 2008/7/3 Peter Horlock [EMAIL PROTECTED]: Hi, I want to let Maven / the Resource plugin ( http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html ) parse my source code to replace {project.version} with the current version of the project as defined in the pom. This works great, but - in JSTL, as well as in OpenLazlo, ${variableName} is also a variable of the language itself - therefore, this leads to collisions - for example, one of our developers used a variable named ${parent} which then was filtered by Maven and booom the code was broken. Yada yada YAda! = Is there a way of telling Maven to JUST filter certain properties? I know I could tell it to just filter certain files, but a) a developer could then STILL use ${parent} as a variable in this very file b) whenever I wanted a new file to be filtered, I would have to add this file to the filter section... Thanks a lot folks, Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Filtering of a SINGLE property
you can use setup maven exec task on sedThis will globally replace all fu with bar in input.file and output result to output.filee.g. groupIdorg.codehaus.mojo/groupId artifactIdexec-maven-plugin/artifactId version1.1/version executions execution idexec-one/id phaseverify/phase configuration executablesed/executable arguments arguments/fu/bar/g/argument argumentinput.file/argument argument output.file/argument /arguments /configuration goals goalexec/goal /goals /execution HTHMartin Gainty __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Sat, 5 Jul 2008 16:21:28 +0200 From: [EMAIL PROTECTED] To: users@maven.apache.org Subject: Re: Filtering of a SINGLE property Noone? Please, there must be someone able to answer this?! Thanks, Peter 2008/7/3 Peter Horlock [EMAIL PROTECTED]: Hi, I want to let Maven / the Resource plugin ( http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html ) parse my source code to replace {project.version} with the current version of the project as defined in the pom. This works great, but - in JSTL, as well as in OpenLazlo, ${variableName} is also a variable of the language itself - therefore, this leads to collisions - for example, one of our developers used a variable named ${parent} which then was filtered by Maven and booom the code was broken. Yada yada YAda! = Is there a way of telling Maven to JUST filter certain properties? I know I could tell it to just filter certain files, but a) a developer could then STILL use ${parent} as a variable in this very file b) whenever I wanted a new file to be filtered, I would have to add this file to the filter section... Thanks a lot folks, Peter _ The i’m Talkaton. Can 30-days of conversation change the world? http://www.imtalkathon.com/?source=EML_WLH_Talkathon_ChangeWorld
Re: Filtering of a SINGLE property
Well maybe, Why do you want the version in the code itself? runtime resolution - Would it be sufficent (or perhaps better) to get it at runtime rather than having it compiled in? The maven jar plugin writes a file called pom.properties in META-INF/maven/groupid/artifactid/pom.properties this contains the version I used to do all sorts of replacements in the far distant past when using ant. Since moving to maven I have not really found many scenarios where that was the best option. other options - i can't see any being able to specify the tokens used for identifying variables to replace or being able to disable the standard filters seem like great ides... i would be pretty easy to patch the resources plugin for this. On Sun, 06 Jul 2008 02:21:28 Peter Horlock wrote: Noone? Please, there must be someone able to answer this?! Thanks, Peter 2008/7/3 Peter Horlock [EMAIL PROTECTED]: Hi, I want to let Maven / the Resource plugin ( http://maven.apache.org/plugins/maven-resources-plugin/examples/include-e xclude.html ) parse my source code to replace {project.version} with the current version of the project as defined in the pom. This works great, but - in JSTL, as well as in OpenLazlo, ${variableName} is also a variable of the language itself - therefore, this leads to collisions - for example, one of our developers used a variable named ${parent} which then was filtered by Maven and booom the code was broken. Yada yada YAda! = Is there a way of telling Maven to JUST filter certain properties? I know I could tell it to just filter certain files, but a) a developer could then STILL use ${parent} as a variable in this very file b) whenever I wanted a new file to be filtered, I would have to add this file to the filter section... Thanks a lot folks, Peter -- Michael McCallum Enterprise Engineer mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Filtering of a SINGLE property
Hi, I want to let Maven / the Resource plugin ( http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html ) parse my source code to replace {project.version} with the current version of the project as defined in the pom. This works great, but - in JSTL, as well as in OpenLazlo, ${variableName} is also a variable of the language itself - therefore, this leads to collisions - for example, one of our developers used a variable named ${parent} which then was filtered by Maven and booom the code was broken. Yada yada YAda! = Is there a way of telling Maven to JUST filter certain properties? I know I could tell it to just filter certain files, but a) a developer could then STILL use ${parent} as a variable in this very file b) whenever I wanted a new file to be filtered, I would have to add this file to the filter section... Thanks a lot folks, Peter