将 play 模块发布到内部 Maven 存储库
我可以在本地构建 Play 框架模块并在本地使用它,但如何将其发布到内部 (Nexus) Maven 存储库(而不是公共 Play 存储库)以便 Play 能够找到它?
I can build a Play framework module locally and use it locally, but how can I publish it to an internal (Nexus) Maven repository (not the public Play repository) so that Play will be able to find it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我设法使用project/Build.scala中的以下配置将play 2.0模块构建到私有maven服务器(在我的例子中是Artificatory):
然后输入
项目目录
Edit
在Play 2.3 的
中,将以下内容添加到 build.sbt然后发布
I managed to get a play 2.0 module building to a private maven server (Artificatory in my case) using the following config in project/Build.scala:
Then typing
In the project dir
Edit
for Play 2.3, add following to build.sbt
Then issue
所以事实证明,有一个整堆 对此的不同解决方案。 Play 文档中甚至隐藏了一个提示,但据报道它略有不正确。
我最终使用的解决方案是将发布任务添加到使用 ivy 的
build.xml
中,并编写一个ivy.xml
文件,将工件文件类型设置为包
和文件扩展名zip
。So it turns out there's a whole bunch of different solutions to this. There's even a hint tucked away in the Play documentation, but it's reportedly slightly incorrect.
The solution I ended up using was adding a publish task to
build.xml
which uses ivy, and writing anivy.xml
file that set the artifact file type tobundle
and the file extension tozip
.我自己不了解 Play 框架,但通常你有两个选择。 Play 包含自己的 Maven 构建吗?如果是这样,您可以将分发管理设置配置到 Play 框架的 pom.xml 中,然后仅使用“mvn deploy”。只需按照以下 maven 部署插件文档中的说明配置 Nexus:
http:// maven.apache.org/plugins/maven-deploy-plugin/usage.html
如果 Play 框架没有 Maven 构建,您可以为您的 jar 使用“deploy:deploy-file”目标想要手动部署到 Nexus。
我记得一开始获取部署文件命令的所有必要参数有点棘手。要有耐心 :)
I don't know Play framework myself, but normally you have two options. Does Play contain its own Maven build? If so, you can configure distribution management settings to the Play framework's pom.xml and just use "mvn deploy". Just configure Nexus like explained in the following maven deploy plugin doc:
http://maven.apache.org/plugins/maven-deploy-plugin/usage.html
If there's no Maven build for Play framework, you can use the "deploy:deploy-file" target for the jars you want to deploy manually to Nexus.
I remember it's a bit tricky at first to get all the necessary parameters for the deploy-file command. Be patient :)
在脚本中,您可以使用此命令将工件推送到 nexus 存储库,用户必须有权在 nexus 上推送工件
In a script you can use this command to push an artifact to a nexus repository, the user must have the right to push artifacts on nexus