Want to exclude sonar plugin for specific project in bamboo build - maven

I am supporting many teams for bamboo build including sonar. One of my team using CXX plugin .
Now we are facing issue after installing the plugin. Because many other team still depends on JDK 8 and CXX will support JDK 11. Is there any way to exclude CXX plugin for specific project or build ?
I tried -Dsonar.exclusions=/.h,/.c,**/.hh,/.hpp,/*.cc,.cxx,.cpp,.hxx but not success.
Error :
Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project ABC: The plugin [cxx] does not support Java 1.8.0_312: org/sonar/plugins/cxx/CxxPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 → [Help 1]

Related

SonarQube 5.6 with Java Project (JDK 1.6)

I want to configure SonarQube for my maven project which is on jdk 1.6.
Can I use the latest SonarQube 5.6. It say code should be complied with jdk 1.8 only.
Is it possible to analyse code with older version of JDK with SonarQube on latest vesrion of JDK?
My project is compiled on jdk1.6. Do I need to use scanner which supports jdk1.6 because if I uses sonar-maven-plugin - 3.1.1 it gives error :
Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.1.1:sonar (default-cli) on project StreamDiffCLI: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.1.1:sonar failed: Unable to load the mojo 'sonar' in the plugin 'org.sonarsource.scanner.maven:sonar-maven-plugin:3.1.1' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/sonarsource/scanner/maven/SonarQubeMojo : Unsupported major.minor version 52.0
I believe you're misreading the docs. You can compile your project with whatever version of Java you like. 1.4 even. But you must analyze with 8.
If you are installing Sonar-Cube with latest version with JDK 1.8 but your project is compatible to JDK 1.6 the use :
if project are supporting JDK 1.6, please use “sonar.java.source=1.6” in your configuration file to avoid rules applicable for JDK>1.6
e.g in build.xml (ANT)

Error in building WSO2 Platform 4.1.7

I successfully built WSO2 Orbit & Kernel 4.2.0 under JDK 1.6.x and Maven 3.0.5. But when I tried to build WSO2 Platform 4.1.7 it shows
`Non-resolvable parent POM for org.wso2.carbon:integration:4.1.0:`
So tried building each sub folder from platform in the order.
parent, dependencies, service-stubs, components, features.
All got built successfully but
samples/shopping-cart & samples/shopping-cart-global/2.0.0 threw errors.
So I skipped this and went to build the patches. but the very first patch 4.1.1 throws error
WSO2 Platform Automated Suite - Distribution ...... FAILURE [40.549s]
[INFO] WSO2 Carbon - Patch releases - Platform Automated Test Suite SKIPPED
[ERROR] Failed to execute goal on project wso2pats: Could not resolve dependencies for project org.wso2.carbon.automation:wso2pats:jar:1.1.1:
The following artifacts could not be resolved: org.wso2.carbon.automation:org.wso2.carbon.automation.test.repo:jar:1.1.0, org.wso2.am:org.wso2.carbon.am.test:jar:tests:1.4.0:
Could not find artifact org.wso2.carbon.automation:org.wso2.carbon.automation.test.repo:jar:1.1.0 in wso2-nexus (http://maven.wso2.org/nexus/content/groups/wso2-public/) -> [Help 1]

SBT dependency on non-SBT library

My Play/SBT project needs to depend on a third-party Java library that is distributed in source form and can be built with either Ant or Maven. Its root directory contains pom.xml and build.xml.
I am thinking of having this library added as a git submodule and have SBT build it as a subproject. I tried adding
externalPom(baseDirectory(_ / "pathToLibrary" / "pom.xml"))
to my build settings, but I ended up with the following compiler error:
[info] Compiling 32 Scala sources and 5 Java sources to /home/thesamet/project]
[error] (compile:compile) scala.reflect.internal.MissingRequirementError: object scala.runtime in compiler mirror not found.
[error] Total time: 1 s, completed Aug 23, 2013 11:46:20 AM
An external pom can only be used to obtain library dependencies of the maven project but not compile it.
You can add an sbt build configuration for the external project or easier, you can publish the third-party module to a corporate Maven or Ivy repository or just local with mvn install and add ~/.m2 as file resolver to your SBT project.

Maven java compile error can not access CommonClassA

Background:
I am developing Maven multi module project.
One of the module is common module needed by other all modules.
This module contain CommonClassA.java.
common module is properly compiled.
It is installed into maven local repository properly.
One of the class(Billtype.java) in other module (EmployeeBilling) refers this class(CommonClassA.java).
Maven Dependency for common module is properly specified in pom.xml of EmployeeBilling module.
Problem:
While compiling EmployeeBilling module it throws
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project EmployeeBilling: Compilation failure
[ERROR] \MyWorkspace\Biz\EmployeeBilling\src\main\java\com\employee\Billtype.java:[79,19] error: cannot access CommonClassA
[ERROR] -> [Help 1]**
Supporting details:
dependency defined in EmployeeBilling> pom.xml:
Other classes from common module seems accessible as no error observed
There are no other errors like Class not found/file not found.
The class CommonCLassA implements Serializable
Same error occurs from Eclipse as well as commond line
I am using M2E plugin
Tools:
jdk1.7.0_02
OS: Windows 7
Eclipse JUNO and apache-maven-3.1.0
Thanks in advance!
If project builds properly using eclipse compiler then it should work with Maven.
Few things to check if its not working with maven:
Manually check in repository that jar is installed properly and it contains your class file.
Try to build project using locally installed Maven instead of maven in eclipse.
Set -DskipTest=true while installing your jar, as it can cause issues at times.
If these steps don't work then show us your pom.
With no more information it's hard to find the cause. But I also had this problems now and then, and there are some things which could go wrong:
Are you using the right JAVA version (everywhere) ?
... and the right java PROVIDER? (Oracle, IBM, OpenJDK) In my case it's often this issue, I'm sometimes bound to IBM JDK, although I try to use Oracle where I can and this sometimes breaks my build.
Is the right maven dependency VERSION used? If you depend on it multiple times, and all in the same (lower than root) dept of dependencies, Maven will just "choose" a version. It could be that thát version is incompatible with your code of thát particular dependency
Skipping tests sometimes WORKS! It has something to do with maven phases and getting stuff ready for using it elsewhere.
Good luck :)
I had the same problem. Even the jar dependency has the required class files. Finally I deleted the local maven repo and restarted the build. Now it worked without any issue.
It looks like you are using an old version of maven-compiler-plugin (v2.3.2).
I suggest you upgrade it to 3.x. it won't magically fix your issue but it will definitely give you better / more detailed error message.

Hudson build error: LifecycleExecutionException Unable to locate the Javac Compiler in

I created a dynamic web project in eclipse for a web service with axis2. I then converted it into Maven project, I'm able to compile and generate war file in eclipse, but when i deploy it on server and try to build it with Hudson-3.0.0 it gives me following error:
mojoFailed org.apache.maven.plugins:maven-compiler-plugin:2.3.2(default-compile)
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project WebServices: Compilation failure
Unable to locate the Javac Compiler in:
C:\Program Files (x86)\Java\jre6..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
Please Let me know what's wrong with it!
I have exactly the same problem, ever since I upgraded Hudson from 2.2.1 to 3.0.1.
Both JAVA_HOME environment variable and JDK in hudson configuration point to JDK and not to JRE.
If I run mvn compile in the workspace directory of the job, everything works well.
Looks like the hudson cannot find java_home.
In hudson settings java.home property is set correctly ?
Does any other java projects builds successfully ?
Did you do what the exception said yet?
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
Sounds like you don't have Java installed. So install it.

Resources