Failed to collect Maven dependencies in Java HelloWorld when deploying to heroku

倖福魔咒の 提交于 2021-02-11 17:29:43

问题


I'm playing with Java and heroku following the heroku guide. 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)

All is built ok locally with

mvn package

but when I use

git push heroku master

to deploy on heroku, I get this message:

       [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?

If not... any other idea?

This is my 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

java.runtime.version=1.7

Thank you! Have a nice day!


回答1:


Since the pom seems to be in maven central, this sounds like a heroku issue that you should contact heroku support on. You can open a ticket to Heroku support at https://help.heroku.com/.



来源:https://stackoverflow.com/questions/15587073/failed-to-collect-maven-dependencies-in-java-helloworld-when-deploying-to-heroku

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!