0

I want to replace the code snippet between two custom tag (@Start, @End) with empty tag.

public class MyClass{ 
private String name; 
private String age; 

@Start 
private String address; 
private String phoneNumber; 
@End 

} 

These tags are available in multiple files.

Is it possible using maven ? I was looking at http://code.google.com/p/maven-replacer-plugin/ which is used for replacing text/value, i don't think this can be used for replacing content. am i right ? Do we have any other way of doing it ?

Regards Pankaj

4

2 回答 2

0

Write a maven plugin. Apache Mahout, for example, as a maven plugin which runs Apache Velocity to generate source code from templates.

于 2012-05-08T23:45:41.670 回答
0

As i answered on the maven users list use the maven-replaces-plugin and put it into the correct lifecycle-phase (prepare-sources etc.) and use the buildhelper-plugin to add the target folder where the filtered/converted sources has been put into. That should work...depending on what you like to achieve the advise of bmargulies might be worth to consider.

于 2012-05-09T06:51:17.057 回答