繁体   English   中英

部署到heroku时无法在Java HelloWorld中收集Maven依赖项

[英]Failed to collect Maven dependencies in Java HelloWorld when deploying to heroku

我按照heroku指南使用Java和heroku。 但只需很少的修改。 在这种情况下,我使用JDK 1.7,Jetty 8.1.2.v20120308和Maven依赖插件2.7(因为似乎无法构建2.4)

一切都可以在本地建立

mvn包

但是当我使用

git push heroku主

部署在heroku上,我收到以下消息:

       [ERROR] Failed to execute goal on project helloart: Could not resolve dep
endencies for project main.java:helloart:jar:1.0-SNAPSHOT: Failed to collect dep
endencies for [org.eclipse.jetty:jetty-servlet:jar:8.1.2.v20120308 (compile), ja
vax.servlet:servlet-api:jar:2.5 (compile)]: Failed to read artifact descriptor f
or org.eclipse.jetty:jetty-servlet:jar:8.1.2.v20120308: Could not transfer artif
act org.eclipse.jetty:jetty-parent:pom:19 from/to centralMirror (http://s3posito
ry.heroku.com/jvm/): Error transferring file: Server returned HTTP response code
: 503 for URL: http://s3pository.heroku.com/jvm/org/eclipse/jetty/jetty-parent/1
9/jetty-parent-19.pom -> [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, ple
ase read the following articles:
       [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/Depende
ncyResolutionException
 !     Failed to build app with Maven
 !     Heroku push rejected, failed to compile Java app

To git@heroku.com:aqueous-castle-5897.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:aqueous-castle-5897.git'

我在http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException上读取了有关该错误的信息,但是似乎我必须配置一个settings.xml文件(在heroku上)。如果这是解决方案,我该怎么办它?

如果不是...还有其他想法吗?

这是我的pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>main.java</groupId>
    <version>1.0-SNAPSHOT</version>
    <artifactId>helloart</artifactId>
    <dependencies>
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-servlet</artifactId>
            <version>8.1.2.v20120308</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.7</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals><goal>copy-dependencies</goal></goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

这是我的system.properties

java.runtime.version=1.7

谢谢! 祝你今天愉快!

由于pom 似乎位于Maven Central中 ,因此这听起来像是一个heroku问题,您应该联系heroku支持部门。 您可以在https://help.heroku.com/上打开Heroku支持的票证。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM