You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Baptiste Mathus <bm...@batmat.net> on 2013/10/02 08:48:51 UTC

Re: Looking for class property-substitution plugin

Hi,
The templating-m-p as stated in the documentation was exactly designed to
filter source files. Its name might not make it that obvious but it's
because the idea is to some day support other templating engines.

In your case, you have to design your source files with variables inside
and the plugin will first filter source file then add it for compilation.

The plugin uses standard maven properties. So if that properties must come
from an external file that is another issue (properties:read-properties
approximate goal name is a way to go).

Cheers
Le 30 sept. 2013 17:30, "Russell Gold" <ru...@gold-family.us> a écrit :

> Thanks; I am aware that I could just keep the processing in ant; there are
> a couple of problems with your solution, that I see:
>
> 1) If I keep the file in the source directory, changing it wreaks havoc
> with source control - CM cannot tell if I meant to change it or not, and in
> a system such as Perforce, the file would be read-only in any event if I am
> not changing it.
> 2) The ant solution makes it very hard to ensure that the file gets added
> to the list of files that maven will compile
>
> That's why I want a plugin that does this the maven way.
>
> Thanks,
> Russ
>
> On Sep 30, 2013, at 10:50 AM, "Lyons, Roy" <Ro...@cmegroup.com> wrote:
>
> > :) I have an obligatory recommendation.  If nothing else, theres the
> > antrun plugin which will allow you to do that substitution as well.  It
> > allows you to run ant functions within the pom.
> >
> > You may be able to just keep the files in your src/main/language folder,
> > and do a "<replace" function, pointing to that src/main/language folder.
> >
> >
> > Thanks,
> >
> > Roy Lyons
> >
> >
> >
> >
> > On 9/30/13 9:44 AM, "Russell Gold" <ru...@gold-family.us> wrote:
> >
> >> Before I write this myselfŠ
> >>
> >> I am converting an ant build to maven. One of the steps processes a
> >> template file, using properties from a properties file to replace tokens
> >> and produce a java source file, which is then compiled. Is there an
> >> existing plugin which does this? The resource plugin can do the
> >> substitution, but will not mark the resultant file for compilation. It's
> >> not all that difficult to write, but one fewer plugin to maintain is a
> >> good thing.
> >>
> >> Thanks,
> >> Russ
> >> -----------------
> >> Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> >> and listen to the Misfile radio play
> >> <http://www.fuzzyfacetheater.com/misfile/>!
> >>
> >>
> >>
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
> -----------------
> Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> and listen to the Misfile radio play <
> http://www.fuzzyfacetheater.com/misfile/>!
>
>
>
>
>
>