简体   繁体   中英

Installing Maven artifacts to local repo programmatically

What I have is the need to use a Groovy script or Maven plugin to generate a jar before compile time and then install it to the local repository so it can be used in the compile process (ie the depend will be satisfied by the build process and not downloaded through any external repos). I have got as far as using a groovy script to create this jar before the compiling / dependency resolution begins.

As the API documentation for working with Maven outside of creating a Mojo is very slim, I would like some pointers to getting this jar into the local repository.

Thanks in advance, md_5.

EDIT: I would also like to have a way of knowing if the artifact is in the maven repo beforehand.

我认为您需要使用maven-invoker-plugin ,它启动一个新的Maven实例,您可以使用本机Maven插件生成工件,构建它并安装到本地存储库中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM