I have tried to upgrade sonar-maven3-plugin to 5.0, when executing an analysis on the new 5.0 server. I received the following error:
[ERROR] Failed to execute goal org.codehaus.sonar:sonar-maven-plugin:5.0:sonar (default-cli) on project demo-issues: Please update sonar-maven-plugin to at least version 2.3 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.sonar:sonar-maven-plugin:5.0:sonar (default-cli) on project demo-issues: Please update sonar-maven-plugin to at least version 2.3 .
Looking at the release notes, it says: "[SONAR-5705] - Drop support of Maven 2". Not only drop, the Mojo directly throws an exception. The problem is that the old maven 3 plugin (the 5.0 version) still points to the maven2 one.
Is there any way to run an analysis with the 5.0 maven plugin?
As I explained on Which sonar-maven-plugin version to use?, the plugin you have to use is org.codehaus.mojo:sonar-maven-plugin, not the internal one(s). (So no need to try to upgrade sonar-maven3-plugin)
Your issue probably comes from the fact that the version of org.codehaus.mojo:sonar-maven-plugin has been locked down in your POM or parent POM.
Related
I'm using Jenkins ver.2.7.4.
I successfully launch sonar analyses from Jenkins by invoking top-level Maven targets sonar:sonar with SonarQube 5.1.2.
But when I upgrade SonarQube to version 6.4 I got this error when trying to launch a new build from Jenkins :
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project XXXX:
Can not execute SonarQube analysis: Plugin org.codehaus.sonar:sonar-maven3-plugin:6.4.0.25310 or one of its dependencies could not be resolved:
Failure to find org.codehaus.sonar:sonar-maven3-plugin:jar:6.4.0.25310 .......
It seems like you changed the version of the maven-plugin to 6.4. This is not correct.
The current version of the sonar scanner for maven is this:
<dependency>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.3.0.603</version>
</dependency>
It will work with recent versions of SonarQube, like SonarQube 6.4.
While trying to run the Google cloud dataflow Wordcount example in eclipse referenced here https://cloud.google.com/dataflow/docs/quickstarts/quickstart-java-eclipse
I am getting the following error:
An internal error occurred during: "Update Hierarchy".
Tried to create a TypeHierarchyPipelineOptionsHierarchy for a Java Project 'my project name' where no PipelineOptions type exists
This issue was also faced by somebody else as per the following stackoverflow link:
Eclipse: An internal error occurred during: "Update Hierarchy"
I tried the solution above, the project compiles but it does not run even after Force Update of Snapshots/Releases as explained above.
Based on my research of the problem it looks like google-cloud-dataflow-java-sdk-all-2.0.0-beta1.jar does not have the PipelineRunner class, which is causing the error. The 1.9.0 version of the same jar had those classes.
I cannot use 1.9.0 version of the jar directly because it causes other compilation errors e.g. package change to 'org.apache.beam' instead of 'com.google.cloud.dataflow'
Indeed, there's an issue in the older versions of the Google Cloud Dataflow plugin for Eclipse -- older versions are not forward-compatible with Dataflow SDKs 2.x series, but the project generation may still automatically create a project using the newest 2.x SDK.
To solve the problem, please upgrade to the newest version of the plugin.
Projects generated with versions 1.1.2 of the Dataflow Plugin for Eclipse and earlier will generate projects using the most recent archetype. With the release of Dataflow 2.0.0-beta1, the generated project will use the Apache Beam SDK as an underlying dependency. Modifying the project version to 1.9.0 or earlier will not modify the generated code, which causes the compilation failures you're experiencing.
Version 1.1.3 of the plugin will ensure that any generated project remains within the Dataflow namespace. Future versions will also work forwards-compatibly with Apache Beam. Version 1.1.3 should be available - in Eclipse, go to Help -> Check for Updates (possibly running Perform Setup Tasks to clear the cached current version) should make the updated plugin available.
We have published version 1.1.3 of the Dataflow Plugin for Eclipse; the quickstart example should now function. The project you've generated will not work until a future release of the Dataflow Plugin for Eclipse. Updating the plugin and re-running the quickstart should succeed.
We are using sonar 4.5.1 and sonar-pmd-plugin is 2.3. From last few days , I am facing issue of "too many open files " Fail to execute PMD. Following file is ignored. I found that issue is fixed in 2.4 but we cannot upgrade the plugin as it would also need upgrade to Sonar 4.5.2 version. Is there any fix or workaround for the issue ? Kindly help. We use Jenkins 1.580, Sonar 4.5.1,Maven 3.0.4.
After updating my SonarQube installation from 4.1.1 to 4.4 I always get the error
Caused by: org.sonar.api.utils.XmlParserException: java.lang.UnsupportedOperationException: Not supported since v4.2. See http://docs.codehaus.org/display/SONAR/API+Changes
at org.sonar.plugins.pmd.PmdSensor.analyse(PmdSensor.java:55)
...
when running the ant task configured as suggested in:
http://docs.sonarqube.org/display/SONAR/Analyzing+with+SonarQube+Ant+Task
and
http://docs.sonarqube.org/display/SONAR/Installing+and+Configuring+SonarQube+Ant+Task
What can I do to fix that?
This matrix should be a good reference when you do an upgrade - http://docs.sonarqube.org/display/SONAR/Plugin+version+matrix
Today I upgraded sonarqube to v 4.4 and got it fully working with this set of plugins -
SONARQUBE PLUGINS
Checkstyle 2.1
Findbugs 2.4 (recommended version is 3.0 but my source code is Java 1.6)
Java 2.4
PMD 2.2
I was facing exactly the same issue as you were, so I m hoping that this combination should work for you as well! Goodluck!
I am trying to get files annotated with lombok.jar to compile with maven 3 using one of the Java 8 early access releases. I have maven configured to use the java 8 compiler. The code that I am compiling has a dependency defined for lombok 0.12 in maven central. However when I compile with maven I get the following error:
[ERROR] symbol: variable log
[ERROR] location: class Foo
[ERROR] C:.....\Foo.java:[319,33] error: cannot find symbol
I have run maven in debug mode and the classpath entry specified states that the lombok 0.12 jar file is in the classpath of the project. Additionally, I tried setting lombok.jar specifically in my classpath (and I can see in env.CLASSPATH in maven debug mode) which creates the same results.
Everything builds and compiles just fine in eclipse -- what am I doing wrong with the maven configuration/environment such that I can't get compilation to success outside of eclipse?
To answer my own question -- the issue is with the version of lombok (0.12.0) not working well with java 8. To fix, I used the cutting edge version of lombok , installed it into my local maven repo with the line
mvn install:install-file -Dfile=lombok-edge.jar -DgroupId=org.projectlombok -DartifactId=lombok-edge -Dversion=0.12.1 -Dpackaging=jar
and then changed the dependencies in my pom accordingly.
Once I did that, I was able to compile from command line maven.