仅使用其 Maven POM 分发应用程序 [英] Distributing application with its Maven POM only

查看:46
本文介绍了仅使用其 Maven POM 分发应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以仅使用 POM 分发我的应用程序?

Is it possible to distribute my application with its POM only ?

我已经在远程存储库中部署了我的应用程序,我认为如果我可以只分发它的 POM 会很好,而不是要求用户先下载完整的源代码,然后使用 POM 构建应用程序.这个想法是用户将能够使用 POM 和单个 Maven 命令安装应用程序.

I have deployed my application in a remote repository and I think it would be nice if I can distribute only its POM, instead of asking the users to download the complete source first and use the POM to build the application afterwards. The idea is that users would be able to install the application using the POM and a single Maven command.

我尝试在 distributionManagement 部分向 POM 添加一个 downloadURL ,但没有成功.这是我的实验:

I tried adding to the POM a downloadURL in a distributionManagement section without success. Here my experiment:

<?xml version="1.0" encoding="UTF-8"?>
<project>

<modelVersion>4.0.0</modelVersion>
<groupId>aGroupId</groupId>
<artifactId>anArtifactId</artifactId>
<version>0.0.1</version>

<distributionManagement>
    <downloadUrl>anURL</downloadUrl>
</distributionManagement>

<repositories>
    <repository>
      <id>someId</id>
      <url>anURL</url>
    </repository>
</repositories>
</project>

提前感谢您的任何反馈

推荐答案

如果你在分发源码,那么你应该看看 bootstrap POM 方法:http://maven.apache.org/scm/maven-scm-plugin/examples/bootstrapping-with-pom.html

If you're distributing source, then you should look at the bootstrap POM method: http://maven.apache.org/scm/maven-scm-plugin/examples/bootstrapping-with-pom.html

其中scm"元素是关键.用户只需运行 scm:bootstrap 即可接收项目源树,从中构建项目.

where the 'scm' element is key. The user has only to run scm:bootstrap to then receive the project source tree from which to build the project.

-蒂姆

这篇关于仅使用其 Maven POM 分发应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆