2015-12-04 124 views
0

我用我的項目,託管在Heroku上的自定義的依賴,而當我把通過GIT中我的變化,服務器拋出此日誌(Maven的嘗試從公共庫中下載):的Heroku不解決本地Maven依賴

... Remote repositories download ... 
[INFO] Downloading: https://repo.maven.apache.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar //Example of correct file 
[INFO] Downloading: file:/tmp/build_2b1a7b0432368beb5dc5ba232fac767a/repo/com/example/functions/17.0/functions-17.0.jar 
[INFO] Downloading: file:/tmp/build_2b1a7b0432368beb5dc5ba232fac767a/repo/com/example/routines/17.0/routines-17.0.jar 
... More downloads ... 
[INFO] Downloading: https://repo.maven.apache.org/maven2/com/example/routines/17.0/routines-17.0.jar 
[INFO] Downloading: https://repo.maven.apache.org/maven2/com/example/functions/17.0/functions-17.0.jar 
... More downloads ... 
[INFO] Downloaded: https://repo.maven.apache.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar (3 KB at 7.6 KB/sec) //Correct file downloaded 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 5.755 s 
[INFO] Finished at: 2015-12-04T09:19:40+00:00 
[INFO] Final Memory: 14M/241M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal on project example-project: Could not resolve dependencies for project example-project:example-project:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: com.example:functions:jar:17.0, com.example:routines:jar:17.0: in project.local (file:/tmp/build_2b1a7b0432368beb5dc5ba232fac767a/repo) -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException 

我跟着this guide,我沒有使用settings.xml文件。我的pom.xml是這樣的:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 

<modelVersion>4.0.0</modelVersion> 
<groupId>example-project</groupId> 
<artifactId>example-project</artifactId> 
<version>0.0.1-SNAPSHOT</version> 
<packaging>jar</packaging> 
<name>My example project</name> 
<description>Example of Maven Project</description> 

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
</properties> 

<repositories> 
    <repository> 
     <id>project.local</id> 
     <name>project</name> 
     <url>file:${project.basedir}/repo</url> 
    </repository> 
</repositories> 

<dependencies> 
    <dependency> 
     <groupId>com.example</groupId> 
     <artifactId>functions</artifactId> 
     <version>17.0</version> 
    </dependency> 
    <dependency> 
     <groupId>com.example</groupId> 
     <artifactId>routines</artifactId> 
     <version>17.0</version> 
    </dependency> 
    ... More dependencies ... 
</dependencies> 
... Plugins ... 
</project> 

如何將我的自定義JAR上傳到Heroku?

+1

在推送到'heroku'之前,您是否檢查'jar'文件是否具有您的外部依賴性? –

+0

我只有本地依賴項,因爲它是業務邏輯 –

+1

的一部分。你如何部署在heroku上?通過GitHub?如果是這樣的話,你將你的外部jar文件推送到你的GitHub倉庫中,正如你在指南中提到的那樣。 –

回答