2017-01-03 95 views
0

我正在從Create a Router Project開發一個JBoss-Fuse項目。
未能執行目標org.apache.felix:maven-bundle-plugin:2.3.7

在運行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> 

回答

0

挖一點關於這個問題後,我找到了解決的辦法。

閱讀的錯誤代碼這行後:

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安裝此插件)。錯誤消失了。

相關問題