I created a Jenkins setup for my current Java hobby project (a site on physical units intended to make ads money, check it out at http://www.all-about-units.com) yesterday and noticed that my old note on how to setup Jenkins (then it was written for Hudson) is a bit out of date. The Jenkins configuration menues for generating Findbugs static analysis, Cobertura code coverage and Checkstyle format control were completely new. In addition to that, I've migrated to Git since then so there are a few steps also involved in getting Git running as code repository within Jenkins.
Install Jenkins and plugins
First of all, if you haven't installed Jenkins the easiest way is to download the war archive from http://jenkins-ci.org/. This article is based on Jenkins version 1.532.1. You can install in in a server container like Tomcat or Jetty, but the easiest way to get started is to run it from the command line like
java -jar jenkins.war
I created a small bash script which also changes the port since I have another server using the default 8080 port.
#!/bin/sh
nohup java -jar jenkins.war --httpPort=8081
So now you can access Jenkins via http://localhost:8081 or similar.
Now we must install some plugins which are not part of the core distribution. Go to the settings of Jenkins and find the Plugins section.
Here you should at least find the following plugs and install them
Creating Jenkins job
Create a new Jenkins job. My project handles its dependencies via Maven 3 which suits Jenkins very well. Choose the Maven 2/3 option.
In the next step, choose Git as SCM. If you have your Git repository on the same server as Jenkins you can simply add the file path to the repository. Otherwise you setup the security credentials here as well. Also, choose if you want to build master or some other branch.
We haven't talked about the pom.xml for the project yet, but it will be configured to use some Maven goals. So in the Maven goals section, add goals for test package site.
Under Build settings, check the boxes for Publish Checkstyle analysis results, Publish FindBugs analysis results and Publish duplicate code analysis results.
In the Post-build Actions add a step for Cobertura reporting.
Maven will generate the Cobertura report to the Jenkins workspace under path /target/site/cobertura/coverage.xml so add this in the configuration of the action.
Now you should have a Jenkins job setup ready for building.
Before building we must make sure the pom.xml of the project has the correct plugins and reports configured.
Maven pom.xml configuration
After all the dependency specifications in the pom.xml add something similar to this. In this setup Cobertura is configured in the package phase and that's why we added that Maven goal above. If you hadn't added this in the pom file, you could have added separate Maven goals for Cobertura in Jenkins as well.
<build>
<finalName>Unitconversion</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>${findbugs.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>${cobertura.version}</version>
<configuration>
<formats>
<format>xml</format>
</formats>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>cobertura</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>${findbugs.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>${surefire.reportplugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>${cobertura.version}</version>
<configuration>
<formats>
<format>xml</format>
</formats>
</configuration>
</plugin>
</plugins>
</reporting>
Run the job and everything should work out of the box. Do another build to start getting history graphs like below of the trend of failing tests, checkstyle warnings, issues found by Findbugs and te code coverage statistics from Cobertura.
I wonder if you already have compiled software
ReplyDeleteThis comment has been removed by the author.
ReplyDeletehttps://bayanlarsitesi.com/
ReplyDeleteEskişehir
Erzincan
Ardahan
Erzurum
WJ5AG
Kırşehir Lojistik
ReplyDeleteHakkari Lojistik
Kars Lojistik
Konya Lojistik
Kilis Lojistik
6SİS4H
bartın evden eve nakliyat
ReplyDeleteedirne evden eve nakliyat
mersin evden eve nakliyat
sinop evden eve nakliyat
siirt evden eve nakliyat
E02A
C1DD2
ReplyDeleteÇorum Parça Eşya Taşıma
Isparta Parça Eşya Taşıma
Osmaniye Parça Eşya Taşıma
Samsun Şehir İçi Nakliyat
Urfa Evden Eve Nakliyat
Muş Şehirler Arası Nakliyat
Sakarya Evden Eve Nakliyat
Ünye Mutfak Dolabı
Sakarya Şehir İçi Nakliyat
BBB4F
ReplyDeleteKırklareli Evden Eve Nakliyat
testosterone propionat
order testosterone propionat
Erzurum Evden Eve Nakliyat
order fat burner
buy steroids
order sarms
trenbolone enanthate for sale
Urfa Evden Eve Nakliyat
C36C4
ReplyDeleteAksaray Evden Eve Nakliyat
Paribu Güvenilir mi
order steroid cycles
order peptides
Kilis Evden Eve Nakliyat
İzmir Evden Eve Nakliyat
Edirne Evden Eve Nakliyat
Binance Referans Kodu
buy winstrol stanozolol
331E5
ReplyDeleteAmasya Parça Eşya Taşıma
Coinex Güvenilir mi
Isparta Evden Eve Nakliyat
Kırşehir Şehir İçi Nakliyat
Çerkezköy Sineklik
Eskişehir Evden Eve Nakliyat
Bitlis Lojistik
Isparta Parça Eşya Taşıma
Erzincan Şehir İçi Nakliyat
B01C6
ReplyDeleteKilis Şehir İçi Nakliyat
Ardahan Şehir İçi Nakliyat
Erzurum Lojistik
Mersin Şehir İçi Nakliyat
Düzce Lojistik
Çerkezköy Petek Temizleme
Denizli Şehirler Arası Nakliyat
Aksaray Evden Eve Nakliyat
Samsun Evden Eve Nakliyat
85ADA
ReplyDeleteBitlis Evden Eve Nakliyat
Çerkezköy Organizasyon
Çankaya Boya Ustası
Hakkari Şehir İçi Nakliyat
Yalova Şehir İçi Nakliyat
Kocaeli Evden Eve Nakliyat
Antep Şehirler Arası Nakliyat
Hamster Coin Hangi Borsada
Erzincan Lojistik
2FD5E
ReplyDeleteAAX Güvenilir mi
Pursaklar Boya Ustası
Afyon Şehir İçi Nakliyat
Iğdır Parça Eşya Taşıma
Bone Coin Hangi Borsada
Yozgat Şehirler Arası Nakliyat
Kucoin Güvenilir mi
Karapürçek Parke Ustası
Samsun Şehir İçi Nakliyat
17270
ReplyDeleteÇerkezköy Boya Ustası
Osmaniye Parça Eşya Taşıma
Bursa Parça Eşya Taşıma
Sivas Evden Eve Nakliyat
Batıkent Fayans Ustası
Gümüşhane Parça Eşya Taşıma
Siirt Parça Eşya Taşıma
Poloniex Güvenilir mi
Bayburt Lojistik
C040C
ReplyDeleteKarapürçek Fayans Ustası
Siirt Evden Eve Nakliyat
Binance Referans Kodu
Antalya Evden Eve Nakliyat
Zonguldak Lojistik
Bilecik Evden Eve Nakliyat
Bilecik Lojistik
Erzurum Şehirler Arası Nakliyat
Iğdır Parça Eşya Taşıma
DED60
ReplyDeletehttps://referanskodunedir.com.tr/
A3CE7
ReplyDeleteartvin rastgele sohbet odaları
muş görüntülü sohbet
maraş canli sohbet
Şırnak Canli Sohbet Chat
şırnak görüntülü sohbet odaları
Ağrı Sesli Sohbet Siteler
bartın rastgele sohbet
samsun mobil sohbet odaları
Kastamonu Random Görüntülü Sohbet
4F3AD
ReplyDeletethorchain
uwulend finance
yearn finance
satoshivm
pancakeswap
sushiswap
shapeshift
pudgy penguins
dappradar