Maven sonar:sonar failing using the latest plugin version - maven

I'm trying to run Sonar from within Maven v3.3.3, using the v2.7.1 of the org.codehaus.mojo:sonar-maven-plugin, but I get this error:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project mio-tbc: org.sonar.plugins.scmstats.MavenScmConfiguration has unsatisfied dependency 'class org.apache.maven.project.MavenProject' for constructor 'public org.sonar.plugins.scmstats.MavenScmConfiguration(org.apache.maven.project.MavenProject)' from org.picocontainer.DefaultPicoContainer#e97f51c:205<[Immutable]:org.picocontainer.DefaultPicoContainer#377e90b0:211<[Immutable]:org.picocontainer.DefaultPicoContainer#64921450:36<| -> [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.
Any ideas what's wrong?
Thanks
Nick

The problem seems to come from the Scm Stats Plugin. I suggest you to remove it (it is not compatible with SonarQube 5.2).

Related

Jenkins throws an exception: build step 'invoke top-level maven targets' marked build as failure

Jenkins throws the following error:
[WARNING] The requested profile "singleflow" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project factor-esb-autotest: Fatal error compiling: invalid target release: 10 -> [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:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
build step 'invoke top-level maven targets' marked build as failure
My POM https://pastebin.com/xeb5Mpcb
At first I thought that the error was due to the fact that in the jenkins global settings the version does not match the plugin (3.8.1), I set it to "Install from Apach" 3.8.1 but it still does not work. What could be the reason ?
Maven in global setting
There must be a configuration for maven-compiler-plugin (<release>10</release>) or a property like <maven.compiler.release>10</maven.compiler.release>
The commented upgrade of JUnit is unrelated to the problem.
Apart from that such information that you have update pom should be part of the question up-front

Build Failed in Azure devops

I'm beginner for this in azure devops.
I'm trying to build with maven, but I got the following error that I don't understand :
[ERROR] Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.7:instrument (package-9af52907-6506-4b87-b16a-9883edee41bc) on project gs-spring-boot: Execution package-9af52907-6506-4b87-b16a-9883edee41bc of goal org.codehaus.mojo:cobertura-maven-plugin:2.7:instrument failed: Plugin org.codehaus.mojo:cobertura-maven-plugin:2.7 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:0 at specified path /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/../lib/tools.jar -> [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:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
You are missing tools.jar in your JDK/JRE. Make sure your JDK version on Azure Pipeline. It seems Cobertura doesn't support Java 1.8 and later:
https://github.com/mojohaus/cobertura-maven-plugin/issues/30
https://github.com/mojohaus/cobertura-maven-plugin/issues/21
So, switch to JaCoCo.

Why does executing "mvn clean package" to build Spark fail with "Some Enforcer rules have failed"?

I'm getting build error when trying to build a clean version of latest Spark. I did the following
1) git clone https://github.com/apache/spark.git
2) build mvn -DskipTests clean package
But I get the following error:
Spark Project Parent POM .......................... FAILURE [2.338s]
...
BUILD FAILURE ...
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-enforcer-plugin:1.4:enforce
(enforce-versions) on project spark-parent_2.10: Some Enforcer rules
have failed. Look above for specific messages explaining why the rule
failed. -> [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:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I'm running Lubuntu 14.04 with the following:
java version "1.7.0_91"
OpenJDK Runtime Environment (IcedTea 2.6.3) (7u91-2.6.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)
Apache Maven 3.0.5
Updating Maven version to 3.3.9 solved the issue

Maven says archetype does not exist

I am trying to create a JPA based project using Maven and eclipse. I tried using the jpa-maven-archetype from create new maven project in the eclipse project creation, but it shot back this error
Could not resolve archetype com.rfc.maven.archetypes:jpa-maven-archetype:RELEASE from any of the configured repositories.
Could not resolve artifact com.rfc.maven.archetypes:jpa-maven-archetype:pom:RELEASE
Failed to resolve version for com.rfc.maven.archetypes:jpa-maven-archetype:pom:RELEASE: Could not find metadata com.rfc.maven.archetypes:jpa-maven-archetype/maven-metadata.xml in local (/home/sebastian/.m2/repository)
Failed to resolve version for com.rfc.maven.archetypes:jpa-maven-archetype:pom:RELEASE: Could not find metadata com.rfc.maven.archetypes:jpa-maven-archetype/maven-metadata.xml in local (/home/sebastian/.m2/repository)
Basically the eclipse plugin is looking into my local repositories instead of remote ones. So I tried going the command line and explicitly specifying the remote repository with the following command
mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create \
-DgroupId=com.something -DartifactId=jpaexample \
-DarchetypeArtifactId=jpa-maven-archetype \
-DarchetypeVersion=RELEASE \
-DremoteRepositories=http://maven.rodcoffin.com/repo \
-DinteractiveMode=false
And I got this error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create (default-cli) on project standalone-pom: Error creating from archetype: Error attempting to download archetype. Error downloading. Failed to resolve version for org.apache.maven.archetypes:jpa-maven-archetype:jar:RELEASE: Could not find metadata org.apache.maven.archetypes:jpa-maven-archetype/maven-metadata.xml in local (/home/sebastian/.m2/repository)
[ERROR] org.apache.maven.archetypes:jpa-maven-archetype:jar:RELEASE
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] id0 (http://maven.rodcoffin.com/repo, releases=true, snapshots=true)
[ERROR] -> [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:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
It seems that repo maven.rodcoffin.com/repo is not working, or there is something wrong with my maven setup. I am not sure which one, if some one could give me pointers on where to search for, that would be helpful.
Also if repo maven.rodcoffin.com/repo is not working. What are my other options to create a JPA archetype project. Do I have to make a simple maven project and then convert it to a JPA as shown here.
EDIT: I just weaseled out of the problem by creating a maven quick type achetype and then using the persistence.xml for my project.
So just ignore this question.

maven project running problem

How To resulve this problem
i have update my java version to java6u23 but it will still create problem so what should i do
i dont know much more about maven
[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/MultipleArtifactsNotFoundException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :mediaPlayer
You appear to be missing a dependency for jna-3.2.4
This isn't available on the central maven repo http://repo1.maven.org/maven2/net/java/dev/jna/jna/
But you can find it in the java.net repo http://download.java.net/maven/2/net/java/dev/jna/jna/3.2.4/
Make sure that you have the java.net repo defined to your maven build.
This can be done iether in your pom, or in the settings.xml in your user home/.m2 directory.

Resources