Saturday, October 19, 2013

how to install jenkins

     Platform:
  • windows 7- 64 bit
  • java version "1.7.0_40"
  • apache-maven 3.1.0
  • eclipse Kepler 4.3.1
  • m2e - Maven Integration for Eclipse-      http://www.eclipse.org/m2e/download/
  • artifactory-3.0.3
  • tomcat7-maven-plugin
  • jetty-maven-plugin
  • jenkins 1.535


Download jenkins  war file.At the time of download version is (1.535)
http://jenkins-ci.org/

Copy war file into C:\Downloads\ciroot\jenkinshome

I set jenkins home directory and the port through this file.In case of any update on jenkins I simply replace war file in jenkins_home directory. I use "jenkins start.cmd" file to run jenkins.

Start command prompt or double click on "jenkins start.cmd"
At first run jenkins asks you to configure updates/security
I create jenkins user.
After installation this is how jenkins looks like


Click Manage Jenkins - Configure System
Point jdk installation
Point ant installation
Point maven installation
Point git installation
the url jenkins runs on

You can create users.This is how jenkins looks like at the end






how to create parent pom project for organization

     Platform:
  • windows 7- 64 bit
  • java version "1.7.0_40"
  • apache-maven 3.1.0
  • eclipse Kepler 4.3.1
  • m2e - Maven Integration for Eclipse-      http://www.eclipse.org/m2e/download/
  • artifactory-3.0.3
  • tomcat7-maven-plugin
  • jetty-maven-plugin
     In this tutorial I want to create parent pom project using maven project feature.

File-New-Maven Project


select package type pom

this is how it looks like at the end

Right click on pom.xml.
Run as-Maven clean
Run as-Maven install

This is the contents of  pom.xml which is actually parent-pom file

Thursday, October 17, 2013

how to dynamic web project with maven 3


     Platform:
  • windows 7- 64 bit
  • java version "1.7.0_40"
  • apache-maven 3.1.0
  • eclipse Kepler 4.3.1
  • m2e - Maven Integration for Eclipse-      http://www.eclipse.org/m2e/download/
  • artifactory-3.0.3
  • tomcat7-maven-plugin
  • jetty-maven-plugin
  • with parent pom


In this tutorial I want to create maven-compatible eclipse dynamic web project with parent pom.

I have artifactory-3.0.3 as maven repository server running for caching artifacts.
Instead of setting up tomcat or other containers I choose  jetty-maven-plugin and tomcat7-maven-plugin.
I can't get project running on jetty embedded as I guess it might be related to windows path file problem.

create new dynamic web project






give a name and next
delete 'src' folder and create new folders as above and
change default  output folder as well




change content directory as above and tick to generate web.xml deployment descriptor
click finish



This is how it looks like after you click finish button.
It is still not maven project.

This is M2 eclipse plugin feature.Just right click on the project
Configure-Convert to Maven Project





Normally I deselect of all them as I don't need and click to finish.
This will create your pom file and maven project
 I am not sure but this must be part of M2 eclipse plugin feature
Maybe you can explain why this comes up or whether I need it or not.



Now it is maven project.

Right click on "webapp" directory then
New-Other







This is the contents of web.xml


This is the contents of pom.xml


As you are aware I use parent-pom file for my projects.There's another how-to about this parent-pom file here.



To run project on tomcat you need to create run configuration for tomcat maven plugin.
When you right click on pom.xml there are two "maven build" menu.
However the one ending with "..' is for the first time configuration.
After you create tomcat:run configuration you can use the one without "..' directly.
If you create more than one eclipse lists all run configurations.
At the bottom there's run configurations menu.

Here are the configurations for tomcat and jetty maven plugins.

works
http://localhost:8080/

don't work
http://localhost:8080/test1/index.jsp
http://localhost:8080/test1


Click to run tomcat:run window

You can start web browser that the arrow shows above.
Just the copy url painted in blue on the console.
You can stop embedded tomcat with the red open the arrow shows below

When I try to run with jetty maven plugin it fails.I even try with given whole url including index.jsp
Here is the error message on console.


Please feel free to make suggestions corrections contributions etc.All is appreciated.

References:
www.cloudchamp.com/2010/08/creating-maven-web-project-in-eclipse.html