2015-12-04 91 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仓库中,正如你在指南中提到的那样。 –

回答