I would put such template source files in src/main/java-templates and knock
together a plugin that filters while copying the source to
target/generated-sources/template and then adds that as a source root in
one step.

I would suggest to knock sth together at mojo since a lot if people seem to
want this and an actual plugin will simplify their poms... And for test
sources it can actually make sense. But there will be pain... For one the
templates themselves will not be on the IDE source path so will not face
IDE completion... But then templates will not be syntax correct anyway, so
no bad thing

On Wednesday, 16 January 2013, Baptiste MATHUS wrote:

> Hi all,
>
> Note: I know the standard approach to this subject: filtering a .properties
> file and reading it.
> But this does not work when you actually want to use the value inside an
> annotation attribute (needs to be a real constant).
>
> We actually bind our EJB on specific JNDI URL by doing something like:
>
> @Stateless
> @EJB(name = "java:global/someejb-${project.version}")
> public class SomeEJB31 { ... }
>
> Does someone have an idea on how to solve this cleanly?
>
> We already have a running solution using a dark magical combination of
> antrun/build-helper manipulations, but this gives us a complicated pom to
> maintain and moreover M2E doesn't like it at all.
>
> Thanks for any hint!
>
> Cheers
>
>
> --
> Baptiste <Batmat> MATHUS - http://batmat.net
> Sauvez un arbre,
> Mangez un castor !
>

Reply via email to