You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by carmichs <sc...@yahoo.com> on 2006/09/18 16:48:17 UTC
Inserting code into source file
Hi,
I am trying to figure out if maven or any plugins have the ability to insert
source code into a java source file. For example, I want to create a
source file template similiar to the one below where the placeholders get
populated in the template file at project creation time, by values defined
in a property file...
public class @SERVICE@Impl implements @PACKAGE@.@INTERFACE@{
private static Logger log = Logger.getLogger(@SERVICE@Impl.class);
// rest of template code goes here....
}
Thanks!
Steve
--
View this message in context: http://www.nabble.com/Inserting-code-into-source-file-tf2291740.html#a6365242
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Inserting code into source file
Posted by franz see <fr...@gmail.com>.
carmichs wrote:
>
> Hi,
>
> I am trying to figure out if maven or any plugins have the ability to
> insert source code into a java source file. For example, I want to
> create a source file template similiar to the one below where the
> placeholders get populated in the template file at project creation time,
> by values defined in a property file...
>
> public class @SERVICE@Impl implements @PACKAGE@.@INTERFACE@{
> private static Logger log = Logger.getLogger(@SERVICE@Impl.class);
>
> // rest of template code goes here....
> }
>
> Thanks!
>
> Steve
>
Good day to you, Steve,
If you simply want to replace tokens with corresponding values, you may want
to try out maven-resources-plugin ([1]).
Btw, [1] has not yet been released. If you have any comments about it,
please feel free to tell us about it so that we can incorporate them.
Thanks,
Franz
[1]
http://people.apache.org/~aramirez/maven-resources-plugin/examples/resource-directory.html
--
View this message in context: http://www.nabble.com/Inserting-code-into-source-file-tf2291740.html#a6366598
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org