[英]How to install a Maven/Gradle project along with all its dependencies to a local repository?
I have a Gradle project that depends on several open-source projects up on Maven Central. 我有一个Gradle项目,该项目依赖于Maven Central上的几个开源项目。 I'd like to install the project – along with all its direct and transitive dependencies – to my local maven repository, so that I could later zip it all up and put it on offline machines.
我想将项目及其所有直接和可传递的依赖项安装到本地maven存储库中,以便以后可以将其全部压缩并放在脱机计算机上。
How do I do it with Gradle/Maven? 如何使用Gradle / Maven做到这一点?
If you want to later ZIP up your project w/ dependencies and move them to a different machine, you could try Maven's appassembler plugin . 如果以后要使用依赖项对项目进行ZIP压缩并将其移至另一台机器,则可以尝试使用Maven的appassembler插件 。 It collects all dependencies and creates a launcher, all in the target folder, ready for deployment.
它收集所有依赖关系,并在目标文件夹中创建所有启动器,以供部署。
But note, this, by default, creates a flat directory structure with all dependencies, it doesn't preserve the Maven format. 但是请注意,默认情况下,这会创建一个包含所有依赖项的平面目录结构,它不会保留Maven格式。 It also has the option to create a repository.
它还具有创建存储库的选项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.