sonar 5.2 NullPointerException - java

My environment is the following:
http://localhost:9000/sonar/api/server/version :: 5.2
java,sonar-java-plugin-3.7.jar|07dba2b9cad37584d82522414b2dccd0
scmgit,sonar-scm-git-plugin-1.0.jar|e1d9d8e1d3524f9f0f69017e6dbead02
scmsvn,sonar-scm-svn-plugin-1.2.jar|188d526ad86ec7f2dc7de694bf5f1851
printenv | grep MAVEN<BR>
MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=512m
I launch the command:
mvn sonar:sonar -Dsonar.verbose=true
and it fails as reported here below.
If I insert the file MyFileName.java (ref. backtrace) in the SonarQube Global Source File Exclusions, then the process goes ahead, up to a next file (likely to a next file that needs to be traced because it's affected by some issue) and it fails again with the same symptoms.
There's no specific trace in the sonar.log file.
Same results with:
mvn org.codehaus.mojo:sonar-maven-plugin:2.6:sonar -Dsonar.verbose=true
The main project I'm trying to analyse is very wide and the "module" that is failing is the 103rd one; this is only to say that there are several modules already processed in the previous stages without any sonar failures.
Any suggestions on how I could investigate this issue?
Backtrace:
....
[INFO] ------------- Scan My103thModule
[INFO] Language is forced to java
[INFO] Base dir: /bla/bla/bla
[INFO] Working dir: /bla/bla/bla/target/sonar
[INFO] Source paths: pom.xml, src/main/java
[INFO] Binary dirs: target/classes
[INFO] Source encoding: UTF-8, default locale: en_US
[INFO] Index files
[INFO] 1 files indexed
[INFO] Quality profile for java: Sonar way
[INFO] JaCoCoSensor: JaCoCo report not found.
[INFO] JaCoCoItSensor: JaCoCo IT report not found.
[INFO] JaCoCoOverallSensor: JaCoCo reports not found.
[INFO] Sensor JavaSquidSensor
[INFO] Java Main Files AST scan...
[INFO] 1 source files to be analyzed
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[....]
[INFO] BUILD FAILURE
[....]
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project mlwc.project: SonarQube is unable to analyze file : ' ..../MyFileName.java': NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project mlwc.project: SonarQube is unable to analyze file : ' ..../MyFileName.java'
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: SonarQube is unable to analyze file : ' ..../MyFileName.java'
at org.codehaus.mojo.sonar.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:41)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:104)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:135)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.sonar.squidbridge.api.AnalysisException: SonarQube is unable to analyze file : '..../MyFileName.java'
at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:105)
at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:77)
at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:130)
at org.sonar.java.JavaSquid.scan(JavaSquid.java:123)
at org.sonar.plugins.java.JavaSquidSensor.analyse(JavaSquidSensor.java:90)
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:98)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:258)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:253)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:251)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:251)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:243)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
at org.sonar.batch.bootstrap.GlobalContainer.executeAnalysis(GlobalContainer.java:153)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:110)
at org.sonar.runner.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.sonar.runner.impl.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:61)
at com.sun.proxy.$Proxy21.execute(Unknown Source)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:275)
at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:166)
at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:153)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstrapper.execute(RunnerBootstrapper.java:99)
... 22 more
Caused by: java.lang.NullPointerException
at org.sonar.batch.source.SymbolizableBuilder.loadPerspective(SymbolizableBuilder.java:46)
at org.sonar.batch.source.SymbolizableBuilder.loadPerspective(SymbolizableBuilder.java:32)
at org.sonar.batch.deprecated.perspectives.BatchPerspectives.as(BatchPerspectives.java:63)
at org.sonar.java.SonarComponents.symbolizableFor(SonarComponents.java:111)
at org.sonar.java.model.InternalVisitorsBridge.createSonarSymbolTable(InternalVisitorsBridge.java:170)
at org.sonar.java.model.InternalVisitorsBridge.visitFile(InternalVisitorsBridge.java:104)
at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:97)
... 52 more

I also had this issue and found that upgrading (from 5.2) to SonarQube 5.3 resolved it. This suggests that the issue is related to a bug with 5.2 however I have not been able to track down the specific fix. I'll update this answer with a link to the Jira if I find it

Related

jgitflow-maven-plugin and GitHub Issue

My Jenkins release job, which uses jgitflow-maven-plugin to release an Open Source project on GitHub, throws an exception though it used to work.
Maven goals:
jgitflow:release-start -e -X -Dhttps.protocols=TLSv1.2
jgitflow:release-finish -e -X -Dgpg.useagent=false -Dhttps.protocols=TLSv1.2
Exception:
[DEBUG] (develop) committing all poms on branch 'develop'
[DEBUG] (develop) adding file pattern for poms commit: pom.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.763 s
[INFO] Finished at: 2018-02-11T12:31:56+01:00
[INFO] Final Memory: 28M/492M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-finish (default-cli) on project my-project: Execution default-cli of goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-finish failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-finish (default-cli) on project my-project: Execution default-cli of goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-finish failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-finish failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: java.lang.NullPointerException
at com.atlassian.jgitflow.core.command.AbstractGitFlowCommand.failedResult(AbstractGitFlowCommand.java:133)
at com.atlassian.jgitflow.core.command.AbstractGitFlowCommand.doPushIfNeeded(AbstractGitFlowCommand.java:104)
at com.atlassian.jgitflow.core.command.ReleaseFinishCommand.call(ReleaseFinishCommand.java:148)
at com.atlassian.maven.plugins.jgitflow.manager.DefaultFlowReleaseManager.finish(DefaultFlowReleaseManager.java:99)
at com.atlassian.maven.plugins.jgitflow.mojo.ReleaseFinishMojo.execute(ReleaseFinishMojo.java:174)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 21 more
What worked:
a release branch has been created in the remote GitHub project
the artifact with the released version number has been pushed to https://oss.sonatype.org/
the local develop branch has been updated with the next development version
But no commit has been pushed to GitHub. The remote release branch does not have any new commits either.
Caused by: java.lang.NullPointerException
at com.atlassian.jgitflow.core.command.AbstractGitFlowCommand.failedResult(AbstractGitFlowCommand.java:133)
at com.atlassian.jgitflow.core.command.AbstractGitFlowCommand.doPushIfNeeded(AbstractGitFlowCommand.java:104)
This looks to me as something went wrong when the plugin wanted to push the commits, but the error message got lost because of a NullPointerException in failedResult!?
Does anyone know what change on the GitHub infrastructure might cause this issue?
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /opt/maven
Java version: 1.8.0_161, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-112-generic", arch: "amd64", family: "unix"
The snapshot version 1.0.0-SNAPSHOT of the plugin provided a better error message:
Caused by: com.atlassian.jgitflow.core.exception.JGitFlowGitAPIException: error pushing to develop - status: REJECTED_OTHER_REASON - error: GH006: Protected branch update failed for refs/heads/develop.
error: At least one approved review is required by reviewers with write access.
at com.atlassian.jgitflow.core.command.AbstractGitFlowCommand.doPushIfNeeded(AbstractGitFlowCommand.java:107)
I had to remove the "Include administrators" flag on the branch protection configuration in GitHub.
I filed an issue to make this version available: https://ecosystem.atlassian.net/browse/MJF-298

Cannot execute a simple maven project through jenkins

I'm using Linux - Ubuntu 14.04.
I've installed Jenkins 2.7.2.
I created a maven project in Eclipse and followed the instructions provided in this link http://www.guru99.com/maven-jenkins-with-selenium-complete-tutorial.html.
After completing the project setup, I executed it as Maven Project and the build was successful.
Then I installed Jenkins, installed Maven Integration Plugin, created a Maven Project and added the Root POM location and in 'Goals and options' field, I gave 'test' as input and executed the Build, but the Build was a failure.
The console output is as follows:
Started by user QA Admin
Building in workspace /var/lib/jenkins/workspace/WebDriverTest2
Parsing POMs
Established TCP socket on 58065
[WebdriverTest] $ java -Xms1024m -Xmx4096m -XX:PermSize=1024m -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-agent-1.7.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/boot/plexus-classworlds-2.5.2.jar:/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven/conf/logging jenkins.maven3.agent.Maven32Main /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven /var/cache/jenkins/war/WEB-INF/lib/remoting-2.60.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-interceptor-1.7.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.7.jar 58065
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=1024m; support was removed in 8.0
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /home/admin/workspace/WebdriverTest/pom.xml test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WebdriverTest 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # WebdriverTest ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) # WebdriverTest ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # WebdriverTest ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) # WebdriverTest ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) # WebdriverTest ---
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[JENKINS] Recording test results
hudson.AbortException: Test reports were found but none of them are new. Did tests run?
For example, /home/admin/workspace/WebdriverTest/target/surefire-reports/TEST-TestSuite.xml is 23 min old
at hudson.tasks.junit.TestResult.parse(TestResult.java:228)
at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:148)
at hudson.maven.Maven3Builder$MavenExecutionListener.recordMojoEnded(Maven3Builder.java:634)
at hudson.maven.Maven3Builder$MavenExecutionListener.mojoFailed(Maven3Builder.java:667)
at hudson.maven.Maven3Builder$JenkinsEventSpy.onEvent(Maven3Builder.java:311)
at org.apache.maven.eventspy.internal.EventSpyDispatcher.onEvent(EventSpyDispatcher.java:104)
at org.apache.maven.eventspy.internal.EventSpyExecutionListener.mojoFailed(EventSpyExecutionListener.java:138)
at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:90)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:219)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.jvnet.hudson.maven3.launcher.Maven32Launcher.main(Maven32Launcher.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
at jenkins.maven3.agent.Maven32Main.launch(Maven32Main.java:186)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:136)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:332)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.097 s
[INFO] Finished at: 2016-08-25T17:16:17+05:30
[INFO] Final Memory: 18M/981M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project WebdriverTest: Error creating properties files for forking: No such file or directory -> [Help 1]
[JENKINS] Archiving /home/admin/workspace/WebdriverTest/pom.xml to WebdriverTest/WebdriverTest/0.0.1-SNAPSHOT/WebdriverTest-0.0.1-SNAPSHOT.pom
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
/home/admin/workspace/WebdriverTest/pom.xml is not inside /var/lib/jenkins/workspace/WebDriverTest2/home/admin/workspace/WebdriverTest/; will archive in a separate pass
channel stopped
Finished: FAILURE
Any help is greatly appreciated. Please help. Thanks in advance.
It looks like you may have given an absolute path to the pom file. At the top Maven logs
Building in workspace /var/lib/jenkins/workspace/WebDriverTest2
And at the end you can see
/home/admin/workspace/WebdriverTest/pom.xml is not inside /var/lib/jenkins/workspace/WebDriverTest2/home/admin/workspace/WebdriverTest/; will archive in a separate pass
So if what I'm thinking is correct, you just need to change the "Root POM" parameter. Give it a relative path to the pom.xml from the project's root directory. So if your project is
WebDriverTest
src/main/java
src/test/java
...
pom.xml
The "Root POM" parameter should just be pom.xml

Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate

I'm using instructions mentioned at apache website to create Struts2 convention based app with the following Maven command:
mvn archetype:generate -DgroupId=com.example.apps -DartifactId=phonedirectory -Dversion=1.0 -DinteractiveMode=false -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2.archetype-convention -DarchetypeVersion=2.3.24.1 -DremoteRepositories=http://struts.apache.org -e
But I get the following error:
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.4:generate (default-cli) > generate-sources # standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.4:generate (default-cli) < generate-sources # standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.4:generate (default-cli) # standalone-pom ---
[INFO] Generating project in Batch mode
[WARNING] Archetype not found in any catalog. Falling back to central repository (http://repo.maven.apache.org/maven2).
[WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere.
Downloading: http://repo.maven.apache.org/maven2/org/apache/struts/struts2.archetype-convention/2.3.24.1/struts2.archetype-convention-2.3.24.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.619 s
[INFO] Finished at: 2015-11-09T11:49:41+05:30
[INFO] Final Memory: 15M/114M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate (default-cli) on project standalone-pom: The desired archetype does not exist (org.apache.struts:struts2.archetype-convention:2.3.24.1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate (default-cli) on project standalone-pom: The desired archetype does not exist (org.apache.struts:struts2.archetype-convention:2.3.24.1)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: The desired archetype does not exist (org.apache.struts:struts2.archetype-convention:2.3.24.1)
at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:205)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
Caused by: org.apache.maven.archetype.exception.UnknownArchetype: The desired archetype does not exist (org.apache.struts:struts2.archetype-convention:2.3.24.1)
at org.apache.maven.archetype.ui.generation.DefaultArchetypeGenerationConfigurator.configureArchetype(DefaultArchetypeGenerationConfigurator.java:119)
at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:189)
... 22 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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
The corporate internet connectivity and firewall filtering rules seems to be ok.
I've no idea why the struts2-archetype-convention isn't available at the remote repo http://struts.apache.org.
If anybody faced the similiar issue then please share the solution.
Maven is searching for the following:
struts2.archetype-convention
whereas, it should be searching for
struts2-archetype-convention
The final link should be:
https://repo.maven.apache.org/maven2/org/apache/struts/struts2-archetype-convention/2.3.24.1/struts2-archetype-convention-2.3.24.1.jar
so, change
-DarchetypeArtifactId=struts2.archetype-convention
to
-DarchetypeArtifactId=struts2-archetype-convention

Sonarqube 5.2 / Checkstyle plugin 2.3 : Enabling SummaryJavadocCheck makes the analysis failed

I recently change my SONARQUBE configuration:
Before:
SonarQube 5.1
Java plugin 3.0
PMD plugin 2.3
Checkstyle plugin 2.2
FindBugs plugin 3.2
Issue Assign plugin 1.6
After:
SonarQube 5.1
Java plugin 3.3
PMD plugin 2.4.1
Checkstyle plugin 2.3
FindBugs plugin 3.2
Issue Assign plugin 1.6
On new configuration I have enabled all new rules brought from 3.1 to 3.2 Java plugin version.
The analysis batch fails at IssueTracking Decorating stage of the batch analysis:
[INFO] [08:37:25.503] Compare over 1 days (2015-05-31, analysis of Fri May 29 21:49:21 BST 2015)
[INFO] [08:37:25.504] Compare over 7 days (2015-05-25, analysis of Mon May 25 08:07:18 BST 2015)
[INFO] [08:37:25.505] Compare over 30 days (2015-05-02, analysis of Sat May 02 00:19:16 BST 2015)
[INFO] [08:37:25.506] Compare to date 2014-04-01 (analysis of 2014-06-06)
[INFO] [08:37:25.741] Execute decorators...
[INFO] [08:37:25.744] Issue 2c785d7e-3a5b-4282-9c5b-39bd4d645a81 won't be auto-assigned. Reason: NOT_NEW
[INFO] [08:37:25.744] Issue ebcf237e-1bc5-407c-9d84-1224f029b7f6 won't be auto-assigned. Reason: BEFORE_CUTOFF_DATE
[INFO] [08:37:25.748] Issue 01da957a-a184-4baa-8adf-15984869b1fc won't be auto-assigned. Reason: BEFORE_CUTOFF_DATE
[INFO] [08:37:25.749] Issue 4fe8ef3e-de23-4c59-8846-21b4cd5a875b won't be auto-assigned. Reason: BEFORE_CUTOFF_DATE
[INFO] [08:37:25.749] Issue 6684e397-09ce-488f-8a10-4e5c1eb40492 won't be auto-assigned. Reason: BEFORE_CUTOFF_DATE
[INFO] [08:37:25.749] Issue 6abbb736-898d-4592-bc05-4a52062c57c8 won't be auto-assigned. Reason: BEFORE_CUTOFF_DATE
[INFO] [08:37:25.749] Issue 7375deed-09a7-45b1-8184-40f0b4a4666f won't be auto-assigned. Reason: BEFORE_CUTOFF_DATE
[INFO] [08:37:25.749] Issue 90d82183-edf0-4854-b096-e9a9105af3ad won't be auto-assigned. Reason: BEFORE_CUTOFF_DATE
[INFO] [08:37:25.750] Issue 9170b68c-909b-40c7-aea1-571d8e99ac74 won't be auto-assigned. Reason: BEFORE_CUTOFF_DATE
[INFO] [08:37:25.750] Issue 95221ab3-aa9f-4dc3-9a03-11ddb7dea082 won't be auto-assigned. Reason: BEFORE_CUTOFF_DATE
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project myapp: Fail to decorate 'org.sonar.api.resources.File#7d30e345[key=src/main/java/com/mycompany/EquityAccountingHandler.java,path=src/main/java/com/mycompany/EquityAccountingHandler.java,filename=EquityAccountingHandler.java,language=Java]': 489 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project myapp: Fail to decorate 'org.sonar.api.resources.File#7d30e345[key=src/main/java/com/mycompany/EquityAccountingHandler.java,path=src/main/java/com/mycompany/EquityAccountingHandler.java,filename=EquityAccountingHandler.java,language=Java]'
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Fail to decorate 'org.sonar.api.resources.File#7d30e345[key=src/main/java/com/mycompany/EquityAccountingHandler.java,path=src/main/java/com/mycompany/EquityAccountingHandler.java,filename=EquityAccountingHandler.java,language=Java]'
at org.codehaus.mojo.sonar.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:41)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:139)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:132)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.sonar.api.utils.SonarException: Fail to decorate 'org.sonar.api.resources.File#7d30e345[key=src/main/java/com/mycompany/EquityAccountingHandler.java,path=src/main/java/com/mycompany/EquityAccountingHandler.java,filename=EquityAccountingHandler.java,language=Java]'
at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:104)
at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:87)
at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:79)
at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:79)
at org.sonar.batch.phases.DecoratorsExecutor.execute(DecoratorsExecutor.java:71)
at org.sonar.batch.phases.DatabaseModePhaseExecutor.execute(DatabaseModePhaseExecutor.java:127)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:264)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:220)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:135)
... 22 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 489
at org.sonar.batch.issue.tracking.FileHashes.getHash(FileHashes.java:89)
at org.sonar.batch.issue.tracking.IssueTracking.setChecksumOnNewIssues(IssueTracking.java:66)
at org.sonar.batch.issue.tracking.IssueTracking.track(IssueTracking.java:51)
at org.sonar.batch.issue.tracking.IssueTrackingDecorator.doDecorate(IssueTrackingDecorator.java:139)
at org.sonar.batch.issue.tracking.IssueTrackingDecorator.decorate(IssueTrackingDecorator.java:113)
at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:96)
... 57 more
Any idea what happened?
EDIT:
I removed new rule checkstyle:com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck brought by checkstyle 2.3 plugin version. The analysis works correctly now.
The issue is due to some Checkstyle rules. If you remove them, this solves the problem.
For further reference: http://sonarqube.15.x6.nabble.com/ArrayIndexOutOfBoundsException-while-decorating-Java-file-td5034646.html

Maven not able to find plugin descriptor

Im trying to build a legacy project, which has dependencies like torque. When I try to execute the command mvn torque:create-db
But I see the following error
D:\someproject\cps-rfq\someproject-new\someproject>mvn torque:create-db
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin descriptor for the plugin Plugin [torque:maven-torque-plugin]
was not found. Please verify that the plugin JAR D:\someproject\cps-rfq\lib\torque\ma
ven-torque-plugin\3.3-RC3\maven-torque-plugin-3.3-RC3.jar is intact.
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.IllegalStateException: The plugin descriptor for the plugin Plugin [to
rque:maven-torque-plugin] was not found. Please verify that the plugin JAR D:\IR
DEV\cps-rfq\lib\torque\maven-torque-plugin\3.3-RC3\maven-torque-plugin-3.3-RC3.
jar is intact.
at org.apache.maven.plugin.DefaultPluginManager.addPlugin(DefaultPluginM
anager.java:360)
at org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(De
faultPluginManager.java:224)
at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPlug
inManager.java:184)
at org.apache.maven.plugin.DefaultPluginManager.loadPluginDescriptor(Def
aultPluginManager.java:1642)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(Defa
ultLifecycleExecutor.java:1540)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor
(DefaultLifecycleExecutor.java:1787)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListBy
AggregationNeeds(DefaultLifecycleExecutor.java:462)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:175)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:6
0)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Sat Jun 29 11:56:10 IST 2013
[INFO] Final Memory: 1M/15M
[INFO] ------------------------------------------------------------------------
But I can see the D:\someproject\cps-rfq\lib\torque\maven-torque-plugin\3.3-RC3\maven-torque-plugin-3.3-RC3.jar file in the repo.
I would suggest to use the final release version like this:
mvn torque:maven-torque-plugin:3.3:create-db
Furthermore i would suggest to first try to delete the folder in your local repository:
D:\someproject\cps-rfq\lib\torque
And retry your build, cause it looks weired that the RC version has been in use instead of the release version.

Categories

Resources