java - 无法解析的构建扩展 : or one of its dependencies could not be resolved: Failed to read artifact descriptor

标签 java eclipse maven

我在运行 Maven 安装时遇到问题。当我导入项目时,pom.xml 文件显示错误:

Multiple annotations found at this line: - Project build error: Unresolveable build extension: Plugin org.apache.felix:maven-bundle-plugin:2.3.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.felix:maven-bundle-plugin:jar:2.3.7 - Error resolving version for plugin 'org.apache.maven.plugins:maven-site-plugin' from the repositories [local (C:\Users\c76266.m2\repository), release.fusesource.org (http://repo.fusesource.com/nexus/content/repositories/releases), ea.fusesource.org (http://repo.fusesource.com/nexus/content/groups/ea), central (https://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository

我已经更新了项目,这一步无法解决这个问题。当我运行 maven install 或 clean 时显示错误:

[INFO] Scanning for projects...
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/felix/maven-bundle-plugin/2.3.7/maven-bundle-plugin-2.3.7.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin org.apache.felix:maven-bundle-plugin:2.3.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.felix:maven-bundle-plugin:jar:2.3.7 @ 
[ERROR] Unknown packaging: bundle @ line 9, column 13
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.prudential.integration.middleware:crm-services:1.0.0-SNAPSHOT (C:\Users\c76266\Documents\workspace-sts-3.8.3.RELEASE\crm-services\pom.xml) has 2 errors
[ERROR]     Unresolveable build extension: Plugin org.apache.felix:maven-bundle-plugin:2.3.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.felix:maven-bundle-plugin:jar:2.3.7: Could not transfer artifact org.apache.felix:maven-bundle-plugin:pom:2.3.7 from/to central (https://repo.maven.apache.org/maven2): unexpected end of stream on Connection{repo.maven.apache.org:443, proxy=HTTP @ /10.171.74.5:8080 hostAddress=10.171.74.5 cipherSuite=none protocol=http/1.1} (recycle count=0): \n not found: size=0 content=... -> [Help 2]
[ERROR]     Unknown packaging: bundle @ line 9, column 13
[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, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginManagerException

如何解决这个问题?在我的 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>com.prudential.integration.middleware</groupId>
    <artifactId>crm-services</artifactId>
    <packaging>bundle</packaging>
    <version>1.0.0-SNAPSHOT</version>

    <name>CRM SERVICES</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

    <repositories>
        <repository>
            <id>release.fusesource.org</id>
            <name>FuseSource Release Repository</name>
            <url>http://repo.fusesource.com/nexus/content/repositories/releases</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
        <repository>
            <id>ea.fusesource.org</id>
            <name>FuseSource Community Early Access Release Repository</name>
            <url>http://repo.fusesource.com/nexus/content/groups/ea</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>release.fusesource.org</id>
            <name>FuseSource Release Repository</name>
            <url>http://repo.fusesource.com/nexus/content/repositories/releases</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </pluginRepository>
        <pluginRepository>
            <id>ea.fusesource.org</id>
            <name>FuseSource Community Early Access Release Repository</name>
            <url>http://repo.fusesource.com/nexus/content/groups/ea</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>

    <dependencies>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-core</artifactId>
            <version>2.15.1.redhat-620133</version>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-jaxb</artifactId>
            <version>2.15.1.redhat-620133</version>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-jackson</artifactId>
            <version>2.15.1.redhat-620133</version>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-mail</artifactId>
            <version>2.15.1.redhat-620133</version>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-cxf</artifactId>
            <version>2.15.1.redhat-620133</version>
            <exclusions>
                <exclusion>
                    <artifactId>asm</artifactId>
                    <groupId>asm</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
            <version>3.0.4.redhat-620133</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http-jetty</artifactId>
            <version>3.0.4.redhat-620133</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-email</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.10</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.3.2</version>
        </dependency>

        <!-- Database -->
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-sql</artifactId>
            <version>2.15.1.redhat-620133</version>
        </dependency>
        <dependency>
            <groupId>com.microsoft.sqlserver.jdbc</groupId>
            <artifactId>sqlserverjdbc</artifactId>
            <version>4.1</version>
        </dependency>
        <dependency>
            <groupId>postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>9.1-901-1.jdbc4</version>
        </dependency>

        <!-- logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.10</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.10</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
        <dependency>
            <groupId>com.prudential.integration.middleware</groupId>
            <artifactId>common-utilities</artifactId>
            <version>1.0.1</version>
        </dependency>
        <dependency>
            <groupId>com.prudential.integration.middleware.common</groupId>
            <artifactId>prudential-fuse-common-dao</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.prudential.integration.middleware.common</groupId>
            <artifactId>prudential-fuse-common-model</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.prudential.enc</groupId>
            <artifactId>pruencutil</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>

    </dependencies>

    <build>
        <defaultGoal>install</defaultGoal>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

            <!-- allows the route to be ran via 'mvn camel:run' -->
            <plugin>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-maven-plugin</artifactId>
                <version>2.15.1.redhat-620133</version>
            </plugin>

            <!-- to generate the MANIFEST-FILE of the bundle -->
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.3.7</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>crm-service</Bundle-SymbolicName>
                        <Export-Package />
                        <Import-Package>*</Import-Package>
                        <Embed-Dependency>sqlserverjdbc,commons-lang3,commons-dbcp,commons-codec,commons-email,postgresql,pruencutil</Embed-Dependency>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

最佳答案

该问题可能是由代理配置引起的(正如 Pierre B. 提到的)

在我的开发上创建一个 Maven 项目并安装你的 pom.xml。 顺利结束。

IDE:Luna 服务版本 2 (4.4.2) 内部版本号:20150219-0600 Maven版本:apache-maven-3.3.3 JDK:java版本“1.8.0_131” Java(TM) SE 运行时环境(内部版本 1.8.0_131-b11) Java HotSpot(TM) 64 位服务器 VM(内部版本 25.131-b11,混合模式)

注意:记得在maven安装内的conf文件夹中配置maven文件:settingsProxy.xml,如果使用eclipse路径则配置:windows-preferences-Maven-User Settings

复制结果:

enter image description here

关于java - 无法解析的构建扩展 : or one of its dependencies could not be resolved: Failed to read artifact descriptor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47432047/

相关文章:

java - Maven - 安装到本地存储库,没有获得传递依赖项

java - mvn install 每次都失败

Java - 让 ArrayList 值在游戏中旋转

eclipse - 如何让 Eclipse 为 Java 内容辅助插入选项卡而不是空格?

java - 哪里可以找到 javadoc

java - 如何使用使用json对象获取数据并显示在listview中?

java - 我的配置 pom.xml 已跳过测试。但现在我想用命令行运行一次测试。命令如何?

java - 您好,我尝试将数据库中的字符串值转换为 int,但没有发生

java - 我可以用一个 catch 捕获多个 try 语句吗?在 java

java - 如何使用流并行和过滤器以及findFirst短路