Prerequisites:
1. Download the latest java jdk from here: http://www.oracle.com/technetwork/java/javase/downloads/index.html2. Download the latest build for eclipse(java ee developers) from here: http://www.eclipse.org/downloads/
3. Download the latest apache maven from here: http://maven.apache.org/download.cgi
4. Download the latest Hudson from here: http://hudson-ci.org/
Steps:
1. Install the Java JDK and set the JAVA_HOME environment variable to point to the path where Java JDK was installed (on a windows 7 system the environment variables can be accessed by right clicking your Computer, select Properties, then Advanced system settings, then press the Environment Variables… button)2. Unpack the maven archive, then set the MAVEN_HOME env variable to point to the path where maven was installed
3. Set the Path variable to both: %JAVA_HOME%\bin and %MAVEN_HOME%\bin
4. To check everything is ok, open a command prompt and type: java –version to see the current version of the java jdk installed and also mvn to see if the command is recognized by the system
5. Unpack the eclipse archive to a local directory and create a shortcut for it on Desktop and start it
6. Choose a directory for your workspaces
7. Go to Help -> Eclipse Marketplace and search for m2eclipse, then choose Maven Integration for Eclipse
8. Click Next on the following screen
9. Accept the license and click Finish
10. Restart eclipse
11. Go to the workspaces folder and create a new folder for your project
12. In that folder copy the following pom.xml file:
Just make sure the versions for:
selenium-java 2.42.0 and junit 4.11 are set to the latest available13. Open a command prompt and run “mvn clean install” in that directory where the pom.xml file is located:
14. Wait for the build to be completed, then run “mvn eclipse:eclipse”
15. You now have an eclipse project generated for you
16. Go to eclipse, choose File -> Import, then Existing projects into workspace
17. Click Next then select the path to the previously created project folder
18. Your project will be imported and it will look something like this:
19. In eclipse right click the project folder and select New-> Source Folder and give it the name: “src” then click Finish
20. Select the src folder, right click on it, select New -> Package and give it the name: “test.java”
21. Right click the test.java package and select New -> Class and name it CI_StarterTest, uncheck the Inherited abstract methods option and click Finish (the class name must have the word Test in it!)
22. Copy the contents of this file in the java class you’ve just created
23. Your project should now look like this:
24. To make sure everything works fine, go to your project folder and start a command prompt in that folder, the run the command: “mvn clean install”, you should have a successful build
Hudson configuration
1. Copy the war file to a directory of your convenience2. Create a bat file to run it, call it runHudson.bat, it will contain: “java –jar hudson.war”, I’ve attached it here for you convenience, just copy it to the hudson folder
3. Run the file and wait for hudson to start
4. You can now access hudson on: http://localhost:8080/
5. Make sure you check the maven plugins(x3)
6. Click Install on the bottom of the page
7. It will take a while… you can take a break while it finishes
8. Click Finish when it is done
9. Hudson is now ready
10. Click on New Job link and name it CI
11. On the configuration page, under Advanced Project options check the Use custom space checkbox and paste in the path to your project folder
13. Click Save
14. Run the build and check the status
15. Congrats, you are all done, now you can move along to add all of sorts of tests in your newly configured CI