Maven:install jar file during build process

女生的网名这么多〃 提交于 2019-12-05 01:37:26
Stephan Eberle

I have encountered the same exception as posted above when I was invoking Maven from within an Ant script using artifact:mvn task. I managed to get rid of it by adding the fork="true" to the task invocation as follows:

<artifact:mvn pom="path/to/my-pom.xml" mavenHome="/path/to/maven-2.0.x" fork="true">
    <arg value="install"/>
</artifact:mvn>

If all that your project source needs is access to the contents generated by the ant build, you can use build-helper-maven-plugin to attach the source.

If the contents of the ant build is needed as a dependency, then you should probably move the ant related code to a separate project and build it.

If more details are provided, perhaps, someone can provide a better solution.

Take a look at Maven Ant Tasks which is the cousin of maven-antrun-plugin. It allows to invoke some Maven functionalities from ant, like installing your jar into the repository. It worked well for me with an hybrid build half Maven, half Ant.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!