Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: ANT-TASK-2.0
-
Component/s: Ant Task
-
Labels:None
-
Number of attachments :
Description
The following error occurs when running sonar-ant-task-1.4 with ant:
java.lang.NoSuchMethodError: com.google.common.cache.CacheBuilder.build(Lcom/google/common/cache/CacheLoader;)Lcom/google/common/cache/Cache;
Here is the full output:
[java] test-sonar:
[java] [sonar:sonar] Apache Ant(TM) version 1.8.2 compiled on December 3 2011
[java] [sonar:sonar] Sonar Ant Task version: 1.4
[java] [sonar:sonar] Loaded from: file:/var/lib/jenkins/jobs/inv-common/workspace/01_metaproject/lib/temp/sonar-ant-task-1.4.jar
[java] [sonar:sonar] Sonar work directory: /var/lib/jenkins/jobs/inv-common/workspace/03_modules/de.invesdwin.common/dist/junit/.sonar
[java] [sonar:sonar] Sonar server: http://invesdwin.de:8083
[java] [sonar:sonar] Sonar version: 3.0.1
[java] [sonar:sonar] 13:21:37.481 DEBUG .b.b.TempDirectories - Temporary directory: /tmp/sonar-batch4437758378298826869161912805619218
[java] [sonar:sonar] 13:21:37.483 DEBUG b.ArtifactDownloader - Downloading JDBC driver to /tmp/sonar-batch4437758378298826869161912805619218/jdbc-driver.jar
[java] [sonar:sonar] 13:21:37.483 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/jdbc-driver.jar (no proxy)
[java] [sonar:sonar] 13:21:37.516 INFO o.s.c.p.Database - Create JDBC datasource
[java] [sonar:sonar] 13:21:38.013 INFO actDatabaseConnector - Initializing Hibernate
[java] [sonar:sonar] 13:21:38.015 DEBUG actDatabaseConnector - hibernate.generate_statistics: false
[java] [sonar:sonar] 13:21:38.015 DEBUG actDatabaseConnector - hibernate.dialect: org.sonar.core.persistence.dialect.MySql$MySqlWithDecimalDialect
[java] [sonar:sonar] 13:21:38.015 DEBUG actDatabaseConnector - hibernate.connection.provider_class: org.sonar.jpa.session.CustomHibernateConnectionProvider
[java] [sonar:sonar] 13:21:38.015 DEBUG actDatabaseConnector - hibernate.hbm2ddl.auto: validate
[java] [sonar:sonar] 13:21:38.630 DEBUG b.ArtifactDownloader - Downloading index of plugins
[java] [sonar:sonar] 13:21:38.630 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/plugins/index.txt (no proxy)
[java] [sonar:sonar] 13:21:38.635 DEBUG b.ArtifactDownloader - Downloading plugin findbugs into /tmp/sonar-batch4437758378298826869161912805619218/plugins/findbugs
[java] [sonar:sonar] 13:21:38.635 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/plugins/findbugs/sonar-findbugs-plugin-3.0.1.jar (no proxy)
[java] [sonar:sonar] 13:21:38.686 DEBUG atchPluginRepository - Excluded plugin: findbugs
[java] [sonar:sonar] 13:21:38.686 DEBUG b.ArtifactDownloader - Downloading plugin jacoco into /tmp/sonar-batch4437758378298826869161912805619218/plugins/jacoco
[java] [sonar:sonar] 13:21:38.686 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/plugins/jacoco/sonar-jacoco-plugin-3.0.1.jar (no proxy)
[java] [sonar:sonar] 13:21:38.690 DEBUG atchPluginRepository - Excluded plugin: jacoco
[java] [sonar:sonar] 13:21:38.691 DEBUG b.ArtifactDownloader - Downloading plugin l10nen into /tmp/sonar-batch4437758378298826869161912805619218/plugins/l10nen
[java] [sonar:sonar] 13:21:38.691 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/plugins/l10nen/sonar-l10n-en-plugin-3.0.1.jar (no proxy)
[java] [sonar:sonar] 13:21:38.693 DEBUG atchPluginRepository - Excluded plugin: l10nen
[java] [sonar:sonar] 13:21:38.693 DEBUG b.ArtifactDownloader - Downloading plugin surefire into /tmp/sonar-batch4437758378298826869161912805619218/plugins/surefire
[java] [sonar:sonar] 13:21:38.693 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/plugins/surefire/sonar-surefire-plugin-3.0.1.jar (no proxy)
[java] [sonar:sonar] 13:21:38.694 DEBUG atchPluginRepository - Excluded plugin: surefire
[java] [sonar:sonar] 13:21:38.694 DEBUG b.ArtifactDownloader - Downloading plugin cpd into /tmp/sonar-batch4437758378298826869161912805619218/plugins/cpd
[java] [sonar:sonar] 13:21:38.695 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/plugins/cpd/sonar-cpd-plugin-3.0.1.jar (no proxy)
[java] [sonar:sonar] 13:21:38.696 DEBUG atchPluginRepository - Excluded plugin: cpd
[java] [sonar:sonar] 13:21:38.696 DEBUG b.ArtifactDownloader - Downloading plugin checkstyle into /tmp/sonar-batch4437758378298826869161912805619218/plugins/checkstyle
[java] [sonar:sonar] 13:21:38.696 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/plugins/checkstyle/sonar-checkstyle-plugin-3.0.1.jar (no proxy)
[java] [sonar:sonar] 13:21:38.698 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/plugins/checkstyle/README.txt (no proxy)
[java] [sonar:sonar] 13:21:38.706 DEBUG atchPluginRepository - Excluded plugin: checkstyle
[java] [sonar:sonar] 13:21:38.707 DEBUG b.ArtifactDownloader - Downloading plugin pmd into /tmp/sonar-batch4437758378298826869161912805619218/plugins/pmd
[java] [sonar:sonar] 13:21:38.707 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/plugins/pmd/sonar-pmd-plugin-3.0.1.jar (no proxy)
[java] [sonar:sonar] 13:21:38.710 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/plugins/pmd/README.txt (no proxy)
[java] [sonar:sonar] 13:21:38.721 DEBUG atchPluginRepository - Excluded plugin: pmd
[java] [sonar:sonar] 13:21:38.721 DEBUG b.ArtifactDownloader - Downloading plugin core into /tmp/sonar-batch4437758378298826869161912805619218/plugins/core
[java] [sonar:sonar] 13:21:38.721 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/plugins/core/sonar-core-plugin-3.0.1.jar (no proxy)
[java] [sonar:sonar] 13:21:38.723 DEBUG atchPluginRepository - Excluded plugin: core
[java] [sonar:sonar] 13:21:38.723 DEBUG b.ArtifactDownloader - Downloading plugin dbcleaner into /tmp/sonar-batch4437758378298826869161912805619218/plugins/dbcleaner
[java] [sonar:sonar] 13:21:38.723 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/plugins/dbcleaner/sonar-dbcleaner-plugin-3.0.1.jar (no proxy)
[java] [sonar:sonar] 13:21:38.724 DEBUG atchPluginRepository - Excluded plugin: dbcleaner
[java] [sonar:sonar] 13:21:38.724 DEBUG b.ArtifactDownloader - Downloading plugin cobertura into /tmp/sonar-batch4437758378298826869161912805619218/plugins/cobertura
[java] [sonar:sonar] 13:21:38.724 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/plugins/cobertura/sonar-cobertura-plugin-3.0.1.jar (no proxy)
[java] [sonar:sonar] 13:21:38.725 DEBUG atchPluginRepository - Excluded plugin: cobertura
[java] [sonar:sonar] 13:21:38.725 DEBUG b.ArtifactDownloader - Downloading plugin squidjava into /tmp/sonar-batch4437758378298826869161912805619218/plugins/squidjava
[java] [sonar:sonar] 13:21:38.725 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/plugins/squidjava/sonar-squid-java-plugin-3.0.1.jar (no proxy)
[java] [sonar:sonar] 13:21:38.736 DEBUG atchPluginRepository - Excluded plugin: squidjava
[java] [sonar:sonar] 13:21:38.736 DEBUG b.ArtifactDownloader - Downloading plugin emailnotifications into /tmp/sonar-batch4437758378298826869161912805619218/plugins/emailnotifications
[java] [sonar:sonar] 13:21:38.736 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/plugins/emailnotifications/sonar-email-notifications-plugin-3.0.1.jar (no proxy)
[java] [sonar:sonar] 13:21:38.742 DEBUG atchPluginRepository - Excluded plugin: emailnotifications
[java] [sonar:sonar] 13:21:38.742 DEBUG b.ArtifactDownloader - Downloading plugin design into /tmp/sonar-batch4437758378298826869161912805619218/plugins/design
[java] [sonar:sonar] 13:21:38.742 DEBUG s.a.u.HttpDownloader - Download: http://invesdwin.de:8083/deploy/plugins/design/sonar-design-plugin-3.0.1.jar (no proxy)
[java] [sonar:sonar] 13:21:38.744 DEBUG atchPluginRepository - Excluded plugin: design
[java] [sonar:sonar] 13:21:39.280 INFO .s.b.b.ProjectModule - ------------- Analyzing de.invesdwin.common
[java] [sonar:sonar] 13:21:39.819 INFO .s.b.ProfileProvider - Selected quality profile : [name=Sonar way with Findbugs,language=java]
[java] [sonar:sonar] 13:21:39.838 INFO nPluginsConfigurator - Configure maven plugins...
[java] [sonar:sonar] 13:21:39.926 INFO org.sonar.INFO - Compare to previous analysis
[java] [sonar:sonar] 13:21:39.957 INFO org.sonar.INFO - Compare over 5 days (2012-05-11)
[java] [sonar:sonar] 13:21:39.982 INFO org.sonar.INFO - Compare over 30 days (2012-04-16)
[java] [sonar:sonar] 13:21:40.020 DEBUG b.b.JdbcDriverHolder - To prevent a memory leak, the JDBC Driver [com.mysql.jdbc.Driver] has been forcibly deregistered
[java] [sonar:sonar] 13:21:40.024 DEBUG .b.b.TempDirectories - Delete temporary directory: /tmp/sonar-batch4437758378298826869161912805619218
[java]
[java] BUILD FAILED
[java] /var/lib/jenkins/jobs/inv-common/workspace/01_metaproject/src/build.module.xml:379: java.lang.NoSuchMethodError: com.google.common.cache.CacheBuilder.build(Lcom/google/common/cache/CacheLoader;)Lcom/google/common/cache/Cache;
[java] at org.sonar.core.review.ReviewDao.<init>(ReviewDao.java:43)
[java] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[java] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
[java] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[java] at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
[java] at org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:147)
[java] at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:348)
[java] at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:272)
[java] at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:370)
[java] at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
[java] at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
[java] at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
[java] at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:692)
[java] at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:646)
[java] at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:621)
[java] at org.picocontainer.containers.ImmutablePicoContainer.getComponent(ImmutablePicoContainer.java:40)
[java] at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:711)
[java] at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:646)
[java] at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:621)
[java] at org.picocontainer.containers.ImmutablePicoContainer.getComponent(ImmutablePicoContainer.java:40)
[java] at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:711)
[java] at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:646)
[java] at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
[java] at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:105)
[java] at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
[java] at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:75)
[java] at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:315)
[java] at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:341)
[java] at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:272)
[java] at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:370)
[java] at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
[java] at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
[java] at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
[java] at org.picocontainer.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:606)
[java] at org.picocontainer.DefaultPicoContainer.getComponents(DefaultPicoContainer.java:587)
[java] at org.sonar.api.platform.ComponentContainer.getComponentsByType(ComponentContainer.java:121)
[java] at org.sonar.api.batch.BatchExtensionDictionnary.completeBatchExtensions(BatchExtensionDictionnary.java:91)
[java] at org.sonar.api.batch.BatchExtensionDictionnary.getExtensions(BatchExtensionDictionnary.java:85)
[java] at org.sonar.api.batch.BatchExtensionDictionnary.getFilteredExtensions(BatchExtensionDictionnary.java:98)
[java] at org.sonar.api.batch.BatchExtensionDictionnary.select(BatchExtensionDictionnary.java:57)
[java] at org.sonar.api.batch.BatchExtensionDictionnary.selectMavenPluginHandlers(BatchExtensionDictionnary.java:65)
[java] at org.sonar.batch.phases.MavenPluginsConfigurator.execute(MavenPluginsConfigurator.java:49)
[java] at org.sonar.batch.phases.Phases.execute(Phases.java:88)
[java] at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:143)
[java] at org.sonar.batch.bootstrap.Module.start(Module.java:83)
[java] at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:115)
[java] at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:105)
[java] at org.sonar.batch.bootstrap.Module.start(Module.java:83)
[java] at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:109)
[java] at org.sonar.batch.bootstrap.Module.start(Module.java:83)
[java] at org.sonar.batch.Batch.execute(Batch.java:104)
[java] at org.sonar.ant.Launcher.execute(Launcher.java:78)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:616)
[java] at org.sonar.ant.SonarTask.delegateExecution(SonarTask.java:244)
[java] at org.sonar.ant.SonarTask.execute(SonarTask.java:193)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[java] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:616)
[java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:390)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[java] at org.apache.tools.ant.Main.runBuild(Main.java:809)
[java] at org.apache.tools.ant.Main.startAnt(Main.java:217)
[java] at org.apache.tools.ant.Main.start(Main.java:180)
[java] at org.apache.tools.ant.Main.main(Main.java:268)
[java]
[java] Total time: 29 seconds
Maybe sonar-ant-task needs to fetch the correct guava/google-commons lib or needs an upgrade to a recent version of the lib?
The project being tested with sonar has guava-11.0.1 in its sonar.libraries property dir lying.
The task that executes sonar looks as follows:
<target name="test-sonar" depends="test"> <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml"> <classpath> <fileset dir="${metaproject.lib.temp.dir}" includes="sonar-ant-task-*.jar" /> </classpath> </taskdef> <property name="sonar.projectKey" value="${ivy.organisation}:${ivy.module}" /> <property name="sonar.sources" value="${src.dir}" /> <property name="sonar.tests" value="${test.dir}" /> <property name="sonar.binaries" value="${dist.junit.bin.dir}" /> <property name="sonar.libraries" value="${dist.junit.lib.dir}" /> <!-- http://stackoverflow.com/questions/8864765/project-coverage-is-set-to-0-jacoco-and-sonar-in-jenkins --> <property name="sonar.dynamicAnalysis" value="reuseReports" /> <property name="sonar.surefire.reportsPath" value="${dist.junit.dir}" /> <property name="sonar.core.codeCoveragePlugin" value="jacoco" /> <property name="sonar.jacoco.reportPath" value="${dist.junit.dir}/jacoco.exec" /> <sonar:sonar basedir="${dist.junit.dir}" key="${ivy.organisation}:${ivy.module}" version="${ivy.revision}" xmlns:sonar="antlib:org.sonar.ant" /> </target>While the test task prepares everything, runs the tests and analyzes code coverage with jacoco automatically.
The test-sonar task as above runs fine for other modules, even though they also have guava-11.0.1 in their sonar.libraries dir.