即使在与Maven安装依赖后,也缺少pom arte

时间:2016-03-02 13:26:02

标签: java maven

我正在逐一解决我的错误。现在开始掌握Maven,但我有点卡在这个错误上:

  

无法执行项目服务的目标:无法解决   项目的依赖关系eu.billfold:services:pom:1.0-SNAPSHOT:失败   在eu.sdk收集依赖项:sdk:jar:1.0-SNAPSHOT:无法读取   eu.sdk的工件描述符:sdk:jar:1.0-SNAPSHOT:找不到   eu.billfold.myproject:root:pom:1.0-SNAPSHOT in   http://download.java.net/maven/2/缓存在本地存储库中,   直到更新间隔为止,才会重新尝试解析   java.net已经过去或强制更新

我最近清除了目标“sdk-1.0-SNAPSHOT.jar”上的所有错误,我在本地安装了“mvn install”命令。在尝试安装新的Maven构建时,似乎无法根据需要找到它。

我已经检查了我的.m2本地仓库,目标JAR确实在这条路上:

.m2>存储库> eu> sdk> sdk> 1.0-SNAPSHOT> SDK-1.0-SNAPSHOT.jar

以下是POM的依赖性:

<?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>
    <packaging>pom</packaging>

    <parent>
        <groupId>eu.billfold</groupId>
        <artifactId>root</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>

    <artifactId>services</artifactId>
    <name>${project.groupId}:${project.artifactId}</name>

    <modules>
        <module>support</module>
        <module>account</module>
        <module>bo-user</module>
        <module>campaigns</module>
        <module>currency</module>
        <!--<module>geolocation</module>-->
        <module>report</module>
        <module>payment</module>
        <module>mail-service</module>
    </modules>

    <dependencies>

        <dependency>
            <groupId>eu.sdk</groupId>
            <artifactId>sdk</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>eu.sdk</groupId>
            <artifactId>test-sdk</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- from: junit-bom -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- from: easymock-bom -->
        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymockclassextension</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- from: spring3-bom -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- from: mockito-bom -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- from: slf4j-bom -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>log4j-over-slf4j</artifactId>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>eu.boms</groupId>
                <artifactId>easymock-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>eu.boms</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>eu.boms</groupId>
                <artifactId>spring3-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>eu.boms</groupId>
                <artifactId>slf4j-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>eu.boms</groupId>
                <artifactId>mockito-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>eu.boms</groupId>
                <artifactId>hibernate-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>eu.boms</groupId>
                <artifactId>commons-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>eu.boms</groupId>
                <artifactId>mysql-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>eu.boms</groupId>
                <artifactId>javaassist-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>eu.boms</groupId>
                <artifactId>aspectj-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>eu.boms</groupId>
                <artifactId>ehcache-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>eu.boms</groupId>
                <artifactId>javax-apis-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>eu.boms</groupId>
                <artifactId>apache-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>eu.boms</groupId>
                <artifactId>spring-security3-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>eu.boms</groupId>
                <artifactId>geoip-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

</project>

任何想法在这里出了什么问题?我有点难过?

2 个答案:

答案 0 :(得分:0)

您的问题可能有多种原因。 无论如何,我注意到:&#34;未能找到eu.billfold.myproject:root:pom:1.0-SNAPSHOT&#34;。它指的是您的父项目:

<parent>
    <groupId>eu.billfold</groupId>
    <artifactId>root</artifactId>
    <version>1.0-SNAPSHOT</version>
</parent>

如果未构建父项(项目的根目录),Maven依赖项解析将无法正常工作。 请使用&#34; mvn install&#34;构建您的父项目,然后重试构建您的项目eu.billfold:services。

答案 1 :(得分:0)

正如在问题的评论中所建议的那样,我在mv install命令中缺少-U。我之前确实有一个依赖项问题,但如果没有这个命令我就无法检查它是否已修复。

mvn -U clean install