How to integrate PMD, Maven and Hudson? - jenkins

I tries one scenario to integrate these tools, but it giving unbelievable output. What I did:
I did not configure or install PMD in Hudson.
I configured PMD in my parent pom.
I run goals (clean site) the in Hudson job, but it running only last sub project.
I check log in console, it has:
some svn update log
Parsing POMs
and directly generating reports for last sub project.
I have same svn checkout workspace in Eclipse, it working and generating reports for all parent and child projects. Actually, after verify in Eclipse only, I try to verify in Hudson.
And after try to configure PMD in Hudson, but I did not find any help online to do that.

We are using jenkins and maven, artifactory and sonar (which contains PMD, Checkstyle, Findbugs and others).
I didn't set it up however there are plugins for (nearly) everything:
Jenkins Artifactory Plugin
Jenkins Maven Plugin
Jenkins Sonar Plugin
But it is possible to do it your way and use PMD "directly". Hava a look here...

Related

Develop groovy scripts for jenkins in vscode or intellij

Is it possible to connect to jenkins instance to get the available libraries (including the ones from plugins) for locally developing groovy scripts with code completion in intellij or vscode?
It is not possible to have the same library as that of Jenkins instance to compile groovy inside these IDE'S.
Instead you need to have Groovy SDK installed and configured for each of there IDEs separately. (IntelliJ is simple to configure while VS Code usages .json file for all configuration). Once you have the Groovy SDK lib configured, within IDE project you can compile and run the sample .groovy (And or .gdsl) script (without any jenkins plugin).
If you are trying to trigger .jenkinsfile then, you need to change configuration in IDE to treat .jenkinsfile equal to .groovy file see below screenshot.
While it is possible to configure your Jenkins instance into IDE and also to control (Run, cancel and re-run) the jobs directly remotely in runtime from IntelliJ or from VS Code.
For this you can use;
Jenkins-Control-Plugin - IntelliJ IDEA
To Configure Jenkins instance is very simple.
see the Link here
Jenkins Jack(many other plugins are available but this is most popular) - VS Code.
I Struggled a bit to configure the Jenkins Jack but with this you can compile the Groovy and trigger it remotely.
see the link JenkinsJack
Jenkins Runner - VS Code
This is same as that of Jenkins Control Plugin mentioned in point 1.
My favorite is VS code with Jenkins Jack simple and effective.

How to Integrate SonarQube with QuickBuild?

We are currently using GitLab and QuickBuild for our Android Projects.
I have to integrate Sonarqube to have a pre check before every build.
I'm not able to get much information for quickbuild as most of the documentation is for Jenkins.
I can see that we can create steps in quickbuild and I would have to add one more step for sonar check and execute the sonar command.
But still I'm not very sure what is the best practice?
Where should I run the Sonar Server?
Where to add the sonar configuration files?
Any good documentation available?
Should I run the Sonar check on GitLab or QuickBuild? (Our build server is QuickBuild so it looks the better option)
Ideally you should run sonar server on separate machine or you can use the same server on which quickbuild is running (depending upon java versions)
You can place sonar configuration file either in project directory or you can store it at any central location.
No official documentation for sonar and quickbuild integration.
Run sonar check on Buildserver.
We chose to do the SonarQube check inside the Maven build (that runs on Quickbuild). A Maven plugin is available. If you use Gradle, this might do as well.

Recommendations for a Continuum Integration, Delivery and Deployment solution

I am reading lots of articles here about the subject and try to find a nice set of tools to integrate and create a Complete CI environment.
Among those articles I particularly liked this one: Continuum as a Jenkins replacement?
I have installed here, but not yet configured because we are doing some testes with GIT and Jenkins. We have Nexus working fine.
Now I need to have some recommendations to cover the following topics:
Code Coverage - JaCoCo, Cobertura, Sonar?
Code Quality Analysis
PMD, Sonar? ANT, MAVEN, GRADLE?
Maybe I am mixing some concepts here regarding the use of some tools, like SonarQube, if that is the case I am sorry.
So, I am open to "hear" about this. Thanks
Ant, Maven and Gradle are build tools. You pick one that suites your team. Gradle/Maven may directly work with artifact repos. Ant will require help from Ivy.
Coverage: JaCoCo supports newer Java(7, 8).. Not so much luck with Cobertura
Sonar: If you can integrate your code with SonarQube that takes care of bit Code Quality Metrics (like Duplicate detection, Findbug , Security ..etc)
On Jenkins
You can integrate Jenkins with all of the above tools. You can create Jenkins jobs for practically everything and have tons of plugins to make even simpler. There are more plugins to make Jenkins' based CD easier: Build Flow and workflow plugin.

Need to deploy from archiva to weblogic using Jenkins

We use Jenkins for building maven projects, analysing code and pushing our builds to archiva(via mvn deploy).
I need to have a deploy item that grabs a war from archiva and pushes it to weblogic.
Checking if this can be easily done without scripting something.
Thanks,
Daniel
you can use WebLogic Deployer Plugin to deploy your files.
**/*.war only selects the war file from your archiva.

Can we configure two maven versions on jenkins

We have two projects each using different maven and Java versions.
Currently one of these projects is already configured on Jenkins. we need to configure the other project on Jenkins as well.
Is it possible to add one more version of maven to Jenkins?
While configuring the project will it display the list of maven versions, from which I can select the required one?
Please note that I don't have admin rights and currently investigating.
With the admin rights, you can add several Maven installation:
Next, in your Maven job, you select the relevant version:
So you have to contact your Jenkins admin to solve your pb :)

Resources