hudson cobertura sonar integration error - maven

I integrate sonar into hudson, but when I build a project using hudson, an error occured
log:
does anyone know how to avoid this error?
thanks in advance~

You have to change the location of you locale maven repository into a different location like c:.m2\ instead c:\Document Settgins etc........This can be done by changing the settings.xml file.
You have reached the limit in Windows...

Related

How do you get maven child projects to build in Jenkins when using CI Friendly versions?

I am using CI Friendly versioning in my Parent-Child Maven project. I can't get the child to build on the Jenkins server. It builds fine on my server. I am getting the "Failed to parse POMs" error saying it can't find "myProj-parent:pom:${revision}" in nexus. I am using the Maven Flatten Plugin and as I said it works when I run Maven from my server. But for some reason in Jenkins it is not resolving.
The "revision" is set in the properties section of the parent POM.
Any hints?
We have the same problem when we do a sparse checkout of the child module only.
We solved it by adding a sparse checkout of all pom.xml files.
I hope this will help you.
If you're using the Jenkins maven-plugin, the failure may be due to an old unresolved bug. A workaround from the JIRA conversation is to use the pipeline-maven-plugin (withMaven step).
The pipeline-maven-plugin exposes a similar bug in Maven that was fixed in version 3.8.5. My build works using the pipeline-maven-plugin after upgrading Maven on the Jenkins server.

how to do force deploy maven project via jenkins..?

when I do deploy of maven project via jenkins the output says success but i cant see changes on the server. what i can see is the target folder on the jenkins server contain all the required changes but dont know why it is unable to deploy those files on the test server, below are some details.
command to deploy
clean package jboss-as:deploy -DjbossUser=${jbossUser} -DjbossPass=${jbossPass} -DjbossServer=${jbossServer} -DjbossServerPort=${jbossServerPort}
file type that contain the changes : *.html & *.js
Any help is appreciated
Thanks
Kapil
I also faced similar issue. It seems there are some deploy mechanism exists in Jenkins where the version is configured. It should take the build(snapshot) version from pom.xml

How to configure Maven local calling Sonar server?

I have a hudson server.
Everytime I build my project on Hudson, It triggers Sonar on other server to building too.
I checked the configuration on Hudson.
I am following some instructions in here , but seems it is not enough.
I have my setting.xml
And I have this issue:
What is wrong with my configuration or I missing something?
Thank.

Maven with sonar authentication

I am running maven with sonar. Since I activated authentication on sonar for security purposes, since then I got the following error:
[ERROR] Can´t access to Sonar or project doesn't exist on Sonar instance. HTTP KO to http://localhost:9000/api/resources?resource=com.myproject.soft:soft&depth=0&format=xml
java.io.IOException: Can´t access to Sonar or project doesn't exist on Sonar instance.
at org.sonar.report.pdf.util.SonarAccess.getUrlAsDocument(SonarAccess.java:132)
at org.sonar.report.pdf.entity.Project.initializeProject(Project.java:98)
according to http://docs.sonarqube.org/display/SONAR/Analyzing+with+Maven I should use the following parameters:
-Dsonar.login=login -Dsonar.password=password
Those settings are not working for me.
The full command I am using is:
mvn install sonar:sonar -Dsonar.login=login -Dsonar.password=password
This is a limitation of the PDF Report Plugin that is developed by Klicap:
http://jira.codehaus.org/browse/SONARPLUGINS-1510
If you remove this plugin, then everything should be back to normal.
We have the same problem and resolved it by adding some credentials. Tested on Sonar 3.7 and Sonar PDF Plugin 1.3
In eclipse put this as your maven Goals:
org.codehaus.sonar-plugins.pdf-report:maven-pdfreport-plugin:1.3:generate -Dsonar.host.url=http://localhost:9000 -Dreport.type=executive -Dsonar.pdf.username=admin -Dsonar.pdf.password=admin

mvn sonar:sonar throws exception while doing Java AST scan

Please note :- My mvn clean install goes successful
but when i do mvn sonar:sonar it throws me
[ERROR] Squid Error occurs when analysing :/junk/test/src/main/java/API/com/API/HelloAPI.java
org.sonar.squid.api.AnalysisException: The source directory does not correspond to the package declaration com.API
at org.sonar.java.ast.visitor.PackageVisitor.checkPhysicalDirectory(PackageVisitor.java:93) [sonar-squid-java-plugin-2.8.jar:na]
at org.sonar.java.ast.visitor.PackageVisitor.createSourcePackage(PackageVisitor.java:75) [sonar-squid-java-plugin-2.8.jar:na]
http://sonar-dev.787459.n3.nabble.com/file/n3324837/squid-test.zip
The message is quite clear: the package declaration is wrong. It should be API.com.API if the source directory is /junk/test/src/main/java (that is the default value in Maven). An alternative is to change the source dir to src/main/java/API.
Could it be that your POM contains this line:
<sourceDirectory>.</sourceDirectory>
If so, changing it to this might help:
<sourceDirectory>src/main/java</sourceDirectory>
Maven doesn't care, but sonar does.
I had the same problem with sonar and a maven project generated by eclipse.
(Found the solution at http://www.digipedia.pl/usenet/thread/13899/13064/ )
I got the same error message after upgrading to a more recent sonar plugin (sonar-maven3-plugin:3.7.1/3.7.3/4.0 running against SonarQube Server 3.5.1) for a source file which worked with 3.6-RC3/3.6.3/3.7.0. Apparently 3.7.1 introduced the issue :-/

Resources