When talking about templating I'm thinking of a known issue with the Java 
Language:You can't give a default implementation for an interface.You can use 
an abstract class, but if your class implements another interface, you still 
have to implement all those methods.This might be a plugin which could help 
here. Robert From: rfscho...@codehaus.org
To: dev@mojo.codehaus.org
Date: Wed, 23 Jan 2013 22:10:18 +0000
Subject: RE: [mojo-dev] Fwd: Using maven properties inside .java inside 
annotation in a clean way





If added an IT-folder to the project, where you can put an example on how it 
should work.
Just run "mvn verify" and see the result.
 
I'm interested to see the difference between this solution and what you can do 
with modello[1]
 
Robert
 
[1] http://modello.codehaus.org/index.html
 
From: bmat...@gmail.com
Date: Wed, 23 Jan 2013 21:56:12 +0100
To: dev@mojo.codehaus.org
Subject: [mojo-dev] Fwd: Using maven properties inside .java inside annotation 
in a clean way

Hi everyone,Finally this one should reach the list.
To sum up, I've committed today my current experimentation under the sandbox 
svn under the the quite pompous name templating-maven-plugin.

As explained below, this plugin has (currently) only one goal that uses a 
directory that will be filtered and added as a maven source folder in one go.
If someone has any idea/opinion about this subject, I'd be delighted to hear 
what you have to say.


Thanks-- Baptiste(PS : I know, the current state is crappy, I'm planning to 
clean it up + add test. For the latter, I didn't do it yet since I'm not yet 
totally comfortable with how to test maven plugins, but I'll do it).



---------- Forwarded message ----------
From: Baptiste Mathus <bmat...@gmail.com>
Date: 2013/1/20


Subject: Re: Using maven properties inside .java inside annotation in a clean 
way
To: dev@mojo.codehaus.org
Cc: Stephen Connolly <stephen.alan.conno...@gmail.com>




Trying once more to reach the list, not convinced it's gonna work better :-/.
As a follow-up, I began experimenting the idea of adding that template 
folder.It kind of works locally, but it's still a real mess I need to clean up 
before showing it anywhere.



At that point, I have some questions:Should I use mojo java 5 annotations or 
keep using the xdoclet old-style? Seems like java5 annotations is far better 
but I wasn't able to find if it would tie that plugin to maven3 (I suppose it's 
only tying to java5, but not totally sure)



Stephen already gave his opinion, so I went creating a brand new plugin at 
least for the moment for this. What do you others think?When something is new 
or uncertain, how do you guys usually proceed to get feedback? Push that onto 
some Github repo? attach as a zip? (meeeh), something else?


Basically, the plugin.execute() does two things: create and execute a 
MavenResourcesFiltering on the "java-templates" to "target/javagenerated" and 
then add this generated source folder to the MavenProject (as simply does 
builder-helper-m-p/add-source)


What do you think?
Thanks a lot!


2013/1/18 Stephen Connolly <stephen.alan.conno...@gmail.com>



I vote a new plugin

On Friday, 18 January 2013, Baptiste Mathus  wrote:

Hi all,

Having difficulties to post to this list, I try with a direct mail instead of 
forwarding.Moving this discussion here after some initial discussions on 
maven-users.





Original thead: 
http://www.mail-archive.com/users@maven.apache.org/msg128319.html







Basically, the need is to have some kind of easy filtering inside some .java 
files, when the properties cannot be loaded for example with standard filtering 
of src/main/resources because it's not allowed in parts of java code where only 
real constants are allowed (example: annotation attributes).






To follow-up with the advice of Stephen, I guess the best place to add that 
would be build-helper-m-p, isn't it?Should it be a new goal or be done with 
something like adding a <filtering /> tag to add-source goal?






Or another or new plugin?
What do you think?
Thanks a lot for you opinions


-- 
Baptiste



-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,


Mangez un castor !



-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !
                                                                                
  

Reply via email to