Maven 存储库存档,包括构建/插件依赖项
我的客户希望能够从源代码构建我们的项目,但不想连接到互联网来获取构建的任何依赖项。请注意,这将包括插件依赖项。
我的建议是,我们向客户端提供一个存档,其中包含正确的 Maven 存储库文件结构中的所有依赖项,包括校验和和元信息。然后他们可以将其用作内部 Maven 存储库。
我已经配置了 maven- assembly-plugin 来创建这样的存档,但是它不包括 Maven 执行构建所需的所有构建/插件依赖项。
有谁知道一种在存档中包含构建时依赖项的方法,或者可以建议另一种方法来获取这些依赖项并将它们包装在正确的结构中。
非常感谢, 拍
My Client wants to be able to build our project from source but does not want to connect to the internet to get any dependencies for the build. Note this will include plugin dependencies.
My proposal is that we provide the client with an archive containing all the dependencies in the correct Maven repo file structure, including checksums and meta information. They can then use this as an internal maven repo.
I have configured the maven-assembly-plugin to create such an archive, however it doesn't include all the build/plugin dependencies that their Maven will require to perform the build.
Does anyone know of a way to include build time dependencies in the archive, or can suggest another way to grab these dependencies and wrap them up in the correct structure.
Many thanks,
Pat
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在干净的存储库上,您可以运行
mvn dependency:go-offline
。这将下载与项目相关的所有插件
和依赖项
。您可以通过执行离线构建(mvn -o clean install
)来验证这是否良好。一旦工作正常,您就可以创建存储库和源的存档并将其传递。
On a clean repository, you can run
mvn dependency:go-offline
. This will download all theplugins
anddependencies
relevant to the project. You can verify that this is good by doing an offline build (mvn -o clean install
).Once this works fine, you can create an archive of the repository and the sources and pass it on.
您是否看过 maven-dependency-plugin 而且我会建议进行完整的编译和打包,然后您可以从该用户打包本地存储库($HOME/.m2/repository)。比你拥有进行完整编译等所需的一切。
Have you taken a look into the maven-dependency-plugin and furthermore i would suggest to do a complete compile and package and after that you can package the local repository from that user ($HOME/.m2/repository). Than you have everything which is needed to do a full compile etc.
尝试
mvn dependency:copy-dependencies
。这会将所有依赖项复制到目录target\dependency
中。但是,我不确定这是否包括构建所需的依赖项以及安装编译输出所需的依赖项。
Try
mvn dependency:copy-dependencies
. This will copy all the dependencies to a directorytarget\dependency
.However, I'm not certain whether this includes the dependencies necessary to build, as well and those necessary to install the compiled output.