无法读取工件描述符

时间:2016-11-28 18:21:37

标签: java xml maven module

我有maven结构

父级 - 服务器 - ModuleA 家长 - 实用工具

父pom.xml

...
    <groupId>by.services</groupId>
    <artifactId>by.services</artifactId>
    <name>Services</name>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <repositories>
        <repository>
            <id>OpenNMS Repository</id>
            <name>OpenNMS Repository</name>
            <url>http://repo.opennms.org/maven2/</url>
        </repository>
        <repository>
            <id>Redhat GA Repository</id>
            <name>Redhat GA Repository</name>
            <url>https://maven.repository.redhat.com/ga/</url>
        </repository>
    </repositories>

    <modules>
        <module>utils</module>
        <module>server</module>
        <module>client</module>
    </modules>
...

服务器pom.xml

...
<parent>
    <groupId>by.services</groupId>
    <artifactId>by.services</artifactId>
    <version>1.0-SNAPSHOT</version>
</parent>

<artifactId>by.mobile</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Server</name>
<packaging>pom</packaging>

<dependencies>
    <dependency>
        <groupId>by.services</groupId>
        <artifactId>utils</artifactId>
        <version>${utils.version}</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
...

ModuleA pom.xml

...
    <parent>
        <groupId>by.services</groupId>
        <artifactId>by.mobile</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>

    <artifactId>ModuleA</artifactId>
    <version>1.1</version>
    <packaging>jar</packaging>
...

Utils 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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>by.services</groupId>
        <artifactId>by.services</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>

    <artifactId>utils</artifactId>
    <name>Utils</name>
    <version>1.0.2</version>

    <dependencies>
...
    </dependencies>

    <build>
        <sourceDirectory>${basedir}/src/main/java</sourceDirectory>
        <resources>
            <resource>
                <directory>${basedir}/src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.properties</include>
                </includes>
            </resource>
            <resource>
                <directory>
                    ${basedir}/../by.mobile/by.mobile.client/src/main/java
                </directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
            <resource>
                <directory>
                    ${basedir}/../by.mobile/by.news/src/main/java
                </directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
            <resource>
                <directory>
                    ${basedir}/../by.mobile/by.poxy/src/main/java
                </directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>com.oracle.weblogic</groupId>
                <artifactId>weblogic-maven-plugin</artifactId>
                <version>${weblogic-maven-plugin.version}</version>
                <configuration>
                    <isLibrary>true</isLibrary>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <forkMode>never</forkMode>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
                <configuration>
                    <archive>
                        <index>true</index>
                        <manifest>
                            <addClasspath>true</addClasspath>
                        </manifest>
                        <manifestEntries>
                            <Dependencies>
                                org.apache.cxf optional, org.apache.cxf.impl optional

                            </Dependencies>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

当我删除本地存储库并尝试编译项目时,我有错误

Failed to execute goal on project ModuleA: Could not resolve dependencies for project by.services:ModuleA:jar:1.0-SNAPSHOT: Failed to collect dependencies at by.services:utils:jar:1.0.2: Failed to read artifact descriptor for by.services:utils:jar:1.0.2: Failure to find by.services:by.services:pom:1.0-SNAPSHOT in http://repo.opennms.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of OpenNMS Repository has elapsed or updates are forced -> [Help 1]

我的ModuleA在Uitl模型中没有看到任何类。为什么呢?

0 个答案:

没有答案