开发者

Programmatically generating pom.xml

I am creating a new maven project from an eclipse plugin. As it seems to me a bad idea to hardcode pom.xml to my plugin. Is there any way to generate this programmatically such that the plugin will be more maintainable ?

Also creating the maven project structure from the plugin on my own seems to be a bad idea too ! Is there any api to do this tast ? (creating a maven project, adding my dependency to it)

What I am currently doing is to create folders, write a .classpath file (hardcoded) , inj开发者_开发知识库ecting maven nature to .project file and now trying to generate the pom.xml. Seeing a pom.xml I thought writing one plugin for th ecurrent version of maven won't do a good job.


Not sure what you want/need to do exactly but you could maybe use the MavenXpp3Writer#write() method from the Maven Model API to write a POM from a given Model.


Sounds like you are trying to do the job of maven archetypes

mvn eclipse:eclipse
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜