2013-03-15 46 views
3

我們正在Heroku上構建一個maven項目。 Github是SCM在Heroku上編輯settings.xml文件

這個項目依賴於我們的私有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時,它需要憑證才能從私有倉庫下載依賴項jar。在Heroku上,我如何編輯這個文件或者heroku上的maven home位置,以便我們可以使用heroku run bash --app Appname

回答

0

jcabi-heroku-maven-plugin主要是爲了解決這個特殊問題而創建的。 Heroku希望你將源代碼推送到他們的Git倉庫,讓他們在那裏編譯並運行。提到的插件工作方式不同。它依賴於已編譯的JAR/WAR工件,並向Heroku Git提交settings.xmlpom.xml。然後,在maven-invoker-plugin的幫助下,它遠程運行您的JAR/WAR。

您可以在setting.xml中使用私人存儲庫 - 它們的配置將自動移動到Heroku。

+0

另外,我正在通過jcabi heroku插件。文件不夠。是否可以擴展文檔以幫助開發人員使用插件 – 2013-03-21 11:27:16

+0

如果您將文檔中的問題作爲[github問題](https://github.com/yegor256/jcabi/issues)提交,那將會很不錯。我會盡快解決它,並更新文檔 – yegor256 2013-03-21 16:24:48

+0

完成! https://github.com/yegor256/jcabi/issues/183 – 2013-03-22 03:54:31