无法执行目标 org.apache.felix:maven-bundle-plugin:2.3.7 [英] Failed to execute goal org.apache.felix:maven-bundle-plugin:2.3.7

查看:41
本文介绍了无法执行目标 org.apache.felix:maven-bundle-plugin:2.3.7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从 创建路由器项目.

在运行 mvn -install 时,出现以下错误:

While running mvn -install , I am getting following error:

[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教程进行操作,但无法调试问题.请帮忙.

I exactly following the redhat tutorial, I am unable to debug the problem. Please help.

我的 pom.xml 是:

My pom.xml is :

<?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>

推荐答案

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

After digging a bit about the issue, I found the solution to it.

阅读错误代码行后说:

After reading the line of error code that says:

无法执行目标 org.apache.felix:maven-bundle-plugin:2.3.7:bundle

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

I thought there is some issue with org.apace.felix, but later I paid attention to the line of error that was stating :

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

问题:所以问题是我的骆驼码头罐坏了.

Issue: So the issue was that my camel-jetty jar was corrupted.

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

Solution: I simple navigated to /home/pr.singh/.m2/repository/org/apache/camel and deleted camel jetty.
Run mvn clean install on project and new file with name camel jetty was created (maven installed this plugin). And error was gone.

这篇关于无法执行目标 org.apache.felix:maven-bundle-plugin:2.3.7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆