调整Sonar BuildBreaker代码

时间:2017-02-18 17:33:23

标签: java eclipse maven sonarqube

我一直在尝试使用我从github https://github.com/SonarQubeCommunity/sonar-build-breaker克隆的声纳构建破坏程序代码构建maven。我想调整代码,但它不会编译;我已经尝试了几周的故障排除。似乎没有互联网的答案。关于这个问题可能有什么建议吗?

这是我的系统详情:

Apache Maven 3.3.9 Java版本:1.8.0_92 Windows 7

这是maven构建的错误:

  

[警告]注入错误:   org.sonarsource.pluginpackaging.SonarPluginMojo   java.lang.NoClassDefFoundError:com / google / common / base / function at   java.lang.Class.getDeclaredConstructors0(Native Method)at   java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)at at   java.lang.Class.getDeclaredConstructors(Class.java:2020)at   com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)   在   com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:99)   在   com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:658)   在   com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:882)   在   com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805)   在   com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282)   在   com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214)   在   com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:1006)   在   com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1038)   在   com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1001)   在   com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)   在   org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)   在   com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)   在   com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)   在   com.google.inject.internal.ProviderInternalFactory $ 1.call(ProviderInternalFactory.java:65)   在   com.google.inject.internal.ProvisionListenerStackCallback $ Provision.provision(ProvisionListenerStackCallback.java:115)   在   org.eclipse.sisu.bean.BeanScheduler $ Activator.onProvision(BeanScheduler.java:176)   在   com.google.inject.internal.ProvisionListenerStackCallback $ Provision.provision(ProvisionListenerStackCallback.java:126)   在   com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)   在   com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)   在   com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)   在   com.google.inject.internal.InjectorImpl $ 2 $ 1.call(InjectorImpl.java:1016)   在   com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)   在   com.google.inject.internal.InjectorImpl $ 2.注册(InjectorImpl.java:1012)   在org.eclipse.sisu.inject.Guice4 $ 1.get(Guice4.java:162)at   org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)   在   org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)   在   org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)   在   org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)   在   org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:517)   在   org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:121)   在   org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)   在   org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)   在   org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)   在   org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)   在   org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)   在   org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)   在   org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)   在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)at at   org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)at at   org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)at   org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)at at   org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)at at   org.apache.maven.cli.MavenCli.main(MavenCli.java:199)at at   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)   在   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)   在java.lang.reflect.Method.invoke(Method.java:498)at   org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)   在   org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)   在   org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)   在   org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)   引起:java.lang.ClassNotFoundException:   com.google.common.base.Function at   org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)   在   org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)   在   org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)   在   org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)   ... 55更多[INFO]   -------------------------------------------------- ---------------------- [INFO] BUILD FAILURE [INFO]   -------------------------------------------------- ---------------------- [INFO]总时间:5.431 s [INFO]完成于:   2017-02-17T17:08:10-05:00 [INFO]最终记忆:30M / 360M [INFO]   -------------------------------------------------- ---------------------- [错误]无法执行目标   org.sonarsource.sonar-packaging-maven-plugin:sonar-packaging-maven-plugin:1.15:sonar-plugin(default-sonar-plugin)项目sonar-build-breaker-plugin:   执行default-sonar-plugin of goal   org.sonarsource.sonar-packaging-maven-plugin:sonar-packaging-maven-plugin:1.15:sonar-plugin failed:执行时缺少必需的类   org.sonarsource.sonar包装-行家-插件:声纳包装-行家-插件:1.15:声纳-插件:

     

com / google / common / base / Function [ERROR]

1 个答案:

答案 0 :(得分:0)

项目本身很好。它在Travis上完美运行,我在本地进行了双重检查:

git clone https://github.com/SonarQubeCommunity/sonar-build-breaker.git
cd sonar-build-breaker
mvn verify -B -e -V

使用备用本地Maven存储库文件夹(mvn -Dmaven.repo.local={alternate-repository-folder} verify -B -e -V),您可以确保默认文件夹(C:\ Documents and Settings \ {your-username} \。m2 \ repository)中可能已损坏的依赖项不是在这里打扰你。