Re: How to interpolate a value in a Maven plugin
Thanks, Robert, the reference to the PluginParameterExpressionEvaluator in the maven-help-plugin was what I need. It's a bit clumsy to obtain, but does exactly what I want. Jochen On Thu, Dec 27, 2018 at 9:55 AM Robert Scholte wrote: > > Hi, > > try to find a plugin which does similar things and have a look at its > sources. > In this case help:evaluate[1] > > thanks, > Robert > > [1] https://maven.apache.org/plugins/maven-help-plugin/evaluate-mojo.html > > On Wed, 26 Dec 2018 22:36:32 +0100, Jochen Wiedmann > wrote: > > > Hi, > > > > I have written a Maven plugin, which must interpret values like > > ${project.artifactId}, and the like. > > My first attempt was to use > > project.getProperties().get("project.artifactId"), but that seems > > to work only for the values, which are configured in the POM's > > property section. So, what would be a better approach? > > > > Thanks, > > > > Jochen > > > > - > > 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 > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: How to interpolate a value in a Maven plugin
I was able to perform some properties manipulation with inline groovy script similar to this answer: https://stackoverflow.com/a/35731118/3571661 On Thu, 27 Dec 2018 at 15:54, Robert Scholte wrote: > Hi, > > try to find a plugin which does similar things and have a look at its > sources. > In this case help:evaluate[1] > > thanks, > Robert > > [1] https://maven.apache.org/plugins/maven-help-plugin/evaluate-mojo.html > > On Wed, 26 Dec 2018 22:36:32 +0100, Jochen Wiedmann > wrote: > > > Hi, > > > > I have written a Maven plugin, which must interpret values like > > ${project.artifactId}, and the like. > > My first attempt was to use > > project.getProperties().get("project.artifactId"), but that seems > > to work only for the values, which are configured in the POM's > > property section. So, what would be a better approach? > > > > Thanks, > > > > Jochen > > > > - > > 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 > > -- WBR Maxim aka solomax
Re: How to interpolate a value in a Maven plugin
Hi, try to find a plugin which does similar things and have a look at its sources. In this case help:evaluate[1] thanks, Robert [1] https://maven.apache.org/plugins/maven-help-plugin/evaluate-mojo.html On Wed, 26 Dec 2018 22:36:32 +0100, Jochen Wiedmann wrote: Hi, I have written a Maven plugin, which must interpret values like ${project.artifactId}, and the like. My first attempt was to use project.getProperties().get("project.artifactId"), but that seems to work only for the values, which are configured in the POM's property section. So, what would be a better approach? Thanks, Jochen - 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
Re: How to interpolate a value in a Maven plugin
Hi Jochen, On 26/12/18 23:27, Jochen Wiedmann wrote: On Wed, Dec 26, 2018 at 10:54 PM Karl Heinz Marbaise wrote: I have written a Maven plugin, which must interpret values like ${project.artifactId}, and the like. Where exactly do you use them ? Are injected as parameters ? No, they are basically snippets, which have been extracted from external files. Hard to describe. Please assume, that I can't use the standard filtering, because I've got to operate on strings, not files. (Think of values in a hash map.) I would suggest to take a look at a more higher level: http://maven.apache.org/shared/maven-filtering/ If you need more low level than take a look here: https://codehaus-plexus.github.io/plexus-interpolation/ https://github.com/codehaus-plexus/plexus-interpolation Kind regards Karl Heinz Marbaise - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: How to interpolate a value in a Maven plugin
On Wed, Dec 26, 2018 at 10:54 PM Karl Heinz Marbaise wrote: > > I have written a Maven plugin, which must interpret values like > > ${project.artifactId}, and the like. > > Where exactly do you use them ? Are injected as parameters ? No, they are basically snippets, which have been extracted from external files. Hard to describe. Please assume, that I can't use the standard filtering, because I've got to operate on strings, not files. (Think of values in a hash map.) > Can you give a full example for that ? Or a link to the project? Sorry, not open source, thus not available. Thanks, Jochen - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: How to interpolate a value in a Maven plugin
Hi Jochen, On 26/12/18 22:36, Jochen Wiedmann wrote: Hi, I have written a Maven plugin, which must interpret values like ${project.artifactId}, and the like. Where exactly do you use them ? Are injected as parameters ? My first attempt was to use project.getProperties().get("project.artifactId"), but that seems to work only for the values, which are configured in the POM's property section. So, what would be a better approach? Can you give a full example for that ? Or a link to the project? Kind regards Karl Heinz Marbaise - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
How to interpolate a value in a Maven plugin
Hi, I have written a Maven plugin, which must interpret values like ${project.artifactId}, and the like. My first attempt was to use project.getProperties().get("project.artifactId"), but that seems to work only for the values, which are configured in the POM's property section. So, what would be a better approach? Thanks, Jochen - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org