开发者

How to commit a file to SVN inside a Maven plugin?

how can I commit a file to SVN ins开发者_开发问答ide a Maven plugin ?

I have a selfwritten maven plugin which manipulates a file, which is already SVN supported.

After manipulation I would like to commit the changed file to SVN while being in the maven plugin ?

Can I just use some existing Maven-SVN-APIs inside my Java Code of the maven plugin ?

Thank you very much !


You should let Maven inject a ScmManager in your plugin

/**
 * @component
 */
protected ScmManager scmManager;

And with the ScmManager you can do many things.

Take a look into the guide. You don't need to do nativ SVNKit...Maven has already an abstraction layer for handling all version control tools.


Inside your Maven plugin, you can do whatever is possible with Java. http://svnkit.com/ is an excellent Java SVN library. It should be easy to commit a file.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜