我们正在 Heroku 上构建一个 Maven 项目。 Github是SCM
此项目依赖于我们的私有(private) Maven 存储库。
<repositories>
<repository>
<id>archiva</id>
<url>http://My-URL/archiva/repository/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
此凭据在本地 maven 的 settings.xml 中指定。
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>archiva</id>
<username>admin</username>
<password>admin</password>
</server>
</servers>
</settings>
当我将代码推送到 Heroku 时,它需要此凭据才能从私有(private)存储库下载依赖项 jar。在 Heroku 上,如何编辑此文件或 heroku 上的 maven 主页位置是什么,以便我们可以使用 heroku run bash --app Appname
最佳答案
jcabi-heroku-maven-plugin主要是为了解决这个特殊问题而创建的。 Heroku 希望您将源代码推送到他们的 Git 存储库,让他们在那里编译并运行。提到的插件的工作方式不同。它依赖于已编译的 JAR/WAR Artifact ,并且仅将 settings.xml
和 pom.xml
提交给 Heroku Git。然后,在 maven-invoker-plugin
的帮助下,它远程运行您的 JAR/WAR。
您可以在 setting.xml 中使用私有(private)存储库 - 它们的配置将自动移动到 Heroku。
关于git - 在 Heroku 上编辑 settings.xml 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15436658/