开发者

Maven pom error

I have example projects from spring core training courses I've been on. They did work on their machines, not on mine though. I am not really expert with maven, but .pom file inside gives this error. I really appreciate any monkey-alike-instructions, I'l do first then understand. Thank you very much in advance. I just want to run them and go through again.

Project build error: Non-resolvable parent POM: Failure to transfer com.springsource.training.common:abstractWebProject:pom:1.1.7.RELEASE from https://tbits.springsource.com/repository/snapshot was cached in the local repository, resolution will not be reattempted until the update interval of com.springsource.training.snapshot has elapsed or updates are forced.

Original error: Could not transfer artifact com.springsource.training.common:abstractWebProject:pom:1.1.7.RELEASE from/to com.springsource.training.snapshot (https://tbits.springsource.com/repository/snapshot): ConnectException and 'parent.relativePath' points at wrong local POM pom.xml /mvc-1-solution line 1 Maven Problem

plus I am having numerous mistakes for missing libraries: Description Resource Path Location Type

Project 'mvc-1-solution' is missing required library: 'C:\Users\Blabla\.m2\repository\org\cloudfoundry\cloudfoundry-runtime\0.6.0-BUILD-SNAPSHOT\cloudfoundry-runtime-0.6.0-BUILD-SNAPSHOT.jar' mvc-1-solution      Build path  Build Path Problem
Project 'mvc-1-solution' is missing required library: 'C:\Users\Blabla\.m2\repository\org\hibernate\hibernate-annotations\3.5.3-Final\hibernate-annotations-3.5.3-Final.jar'    mv开发者_StackOverflow中文版c-1-solution      Build path  Build Path Problem
Project 'mvc-1-solution' is missing required library: 'C:\Users\Blabla\.m2\repository\org\hibernate\hibernate-core\3.5.3-Final\hibernate-core-3.5.3-Final.jar'  mvc-1-solution      Build path  Build Path Problem

and many more alike.

Their .pom file.

<?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>com.springsource.training.module</groupId>
<artifactId>mvc-1-solution</artifactId>
<packaging>war</packaging>
<version>3.2.1.RELEASE</version>
<parent>
    <groupId>com.springsource.training.common</groupId>
    <artifactId>abstractWebProject</artifactId>
    <version>1.1.7.RELEASE</version>
</parent>
<repositories>
    <repository>
        <id>com.springsource.training.snapshot</id>
        <name>SpringSource Training Repository - Snapshots</name>
        <url>https://tbits.springsource.com/repository/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>com.springsource.training.release</id>
        <name>SpringSource Training Repository - Releases</name>
        <url>https://tbits.springsource.com/repository/release</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>org.springframework.maven.milestone</id>
        <name>Spring Maven Milestone Repository</name>
        <url>http://maven.springframework.org/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>springsource-snapshot</id>
        <url>http://s3.amazonaws.com/private.maven.springsource.com/snapshot/</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>
<dependencies>
    <!-- DBCP -->
    <dependency>
        <groupId>commons-dbcp</groupId>
        <artifactId>commons-dbcp</artifactId>
        <version>1.3</version>
        <exclusions>
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
            <exclusion>
                <groupId>commons-pool</groupId>
                <artifactId>commons-pool</artifactId>
            </exclusion>
            <exclusion>
                <groupId>xerces</groupId>
                <artifactId>xerces</artifactId>
            </exclusion>
            <exclusion>
                <groupId>xerces</groupId>
                <artifactId>xercesImpl</artifactId>
            </exclusion>
            <exclusion>
                <groupId>xml-apis</groupId>
                <artifactId>xml-apis</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>commons-pool</groupId>
        <artifactId>commons-pool</artifactId>
        <version>1.5.4</version>
        <exclusions>
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <!-- CloudFoundry -->
    <dependency>
        <groupId>org.cloudfoundry</groupId>
        <artifactId>cloudfoundry-runtime</artifactId>
        <version>0.6.0-BUILD-SNAPSHOT</version>
    </dependency>
</dependencies>
</project>


Not a solution, but a recipe how to solve it:

  • Check each of the repositories you have defined in the Maven POM. For me, the 2 springsource repos are not available at the moment.
  • I think that the abstractWebProject will be contained in some of these. So the error Project build error: Non-resolvable parent POM: Failure to transfer will be a result of that.
  • After you may have access to the parent POM, you should check if all the dependencies are resolvable.
  • If everything fails, get in touch with the training team. If you were on that training, they will try to help you. You should have then the following information ready available:
    • The POM you want to use (as in your question)
    • The file settings.xml in your Maven installation
    • The version of your Maven isntallation
    • The file settings.xml in your user directory .m2 (depending on your operating system at different locations).

Hope you can get the help you need to solve it.


"..resolution will not be reattempted until the update interval of com.springsource.training.snapshot has elapsed or updates are forced." --This is due to the first failure trying to download artifacts, need to remove those *.lastUpdated from your repository.

For windows:

cd %userprofile%.m2\repository for /r %i in (*.lastUpdated) do del %i

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜