Maven Repository – Best Practices

Problem: Many are pointing public repos. This is not good practice.

Suggested:
Setup JFrog QA and Prod repos in organization.
JFrog QA pulls files from public repos on demand basis or periodic basis.
Builds will be tested and make sure that there are no corrupted jars and all are having proper required license.

Developers can point JFrog QA repo.
When build need to happen in Junkins/Hudson…it uses JFrog Prod.
Developers need to inform admins about required files.
Admins assure integrity of required jars to push to JFrog prod.
Also they will validated required licensing issues for given jars.
This is more safest and controlled way to control final artifacts which are going into production.

References:
https://github.com/SeleniumHQ/selenium/issues/1735ac
http://stackoverflow.com/questions/20582856/maven-downloads-corrupted-jar
-o-

Jenkins is a Swiss Knife

Jenkins is an open source continuous integration tool written in Java. The project was forked from Hudson after a dispute withOracle.

http://en.wikipedia.org/wiki/Jenkins_%28software%29

Important features for large Projects

Distributed Builds:
https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds

Setting up Master / Slave:
https://wiki.jenkins-ci.org/display/JENKINS/Step+by+step+guide+to+set+up+master+and+slave+machines

Many of us think that Jenkins is only for Build. But it can do anything by triggering scripts with parameters.

Build With Parameters Plugin:
https://wiki.jenkins-ci.org/display/JENKINS/Build+With+Parameters+Plugin

– build required branch
– deploy to given server
– build for given Profile
– restart Tomcat
– take backups
– run regression tests’
– run puppet
– run liquibase changes
– no limit on what we can to with this plugin

This type of customization gives control to Engineering teams / QA teams to build and deploy on demand basis without any support from deployment team.

Reference:

http://jenkins-ci.org/

How Jenkins Builds the Netflix Global Streaming
http://www.slideshare.net/garethbowles/building-netflixstreamingwithjenkins-juc

Self service build and deployment at Netflix (Agile 2013)
http://www.slideshare.net/garethbowles/self-servicebuilddeploymentagile2013

Conclusion: Jenkins is good free knife. After utilizing all its plugins to their maximum potential, we can see that Jenkins is a Swiss Knife.

jenkins_logo

Other tools licenses are costly and Jenkins will live long with open source contributions.

Maven Vs Gradle

Gradle is another Build System similar to Maven.

I didn’t like Gradle, because

1. Proprietary software build to get service agreements and make money.
2. Training is very costly.
3. Pushing away from structured development to unconventional development.

I always prefer Apache projects.

http://www.gradleware.com/services
Maven Vs Gradle
http://www.gradleware.com/resources/tech/java/maven
http://www.gradle.org/license

I may change my opinion down the line.

-o-

Hudson- Extensible continuous integration engine for Java

Hudson is good tool to use for continuous integration.

Use Hudson for continuous integration. It is having all required features to make a project success. For more information check https://hudson.dev.java.net/

Hudson support lot of plugins. Please remember, we need to have all required reports in Maven. Hudson provides plugins to covert maven xml result to appropriate html page. At this time it is having issues. Example: JavaNCSS, Cobertura wont display cyclomatic complexity. We need to depend on generated site.

Check this site http://www.testearly.com/category/code-metrics/ for more information.

Also we can do integration tests with the help of TestNG. We need to achieve first this with Maven. Later we need to add these commands in configuration section.

-o-