I'm using Sonarqube 8.9 LTS with SonarScanner for Maven.
When we run any scan with SonarScanner for Maven, the normal output is:
[INFO] CPD Executor CPD calculation finished (done) | time=3287ms
[INFO] Analysis report generated in 2397ms, dir size=64 MB
[INFO] Analysis report compressed in 25206ms, zip size=24 MB
[INFO] Analysis report uploaded in 1866ms
[INFO] ANALYSIS SUCCESSFUL, you can browse http://127.0.0.1:9000/dashboard?id=project_id
[INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
[INFO] More about the report processing at http://127.0.0.1:9000/api/ce/task?id=task_id
[INFO] Analysis total time: 18:30.103 s
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19:37 min
[INFO] Finished at: 2021-10-22T02:23:22Z
[INFO] ------------------------------------------------------------------------
Where do i find this information after the scan is completed?
I can't find it in the web ui or the rest api.
This information is not stored on the server.
I did ask the same question on sonar community and got the following response:
You won’t find this stored on the server; it’s not sent to the server
and is only available where you see it: in the client-side analysis
logs.
If you are
Global Administrators can view the status of Background task at Administration > Projects > Background Tasks.
Project administrators can see the tasks for a project at Project Settings > Background Tasks
More details in here Background Tasks
Related
Willing to use the gradle-enterprise-maven-extension
to migrate a project from maven to gradle,
I cloned the maven-build-scan-quickstart provided by the gradle team.
But runing mvn install, as specified, after acceptation of gradle terms of service,
I receive the following message:
UnknownHostException: scans-in.gradle.com
I tried to configure the proxy in several manners:
Using commannd line option:
mvn install -Dhttps.proxyHost=localhost:8888 -Dhttps.proxyPort=localhost:8888
Using a gradle.properties file in a directory at %GRADLE_USER_HOME% directory location:
(proxy is also configured in maven's settings.xml and need no password it works fine when using maven in standard ways)
gradle.properties :
systemProp.http.proxyHost=localhost
systemProp.http.proxyPort=8888
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost|127.0.0.1
systemProp.https.proxyHost=localhost
systemProp.https.proxyPort=8888
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost|127.0.0.1
But I still receive the same message:
~/github/maven-build-scan-quickstart
$ mvn install
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.830 s
[INFO] Finished at: 2019-12-31T13:09:19+01:00
[INFO] ------------------------------------------------------------------------
[INFO] 7 goals, 7 executed
Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Service defined at https://gradle.com/terms-of-service. Do you accept these terms? (yes/no): yes
[INFO] Gradle Terms of Service accepted.
[INFO]
[INFO] Publishing build scan...
[INFO]
[INFO] A network error occurred.
[INFO]
[INFO] The hostname 'scans-in.gradle.com' could not be resolved.
[INFO] You may be disconnected from the Internet.
[INFO]
[INFO] If you require assistance with this problem, please report it via https://gradle.com/help/plugin and include the following information via copy/paste.
[INFO]
[INFO] ----------
[INFO] Maven version: 3.6.2
[INFO] Extension version: 1.3.3
[INFO] Request URL: https://scans-in.gradle.com/in/maven/3.6.2/1.3.3
[INFO] Request ID: 1234567e-abcd-23de-c2d3-3fbbccd14a32
[INFO] Exception: java.net.UnknownHostException: scans-in.gradle.com
[INFO] ----------
[INFO]
I have a Jenkins (Maven) job that builds and deploys a web service to a Tomcat 8 server.
If the deployment to the Tomcat fails the Jenkins job still finishes with success.
[INFO] tomcatManager status code:200, ReasonPhrase:OK
[INFO] FAIL - Deployed application at context path /dims but context failed to start
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.625s
[INFO] Finished at: Tue Oct 25 12:14:21 CEST 2016
[INFO] Final Memory: 17M/40M
[INFO] ------------------------------------------------------------------------
Finished: SUCCESS
Is there a way to make the Jenkins job fail if the deployment fails?
if you use jenkins i advise you to use jenkins deploy plugin
https://wiki.jenkins-ci.org/display/JENKINS/Deploy+Plugin
I think this is a bug in the tomcat maven plugin.
I had the same problem and use Jenkins plugin called Jenkins Text Finder. I added a post-build action called "Jenkins Text Finder" to the end of my Jenkins job. I leave the "Files" input box empty, but check the "Also search the console output" checkbox. In the regular expression inputbox I put "but context failed to start". The other two checkboxes remain unchecked.
This leads to the following output
[INFO] tomcatManager status code:200, ReasonPhrase:OK
[INFO] FAIL - Deployed application at context path / but context failed to start
[INFO] ----------------
[INFO] BUILD SUCCESS
[INFO] ----------------
[INFO] Total time: 01:23 min
[INFO] Finished at: 2016-12-29T21:15:41+01:00
[INFO] Final Memory: 117M/472M
[JENKINS] Archiving /var/lib/jenkins/workspace/jenkins-test/core/pom.xml to cz.semanta/xf3/r8_2/xf3-r8_2.pom
[INFO] ---------------------
channel stopped
Checking console output
/var/lib/jenkins/jobs/jenkins-test/builds/6/log:
[INFO] FAIL - Deployed application at context path / but context failed to start
Build step 'Jenkins Text Finder' changed build result to FAILURE
An attempt to send an e-mail to empty list of recipients, ignored.
Finished: FAILURE
which is good enough for me.
I have a Maven 3.x build that uses Sonar 2.1.x for quality control. The maven-sonar plugin is used from inside Jenkins to run the Sonar checks.
During the Jenkins build, when Sonar kicks in, it logs A LOT of not so useful information at INFO level:
[INFO] [15:29:14.195] Java version: 1.6
[INFO] [15:29:20.853] Execute PMD 4.3 done: 6658 ms
[INFO] [15:29:20.853] Sensor PmdSensor done: 6658 ms
[INFO] [15:29:20.854] Sensor ProfileSensor...
[INFO] [15:29:21.186] Sensor ProfileSensor done: 332 ms
[INFO] [15:29:21.187] Sensor ProfileEventsSensor...
[INFO] [15:29:21.190] Sensor ProfileEventsSensor done: 3 ms
[INFO] [15:29:21.190] Sensor ProjectLinksSensor...
[INFO] [15:29:21.192] Sensor ProjectLinksSensor done: 2 ms
[INFO] [15:29:21.192] Sensor VersionEventsSensor...
[INFO] [15:29:21.198] Sensor VersionEventsSensor done: 6 ms
[INFO] [15:29:21.198] Sensor Maven dependencies...
[INFO] [15:29:21.261] Sensor Maven dependencies done: 63 ms
...
The log is quite big. I have been trying to find a way to set the log level to WARN with no luck. Any idea?
Thanks!
Unfortunately, there's no way to mute this INFO-level log.
As discussed here log level can be changed at the maven plugin level.
Run mvn with -Dorg.slf4j.simpleLogger.showLogName=true it will show the logger name with log like below
2022-11-09T05:47:18.8604059Z [INFO] org.sonarsource.scanner.maven.SonarQubeMojo - SCM writing changed lines (done) | time=83ms
2022-11-09T05:47:18.8604819Z [INFO] org.sonarsource.scanner.maven.SonarQubeMojo - Analysis report generated in 287ms, dir size=5.2 MB
2022-11-09T05:47:18.8605606Z [INFO] org.sonarsource.scanner.maven.SonarQubeMojo - Analysis report compressed in 1993ms, zip size=4.1 MB
2022-11-09T05:47:18.8606333Z [INFO] org.sonarsource.scanner.maven.SonarQubeMojo - Analysis report uploaded in 282ms
then on executing mvn with -Dorg.slf4j.simpleLogger.log.org.sonarsource.scanner.maven.SonarQubeMojo=error it will change the log level.
I am trying to build a robotium apk file that can execute test cases automatically from jenkins and receive the following error:
[INFO] Run started: se.stuff.android.app.test, 7 tests:
[INFO] Start: se.stuff.android.test.app.APP_Test#test_A_check_app
[INFO] End: se.stuff.android.test.app.APP_Test#test_A_check_app
[INFO] Start: se.stuff.android.test.app.APP_Test#test_B_bad_credentials
[INFO] End: se.stuff.android.test.app.APP_Test#test_B_bad_credentials
[INFO] Start: se.stuff.android.test.app.APP_Test#test_C_Log_in
[INFO] ERROR:se.stuff.android.test.app.APP_Test#test_C_Log_in
[INFO] Test failed to run to completion. Reason: 'Instrumentation run failed due to 'java.lang.ClassNotFoundException''. Check device logcat for details
[INFO] End: se.stuff.android.test.app.APP_Test#test_C_Log_in
[INFO] Run failed: Instrumentation run failed due to 'java.lang.ClassNotFoundException'
[INFO] Run ended: 0 ms
[ERROR] FAILURES!!!
[INFO] Tests run: 3 (of 7), Failures: 0, Errors: 1
[INFO] Report file written to /var/lib/hudson/jobs/App_Android_Test/workspace/APP_Test/target/surefire-reports/TEST-localhost_49851_unknown_sdk.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
I checked the emulator and seem to be missing the InstrumentationTesRunner. What I have heard is that instrumentation classes are excluded when an application is built for release. My question is therefore, how do I create a debuggable build in jenkins using a pom.xml file and building with maven?
The two first test cases can actually pass with nothing happening since it's supposed to check that everything is ok before start. If it doesn't find potential issues will the test execution just continue.
I have a multi-module project where the top level project serves both as the parent of the individual modules and as the project that declares the modules. Only this top level project is configured in Hudson (including automatic SVN checkout). The simplified layout is as follows:
ProjectRoot\
|
+---kernel\
| |
| +---pom.xml [ArtifactId=MyProject_kernel parent=MyProject]
|
+---model_foo\
| |
| +---pom.xml [ArtifactId=MyProject_model_foo, parent=MyProject]
|
+---pom.xml [ArtifactId=MyProject, parent=none]
Also, model_foo has a dependency on kernel.
Now, Hudson automatically discovers the kernel and model_foo sub projects, and it usually manages to build everything just fine.
However, each time I make a breaking change, such as create a new class in kernel and use it inside model_foo, I get a failing build for model_foo, followed by one that succeeds. The mail notifications are titled
Build failed in Hudson: MyProject » MyProject Model Foo #1545
Hudson build is back to normal : MyProject » MyProject Model Foo #1546
Why is that? I suspect it might have to do with the fact that the MyProject pom.xml is both the multi-module project and the parent of its modules, but before changing that I would like to know whether it's actually going to help.
I use Hudson 2.1.0.
Update
This is the log of a failed build of the web module (equals model_foo in the diagram above). The build for the MyProject root project had the same build number, and succeeded.
I stripped out the actual compiler errors, which are exactly the same as if the newly introduced class was missing.
Started by upstream project "MyProject" build number 1545
Found mavenVersion 2.0.9 from file jar:file:/home/builder/opt/apache-maven-2.0.9/lib/maven-2.0.9-uber.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties
$ /home/builder/opt/jdk1.5.0_22//bin/java -Xmx1024m -Xms512m -cp /home/builder/var/hudson/plugins/maven-plugin/WEB-INF/lib/maven-agent-2.1.0.jar:/home/builder/opt/apache-maven-2.0.9/boot/classworlds-1.1.jar hudson.maven.agent.Main /home/builder/opt/apache-maven-2.0.9 /home/builder/opt/apache-tomcat-6.0.24/webapps/hudson/WEB-INF/lib/hudson-remoting-2.1.0.jar /home/builder/var/hudson/plugins/maven-plugin/WEB-INF/lib/maven-interceptor-2.1.0.jar 48555
<===[HUDSON REMOTING CAPACITY]===> channel started
Executing Maven: -N -B -f <http://ciserver:8080/hudson/job/MyProject/com.mycompany.myproject$web/ws/pom.xml> clean deploy -Dworkspace.path=/home/builder/var/hudson/jobs/MyProject/workspace/ -Droot.project.name=MyRoot -e
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building MyProject
[INFO] task-segment: [clean, deploy]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory <http://ciserver:8080/hudson/job/MyProject/com.mycompany.myproject$web/ws/target>
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 945 source files to <http://ciserver:8080/hudson/job/MyProject/com.mycompany.myproject$web/ws/target/classes>
[HUDSON] Archiving <http://ciserver:8080/hudson/job/MyProject/com.mycompany.myproject$web/ws/pom.xml> to /home/builder/var/hudson/jobs/MyProject/modules/com.mycompany.myproject$web/builds/2011-09-27_13-32-33/archive/com.mycompany.myproject/web/1.1-SNAPSHOT/pom.xml
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
{{{compiler failure here}}}
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Compilation failure
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:579)
{{{stacktrace omitted}}}
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
{{{stacktrace omitted}}}
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 7 seconds
[INFO] Finished at: Tue Sep 27 13:33:42 CEST 2011 [INFO] Final Memory: 53M/508M
[INFO] ------------------------------------------------------------------------