简体   繁体   English

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

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

I'm playing with Java and heroku following the heroku guide . 我按照heroku指南使用Java和heroku。 But with few modifications. 但只需很少的修改。 In this case I use JDK 1.7, Jetty 8.1.2.v20120308 and Maven dependencies plugin 2.7 (Because it seems, 2.4 couldn't be built) 在这种情况下,我使用JDK 1.7,Jetty 8.1.2.v20120308和Maven依赖插件2.7(因为似乎无法构建2.4)

All is built ok locally with 一切都可以在本地建立

mvn package mvn包

but when I use 但是当我使用

git push heroku master git push heroku主

to deploy on heroku, I get this message: 部署在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'

I read about the error at http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException , but it seems I must configure a settings.xml file (on heroku?) If this is the solution, how could I do it? 我在http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException上读取了有关该错误的信息,但是似乎我必须配置一个settings.xml文件(在heroku上)。如果这是解决方案,我该怎么办它?

If not... any other idea? 如果不是...还有其他想法吗?

This is my pom.xml 这是我的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>

This is my system.properties 这是我的system.properties

java.runtime.version=1.7

Thank you! 谢谢! Have a nice day! 祝你今天愉快!

Since the pom seems to be in maven central , this sounds like a heroku issue that you should contact heroku support on. 由于pom 似乎位于Maven Central中 ,因此这听起来像是一个heroku问题,您应该联系heroku支持部门。 You can open a ticket to Heroku support at https://help.heroku.com/ . 您可以在https://help.heroku.com/上打开Heroku支持的票证。

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

相关问题 在没有Maven支持的依赖项的情况下将Java项目部署到Heroku - Deploying Java project to Heroku without Maven-supported dependencies 使用Maven将Java应用程序部署到Heroku时出错 - Error when deploying Java app to Heroku using maven Heroku - 具有本地依赖项的 Maven 应用程序在本地运行完美,但未部署 - Heroku - Maven app with local dependencies works perfect in local but is not deploying 无法收集依赖项 maven - Failing to collect dependencies maven 在将Java应用程序部署到Heroku Cedar堆栈时,是否可以指定使用哪个版本的Maven? - Can I specify which version of Maven is used when deploying my Java app to the Heroku Cedar stack? 在 heroku 上部署项目时,如何修复 maven 插件和 java 版本的错误? - How to fix an error with maven plugin and java version when deploying project on heroku? 使用Maven将Java应用程序部署到heroku失败 - Java app deployment to heroku using Maven failed 无法在 org.apache.maven.plugins:maven-dependency-plugin:jar:2.10 收集依赖项 - Failed to collect dependencies at org.apache.maven.plugins:maven-dependency-plugin:jar:2.10 java 错误:在 heroku 上部署时构建失败 - java error: BUILD FAILURE when deploying on heroku 通过Maven向Heroku推送一个包含本地依赖项的Java worker - Pushing to Heroku a Java worker that contains local dependencies via Maven
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM