如何在 Maven 部署阶段将构建的工件复制到远程 Windows 服务器上的目录?
有人可以提供工作示例(完整的 Maven 插件配置)如何在部署阶段将构建的 jar 文件复制到特定服务器吗?
我尝试查看 wagon 插件,但它没有大量文档记录,我无法设置它。 该构建生成了部署到 Nexus 的标准 jar,但我还需要通过本地网络(\someserver\testapp\bin)自动将 jar 放入测试服务器。
我将不胜感激任何提示。
谢谢
could someone provide working example (full maven plugin configuration) how to copy built jar file to a specific server(s) at the time of deploy phase?
I have tried to look at wagon plugin, but it is hugely undocumented and I was not able to set it up. The build produces standard jar that is being deployed to Nexus, but I need to put the jar also to the test server automatically over local network (\someserver\testapp\bin).
I will be grateful for any hints.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
其实我找到了一种不同的方法:
依赖插件!
它还采用 Windows 路径,如 \\resource。
请注意,\\someserver\somedirectory 仅适用于 Windows 客户端。
Actually I have found a different way:
Dependency plugin!
It also takes windows path like \\resource.
Note that \\someserver\somedirectory works from windows client only.
我没有工作示例,但 "Maven Assembly Plugin"< /a> 应该可以完成这项工作。 您可以将其配置为在部署阶段自动运行。
当您编写自己的程序集描述符时,您可以指定程序集写入的路径。 我认为maven不应该关心它是本地路径还是远程路径。
I don't have a working example but the "Maven Assembly Plugin" should do the job. You can configure it to run automatically in the deploy phase.
When you write your own assembly descriptor you can specify a path where the assembly should be written to. I think maven shouldn't care about whether it's a local or remote path.