2017-07-07 162 views
1

我得到下面的错误,而建设我的代码 -Maven构建,因为没有“未能执行目标org.apache.felix:行家束-插件:2.5.3”

[ERROR] Failed to execute goal org.apache.felix:maven-bundle-plugin:2.5.3:bundle 
(default-bundle) on project acs.core: Error(s) found in bundle configuration -> 
[Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o 
rg.apache.felix:maven-bundle-plugin:2.5.3:bundle (default-bundle) on project acs 
.core: Error(s) found in bundle configuration 
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor 
.java:213) 
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor 
.java:154) 
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor 
.java:146) 
     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje 
ct(LifecycleModuleBuilder.java:117) 
     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje 
ct(LifecycleModuleBuilder.java:81) 
     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThre 
adedBuilder.build(SingleThreadedBuilder.java:51) 
     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl 
eStarter.java:128) 
     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309) 
     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194) 
     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107) 
     at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993) 
     at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345) 
     at org.apache.maven.cli.MavenCli.main(MavenCli.java:191) 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. 
java:57) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces 
sorImpl.java:43) 
     at java.lang.reflect.Method.invoke(Method.java:606) 
     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun 
cher.java:289) 
     at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav 
a:229) 
     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La 
uncher.java:415) 
     at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java: 
356) 
Caused by: org.apache.maven.plugin.MojoExecutionException: Error(s) found in bun 
dle configuration 
     at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java: 
448) 
     at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java: 
294) 
     at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java: 
285) 
     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default 
BuildPluginManager.java:134) 
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor 
.java:208) 
     ... 20 more 
Caused by: org.apache.maven.plugin.MojoFailureException: Error(s) found in bundl 
e configuration 
     at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java: 
386) 
     ... 24 more 
[ERROR] 
[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 rea 
d the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE 
xception 
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command 

[ERROR] mvn <goals> -rf :acs.core 

我已经包括依赖于“行家束-插件”作为 -

<plugin> 
        <groupId>org.apache.felix</groupId> 
        <artifactId>maven-bundle-plugin</artifactId> 
        <extensions>true</extensions> 
        <version>2.5.3</version> 
        <executions> 
          <execution> 
          <id>default-deploy</id> 
          <phase>no-execute</phase> 
          <goals> 
           <goal>deploy</goal> 
          </goals> 
         </execution> 
        </executions> 
        <inherited>true</inherited> 
       </plugin> 

我试图改变的版本还可以,但没有运气。任何想法如何解决这个问题?

谢谢!

+1

你肯定“不执行”是有效的?我认为我以前从未见过这个阶段。 – Araymer

+0

@Araymer是的,我认为是这样,因为这对所有其他团队成员都有效。 :)另外,我尝试了没有这个阶段语句的构建,但仍然得到相同的错误。 – Sara

+0

没有“不执行”maven阶段,maven或bundle项目中默认没有。无论如何,请将您的maven和java版本以及其他任何构建插件配置发布到子模块中。 –

回答

1

下方添加插件代码在你的主要的pom.xml

<plugin> 
         <groupId>org.apache.felix</groupId> 
         <artifactId>maven-bundle-plugin</artifactId> 
         <version>2.5.3</version> 
         <inherited>true</inherited> 
        </plugin> 

及以下插件代码在你的包的pom.xml

<plugin> 
        <groupId>org.apache.felix</groupId> 
        <artifactId>maven-bundle-plugin</artifactId> 
        <extensions>true</extensions> 
        <configuration> 
         <instructions> 

          <import-package>javax.inject;version=1.0.0,*</import-package> 

         </instructions> 
        </configuration> 
       </plugin> 
相关问题