【问题标题】:Failed to execute goal org.apache.felix:maven-bundle-plugin:2.3.7未能执行目标 org.apache.felix:maven-bundle-plugin:2.3.7
【发布时间】:2017-01-03 08:53:01
【问题描述】:

我正在通过Create a Router Project 开发一个关于 JBoss-Fuse 的项目。

在运行 mvn -install 时,我收到以下错误:

[ERROR] Failed to execute goal org.apache.felix:maven-bundle-plugin:2.3.7:bundle (default-bundle) on project camel-basic: Error calculating classpath for project MavenProject: org.fusesource.example:camel-basic:1.0-SNAPSHOT @ /home/pr.singh/Gemini/Java-General/Workspace/fuse/camel-basic/pom.xml: The JAR/ZIP file (/home/pr.singh/.m2/repository/org/apache/camel/camel-jetty/2.17.0.redhat-630187/camel-jetty-2.17.0.redhat-630187.jar) seems corrupted, error: invalid END header (bad central directory offset) -> [Help 1]

我完全按照 redhat 教程进行操作,但无法调试问题。请帮忙。

我的 pom.xml 是:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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>org.fusesource.example</groupId>
    <artifactId>camel-basic</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>bundle</packaging>
    <name>JBoss Fuse Quickstart: camel-cbr</name>
    <description>Camel Content-Based Router Example</description>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <distribution>repo</distribution>
            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
        </license>
    </licenses>

    <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <version.compiler.plugin>2.3.1</version.compiler.plugin>
    <version.maven-bundle-plugin>2.3.7</version.maven-bundle-plugin>
    <maven.compiler.target>1.7</maven.compiler.target>
    <maven.compiler.source>1.7</maven.compiler.source>

    <!-- the version of the BOM, defining all the dependency versions -->
    <fabric8.bom.version>1.2.0.redhat-630187</fabric8.bom.version>
    <fabric.version>1.2.0.redhat-630187</fabric.version>

    <!-- fabric8 deploy profile configuration -->
    <fabric8.profile>camel-basic-profile</fabric8.profile>
    <fabric8.parentProfiles>feature-camel</fabric8.parentProfiles>
    <fabric8.features/>
  </properties>

    <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.fabric8.bom</groupId>
        <artifactId>fabric8-bom</artifactId>
        <version>${fabric8.bom.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

    <dependencies>
    <!--
     For this example, we will be using the OSGi Blueprint XML syntax for Apache Camel.
   -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-blueprint</artifactId>
    </dependency>
    <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-jetty</artifactId>
        </dependency>
  </dependencies>

    <build>
    <finalName>${project.artifactId}</finalName>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${version.compiler.plugin}</version>
        <configuration>
          <source>${maven.compiler.source}</source>
          <target>${maven.compiler.target}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>${version.maven-bundle-plugin}</version>
        <extensions>true</extensions>
      </plugin>
      <plugin>
        <!--
          this plugin will use the fabric.* properties to configure its behaviour
          see the Properties section here: http://fabric8.io/gitbook/mavenPlugin.html
        -->
        <groupId>io.fabric8</groupId>
        <artifactId>fabric8-maven-plugin</artifactId>
        <version>${fabric.version}</version>
      </plugin>
    </plugins>
  </build>
</project>

【问题讨论】:

    标签: maven apache-camel pom.xml jbossfuse


    【解决方案1】:

    在深入研究了这个问题后,我找到了解决方案。

    在阅读了错误代码行之后:

    Failed to execute goal org.apache.felix:maven-bundle-plugin:2.3.7:bundle

    我认为 org.apace.felix 存在一些问题,但后来我注意到了错误行:

    The JAR/ZIP file (/home/pr.singh/.m2/repository/org/apache/camel/camel-jetty/2.17.0.redhat-630187/camel-jetty-2.17.0.redhat-630187.jar) seems corrupted
    

    问题: 所以问题是我的骆驼码头罐子损坏了。

    解决方案: 我简单地导航到/home/pr.singh/.m2/repository/org/apache/camel 并删除了camel jetty
    在项目上运行 mvn clean install 并创建名为 camel jetty 的新文件(maven 安装了此插件)。并且错误消失了。

    【讨论】:

      猜你喜欢
      • 2021-02-20
      • 2018-12-17
      • 2018-01-02
      • 2013-05-30
      • 2016-02-27
      • 2015-11-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多