Sonar complaining "SonarQube analysis is already in progress" - sonarqube

I'm trying to run Sonar analysis via Maven, but it continually complains:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project mio-commons: Another SonarQube analysis is already in progress for this project -> [Help 1]
[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:
There is no analysis for this project in progress, and I've even tried deleting the project itself from Sonar. Any ideas what the issue might be?

I solved it, I guess, deleting ${basedir}/.sonar folder.

For me, deleting ${projectDir}/.scannerwork fixed the problem.
Command on linux:
$ <your project directory>
$ rm -rf .scannerwork
I am using sonarqube version 7.0 and sonar-scanner version 3.0.3.778

The cache directory is displayed in the console logs. Deleting that worked for me.
For me, it was under
C:\Users\<username>\.sonar\cache

Related

Build is failing due to maven-sonar plugin issue when I run through VSTS Private agent

I am building maven project after that running sonar analysis but its failing with the below error.I am using java 8 ,Maven 3.0.5,Sonar cube 5.6.7 but I am not sure where should I make the configuration changes.Please help me out.
My VSTS Build tasks are Prepare analysis on sonar cube,Maven,Publish Analysis result.
Error:
Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project Product: With SonarQube server prior to 5.6, it is recommended to use the sonar-maven-plugin 3.3 -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
C:\apache-maven-3.0.5\bin\mvn.bat failed with return code: 1
Could not retrieve code analysis results - Maven run failed.
Build failed.

MojoExecution exception

I get this error while I compile hadoop source code with maven.
I am using windows 8.1, hadoop 2.7.2 and visual studio 2012.
I followed this link Maven MojoExecutionException but it didnt work.
For installing hadoop I use http://harishshan.blogspot.com/2014/10/install-hadoop-251-on-windows-7-64bit.html.
[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:2.7.2:prot
oc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecut
ionException: 'protoc --version' did not return a version -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 :hadoop-common
The exception is not related to Maven. The error message is actually already pointing at the main issue:
[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:2.7.2:protoc \
(compile-protoc) on project hadoop-common: \
org.apache.maven.plugin.MojoExecutionException: \
'protoc --version' did not return a version -> [Help 1]
The protoc goal of the org.apache.hadoop:hadoop-maven-plugins Maven Plugin is checking whether the protoc command is available in the PATH, checking the simplest common command: the version command:
protoc --version
Looking at the tutorial you linked you most probably missed Step 4:
Step 4: Install Protocol buffer 2.5.0
Or you probably didn't configure it properly, not making it available via the command PATH.
Update
The tutorial indeed doesn't provide much information about from where and how to install Protocol Buffer.
The version described by the tutorial is 2.5.0, available here. You can download the Windows zip here. Then simply unzip it and add its path to the Windows PATH: before checking whether the Maven build will then recognize it, first check whether the protoc --version would fine or not from any command line.
Also note: comments to the tutorial point to other errors as well, double check them in case you still encounter other errors in the overall process.

maven Error resolving version for plugin maven-eclipse-plugin in Jenkins

I recently encoutered one error when i built my job on jenkins,
the same build was success in few week, but yesterday the build fails with the following error :
[ERROR] Error resolving version for plugin 'org.apache.maven.plugins:maven- eclipse-plugin' from the repositories [local (/cip/home/jenkins-V1/.m2/repository-Project), central (http://mrm.fr.company.com/Project-virtual), snapshots (http://mrm.fr.company.com/Project-virtual)]: Plugin not found in any plugin repository -> [Help 1]
[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.
[JENKINS] Archiving /cip/home/jenkins-V1/workspace/project/pom.xml to project.pom
[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/PluginVersionResolutionException
For information :
The plugin : maven-eclipse-plugin is existing in the virtual repository of the project, then i don't know why the build fails... , but when the build fails they generate one file in the location of this plugin on the .m2 repository : the file generated is : resolver-status.properties this file contain :
#NOTE: This is an internal implementation file, its format can be changed without prior notice.
#Thu Dec 17 12:29:25 CET 2015
maven-metadata-snapshots.xml.lastUpdated=1450351765625
maven-metadata-central.xml.error=
maven-metadata-central.xml.lastUpdated=1450351765601
maven-metadata-snapshots.xml.error=
Thanks in advance for your help
I had this problem in Eclipse (not Jenkins), and I solved it by clearing my maven cache.
Nestor Urquiza may have the explanation: the "pom.xml file gets somehow modified". He gives further help in case clearing the cache doesn't work.

What's the proper syntax for excluding modules from a Maven build from the command line (Mac bash)?

I'm using Maven 3.2.3 on Mac 10.9.5 (Java 6) with bash shell. Per the accepted answer on this thread -- How do I exclude certain modules from a maven build using the commandline, I'm trying to run a Maven build on my multi-module project while excluding some modules from teh build, so I have crafted this command
davea$ mvn clean install -pl org.mainco.subco:subco,org.mainco.subco:database,org.mainco.subco:mainmodule,org.mainco.subco:moduleB,org.mainco.subco:moduleD,org.mainco.subco:moduleC,\!org.mainco.subco:moduleF -DskipTests
However, something about the ā€œ!ā€ syntax is failing because I get the error
[ERROR] Could not find the selected project in the reactor: org.mainco.subco:moduleF -> [Help 1]
[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:
The error is complaining about the very module I want to exclude. What is the proper command line syntax? (Note: Iā€™m not interested in editing my parent pom.xml file, this question is strictly concerned with excluding modules via the command line).

Error [Help 1] Sakai 2.9.x installation

I follow this instructions at Sakai Development Environment Setup Walkthrough.
I used 2.9.x Sakai version.
At step 11-C :
Execute mvn -Pcafe clean install to build the minimal version (cafe)
of Sakai using maven.
I have an error :
[ERROR] Failed to execute goal on project kernel-deploy: Could not resolve depen
dencies for project org.sakaiproject:kernel-deploy:pom:2.9-SNAPSHOT: Could not f
ind artifact org.sakaiproject.entitybroker:entitybroker-assembly:zip:tomcat-over
lay:1.5.4-SNAPSHOT in sakai-maven2-snapshots (http://source.sakaiproject.org/mav
en2-snapshots) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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/DependencyReso
lutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :kernel-deploy
And I tried mvn clean install it gave me error.
Please Help to solve it .
The 'cafe' build profile of Sakai is no longer maintained. Just do a full build. When you have built everything then you can build individual modules that you modify and it will be quick.
The startup time of Sakai is now under 30 seconds so the cafe build doesn't really give much anymore (it used to when processors were slower, the build took an hour and the startup would take several minutes :)

Resources