Sonar-qube 4.5 Timeout issue with big project - jenkins

I'm using Jenkins to run sonar on all my projects. One of them have over 2 millions line of code and started to produce a timeout error when connecting to sonar (posted bellow is the jenkins build log):
[JENKINS] Archiving /app/users/jenkins/jobs/*****RunSonar/workspace/******/pom.xml to com.****.***.****/****Gui/9.1.0/****Gui-9.1.0.pom
[JENKINS] Archiving /app/users/jenkins/jobs/****_****Gui_RunSonar/workspace/****Gui/target/****Gui.war to com.****.***.****/****Gui/9.1.0/****Gui-9.1.0.war
channel stopped
[workspace] $ /app/tools/apache-maven-3.2.1/bin/mvn -f /app/users/jenkins/jobs/****_****Gui_RunSonar/workspace/****Gui/pom.xml -Dgitbranch=my_development -e -B sonar:sonar -Dsonar.preview.readTimeout=90000 -Dsonar.jdbc.driver=oracle.jdbc.driver.OracleDriver -Dsonar.jdbc.url=jdbc:oracle:thin:#mydb:1521:orcl ******** ******** -Dsonar.host.url=https://********/sonar/ -Dsonar.branch=$gitbranch ******** ********
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.****.***.****:****Gui:war:9.1.0
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-war-plugin is missing. # line 408, column 23
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ****Gui 9.1.0
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact aspectj:aspectjrt:jar:1.5.4 has been relocated to org.aspectj:aspectjrt:jar:1.5.4
[WARNING] The artifact aspectj:aspectjweaver:jar:1.5.4 has been relocated to org.aspectj:aspectjweaver:jar:1.5.4
[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2
[INFO]
[INFO] --- sonar-maven-plugin:2.5:sonar (default-cli) # ****Gui ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.033 s
[INFO] Finished at: 2015-01-14T10:31:44+00:00
[INFO] Final Memory: 12M/148M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar (default-cli) on project ****Gui: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar failed: SonarQube server can not be reached at https://********/sonar. Please check the parameter 'sonar.host.url'. connect timed out -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar (default-cli) on project *******: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar failed: SonarQube server can not be reached at https://********/sonar. Please check the parameter 'sonar.host.url'.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
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:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
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:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
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.PluginExecutionException: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.5:sonar failed: SonarQube server can not be reached at https://*********/sonar. Please check the parameter 'sonar.host.url'.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:144)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.lang.IllegalStateException: SonarQube server can not be reached at https://********/sonar. Please check the parameter 'sonar.host.url'.
at org.codehaus.mojo.sonar.ServerMetadata.getVersion(ServerMetadata.java:70)
at org.codehaus.mojo.sonar.ServerMetadata.logSettings(ServerMetadata.java:84)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
... 20 more
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:618)
at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
at org.codehaus.mojo.sonar.ServerMetadata.getConnection(ServerMetadata.java:119)
at org.codehaus.mojo.sonar.ServerMetadata.remoteContent(ServerMetadata.java:91)
at org.codehaus.mojo.sonar.ServerMetadata.getVersion(ServerMetadata.java:66)
... 23 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/PluginExecutionException
Sonar analysis completed: FAILURE
I'm pretty sure the sonar.host.url is correct because all of my other jobs in jenkins that run sonar are working. I already tried to use the "sonar.preview.readTimeout" property but with no success. Sonar produces no log.
Does anyone have any idea how to run sonar to avoid this problem?
Best regards

Have you tried with localhost instead and see if its able to connect to localhost at the very least? For localhost you need to have sonar server running locally of course.

Related

OOM when building quarkus native application

Not sure what am I missing? After reading multiple blogs and StackOverflow questions, I tried increasing the memory to Xmx12G but with no success. I keep getting msg to increase memory.
Has anyone faced the issue in the recent past and is it been solved?
This is just the plain application downloaded directly from the quarkus website.
docker run --env LANG=C --rm -v qaurkus-test/target/qaurkus-test-1.0.0-SNAPSHOT-native-image-source-jar:/project:z --name build-native-bkbGA quay.io/quarkus/ubi-quarkus-native-image:21.2-java11 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Duser.country=US -J-Dfile.encoding=UTF-8 -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime -H:+JNI -H:+AllowFoldMethods -jar qaurkus-test-1.0.0-SNAPSHOT-runner.jar -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -J-Xmx12G -H:-AddAllCharsets -H:EnableURLProtocols=http -H:-UseServiceLoaderFeature -H:+StackTrace -H:-ParseOnce qaurkus-test-1.0.0-SNAPSHOT-runner
[qaurkus-test-1.0.0-SNAPSHOT-runner:25] classlist: 6,968.00 ms, 0.94 GB
[qaurkus-test-1.0.0-SNAPSHOT-runner:25] (cap): 534.58 ms, 0.94 GB
[qaurkus-test-1.0.0-SNAPSHOT-runner:25] setup: 2,329.28 ms, 0.94 GB
The bundle named: messages, has not been found. If the bundle is part of a module, verify the bundle name is a fully qualified class name. Otherwise verify the bundle path is accessible in the classpath.
19:29:29,666 INFO [org.jbo.threads] JBoss Threads version 3.4.2.Final
Error: Image build request failed with exit status 137
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 43.324 s
[INFO] Finished at: 2021-09-01T00:59:39+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.2.1.Final:build (default) on project qaurkus-test: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR] [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:235)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:820)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR] at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
[ERROR] at java.base/java.lang.Thread.run(Thread.java:829)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] Caused by: java.lang.RuntimeException: Image generation failed. Exit code was 137 which indicates an out of memory error. Consider increasing the Xmx value for native image generation by setting the "quarkus.native.native-image-xmx" property
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:372)
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:205)
[ERROR] ... 11 more
[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
Finally, got it working.
check how much memory docker is allocated using docker stats command
Follow the process mentioned in the post and increase it to atleast 8G, in my case max memory consumed was around 7G

SonarQube server [https://localhost:9000] can not be reached in Jenkins

I want to build a code coverage from sonarqube in Jenkins. The project is from github. I have configure everything that are necessary but the following errors still arise. Can someone please help me to solve this?
Established TCP socket on 59508
[OData] $ java -cp "D:\Program Files\plugins\maven-plugin\WEB-INF\lib\maven35-agent-1.12-alpha-1.jar;D:\downloads\apache-maven-3.5.4\boot\plexus-classworlds-2.5.2.jar;D:\downloads\apache-maven-3.5.4/conf/logging" jenkins.maven3.agent.Maven35Main D:\downloads\apache-maven-3.5.4 "D:\Program Files\war\WEB-INF\lib\remoting-3.21.1.jar" "D:\Program Files\plugins\maven-plugin\WEB-INF\lib\maven35-interceptor-1.12-alpha-1.jar" "D:\Program Files\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.12-alpha-1.jar" 59508
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f D:\Program Files\workspace\OData\pom.xml clean sonar:sonar
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------------< OData:OData >-----------------------------
[INFO] Building OData 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # OData ---
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.MavenArtifactArchiver$2; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.MavenFingerprinter$1; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[INFO]
[INFO] ----------------------------< OData:OData >-----------------------------
[INFO] Building OData 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:3.4.1.1168:sonar (default-cli) # OData ---
[INFO] User cache: C:\WINDOWS\system32\config\systemprofile\.sonar\cache
[ERROR] SonarQube server [https://localhost:9000] can not be reached
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.056 s
[INFO] Finished at: 2018-08-27T00:09:08+08:00
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.1.1168:sonar (default-cli) on project OData: Unable to execute SonarQube: Fail to get bootstrap index from server: Unrecognized SSL message, plaintext connection? -> [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]
[JENKINS] Archiving D:\Program Files\workspace\OData\pom.xml to OData/OData/0.0.1-SNAPSHOT/OData-0.0.1-SNAPSHOT.pom
[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
channel stopped
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succedeed?
Skipping sonar analysis due to bad build status FAILURE
Finished: FAILURE
for your OData project, when your way to scan the code is via jenkins, you have to set in the settings of jenkins with the hostname, donĀ“t recommend put "localhost" or "127.0.0.1"
Try with $HOSTNAME:
Go to Settings in Jenkins
Move to "Sonarqube Servers"
SonarQube servers
-- Sonarqube instalations
--- ie: http://myserversonarqube:9000
Regards.
Error below is self explanatory. I have below questions
Is Sonarqube running on localhost with port 9000 as Secured (i.e https) ?
Which version of maven you are using? sometimes some of the Sonar plugin versions does not work with old maven versions.
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-
plugin:3.4.1.1168:sonar (default-cli) on project OData: Unable to execute SonarQube:
Fail to get bootstrap index from server: Unrecognized SSL message, plaintext connection? -> [Help 1]
[ERROR]

Spring Security SAML build from source compilation error, dependency set to test not compile

I was trying to build 1.0.1.RELEASE from the source (grabbed the zip from github). I was experiencing the below errors. To get the build to succeed, I edited the dependencies and set commons-logging dependency from test to compile, so Log could be found by the compiler. Since this was a release tag, I'm wondering if there was actually an issue that is actually on my end for building it from the exact pom.xml which came from the tag.
Build log excerpt:
[INFO] Compiling 98 source files to /Users/jsimon/Documents/opensources/spring-security-saml-1.0.1.RELEASE/core/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/jsimon/Documents/opensources/spring-security-saml-1.0.1.RELEASE/core/src/main/java/org/springframework/security/saml/SAMLLogoutProcessingFilter.java:[135,22] error: cannot access Log
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.223s
[INFO] Finished at: Thu Jul 30 10:32:51 EDT 2015
[INFO] Final Memory: 13M/310M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project spring-security-saml2-core: Compilation failure
[ERROR] /Users/jsimon/Documents/opensources/spring-security-saml-1.0.1.RELEASE/core/src/main/java/org/springframework/security/saml/SAMLLogoutProcessingFilter.java:[135,22] error: cannot access Log
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project spring-security-saml2-core: Compilation failure
/Users/jsimon/Documents/opensources/spring-security-saml-1.0.1.RELEASE/core/src/main/java/org/springframework/security/saml/SAMLLogoutProcessingFilter.java:[135,22] error: cannot access Log
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
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:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
/Users/jsimon/Documents/opensources/spring-security-saml-1.0.1.RELEASE/core/src/main/java/org/springframework/security/saml/SAMLLogoutProcessingFilter.java:[135,22] error: cannot access Log
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:656)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
[ERROR]
[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
dependency snippet:
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
<scope>compile</scope>
</dependency
I had the same problem too and changed the scope of "commons-logging" dependency from test to compile and the problem resolved.
So it seems it is not an issue on your end but on the pom file.
The correct way to build is with gradle, it seems like you are using Maven? Run git clone git#github.com:spring-projects/spring-security-saml.git, git checkout tags/rb.1.0.1.RELEASE and gradlew build. This runs well on both continuous integration server and my machine.

Issue running cobertura with sonar

While running cobertura with sonar (plugins installed in jenkins), i get the below error. The snippet in pom, error and other details are below. Can anyone please help on ? Thanks in advance.
Maven version is 3.0.4.
After googling around got the solution to add the dependency in pom . Still it did not work
The goal used is clean install -U cobertura:cobertura sonar:sonar
java.lang.TypeNotPresentException: Type org.codehaus.mojo.cobertura.CoberturaReportMojo not present
at org.eclipse.sisu.space.URLClassSpace.loadClass(URLClassSpace.java:115)
at org.eclipse.sisu.space.NamedClass.load(NamedClass.java:46)
at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:55)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at org.eclipse.sisu.plexus.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:133)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:47)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:997)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1047)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:993)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:82)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:260)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:252)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:459)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:97)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
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:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
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: java.lang.NoClassDefFoundError: org/apache/maven/reporting/AbstractMavenReport
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:389)
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
at org.eclipse.sisu.space.URLClassSpace.loadClass(URLClassSpace.java:107)
... 41 more
Caused by: java.lang.ClassNotFoundException: org.apache.maven.reporting.AbstractMavenReport
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
... 56 more
[INFO]
[INFO] --------------------------------------------------------------------- ---
[INFO] Skipping - List item
IndexWeb
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] IndexWeb .................................... FAILURE [1.325s]
[INFO] IndexWeb-webservices ........................ SKIPPED
[INFO] IndexWeb-service ............................ SKIPPED
[INFO] IndexWeb-web ................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.758s
[INFO] Finished at: Fri Jun 19 06:39:11 UTC 2015
[INFO] Final Memory: 12M/111M
[INFO] ------------------------------------------------------------------------
**[ERROR] Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.6:cobertura (default-cli) on project IndexWeb: Execution default-cli of goal org.codehaus.mojo:cobertura-maven-plugin:2.6:cobertura failed: Unable to load the mojo 'cobertura' in the plugin 'org.codehaus.mojo:cobertura-maven-plugin:2.6'. A required class is missing: org/apache/maven/reporting/AbstractMavenReport**
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.codehaus.mojo:cobertura-maven-plugin:2.6
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/jboss/.m2/repository/org/codehaus/mojo/cobertura-maven-plugin/2.6/cobertura-maven-plugin-2.6.jar
[ERROR] urls[1] = file:/home/jboss/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.apache.maven.reporting.AbstractMavenReport
[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/PluginContainerException
Build step 'Invoke top-level Maven targets' marked build as failure
Archiving artifacts
Skipping sonar analysis due to bad build status FAILURE
<-- The snippet of pom below -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.6</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-api</artifactId>
<version>2.0.9</version>
</dependency>
</dependencies>
</plugin>
It looks like, some tests are taking some time / hung for a while. It's a random failure.
In case you wanna proceed with the sonar analysis use this option
-Dmaven.test.failure.ignore=true
This should ignore the failures and show you the results. Let me tell you in advance, that this is gonna help only for the seeing the analysis for the passed tests.
Just a thing, I had the same problem earlier. We found out that, it was something to do with the redis caching. We fixed it and it worked like a charm, then we removed the option which I've mentioned above.

I am unable to bulid Maven Project

Please I am very new when comes to maven project and wildfly (JBoss) Server. I have a Java EE 7 project which I developed with NetBeans for Apache Tomcat 8. For some good reason I want to migrate to WildFly 8.
I have recreated the project on JBoss Studio 7.1 with all the Maven Dependencies. First attempt to run the project returns "Forbidden".
I tried to be sure the project is complied and deployed by running
mvn clean package
Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ProjectName 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # ProjectName ---
[INFO] Deleting /path/to/the/ProjectName/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # ProjectName ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # ProjectName ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 74 source files to /path/to/the/ProjectName/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.062 s
[INFO] Finished at: 2014-11-18T10:58:47+01:00
[INFO] Final Memory: 8M/150M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project ProjectName: Compilation failure -> [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/MojoFailureException
I re-run the command with -e
------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project nants: Compilation failure -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project nants: Compilation failure
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:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
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:483)
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.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:862)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
[ERROR]
These tips contains my environment
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T21:58:10+01:00)
Maven home: /path/to/maven
Java version: 1.8.0_20, vendor: Oracle Corporation
Java home: /usr/lib/jvm/oracle_jdk_8/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.16.0-24-generic", arch: "amd64", family: "unix"
I read the suggested wiki but could't solve the issue still. Maybe because I am still new.Please I will appreciate your help on resolving this errors.
You are using Java 8, please try on Java 7 as some components may not support Java 8.
Similar problem is described here: maven-compilation-fails-without-explaining-why
I finally found what problem for failed compilation was, I have fixed that by correcting my POM.xml there was an error on my JAVA_HOME settings. though I am still getting "Forbidden" from the url which will need a different question thread if I am unable to resolve it.
<maven.compiler.executable>/absolute/path/to/bin/javac</maven.compiler.executable>
TO:
<maven.compiler.executable>${JAVA_HOME}/bin/javac</maven.compiler.executable>

Resources