Hand-in-hand diagram, detailed Jenkins , svn , maven project continuous integration
Strategy: If you have just started integration testing like me and have just come into contact with jenkins , I think this document will be helpful to you. First of all, you don’t know what jenkins is, and I didn’t know what it was yesterday, then Baidu Encyclopedia An instant noodle. So you know that's what happened. Now that you see this document, you don't need to mess with Baidu for other things.
Windows installation:
The installation of window is very simple: of course, you still have to go to the official website yourself. As for how to get to the official website, I will not tell you.
After the download is complete, there are 2 files in it, setup.exe, Jenkins-1.509.msi, so double-click to install setup.exe. No brain next step. Installed.
Ok , do you think you are a genius, you can do it at once, or you can check whether there is Chinese in your installation path, if so, then you should reinstall it. What, won't uninstall? I won't tell you. My sb has the whole Chinese in the installation path, so I wasted the morning.
linux installation:
Even better if your environment is linux . See below.
Build Jenkins ( Hudson ) platform in Linux environment
http://blog.csdn.net/yanmingming1989/article/details/8557716
At this point you should be done installing. Check it out, enter http://localhost:8080 and you will see the interface
jenkens environment configuration:
After the installation is complete, don't worry, you can mess around for a while to kill time. Of course, if you don't want to kill it, continue reading below.
see picture 001
jdk configuration :
maven configuration :
see picture 002
After configuring these two items, it is almost the same.
start building
Then create a new Job:
Obviously we are using maven2 , 3 new projects.
svn configuration :
see picture 003
Click Finish:
After configuring the username and password, if there is still a red prompt, then leave it alone and start building the main interface directly:
Click on the console window:
You will see the source code of your project is first downloaded from svn .
Then start downloading the required jar package in maven 's private server or central repository
Finally :
[INFO] -----------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 minutes 54 seconds
[INFO] Finished at: Sun Apr 07 14:49:14 CST 2013
[INFO] Final Memory: 16M/66M
[INFO] -----------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
channel stopped
Finished: SUCCESS
OK! This is the end of the example.
Of course you may be very unlucky: there are various errors
Error message:
1. “main”java.lang.NoclassDefFoundError:hudson/maven/agent/Main
In addition to this mistake, if you are under linux , please go: http://blog.csdn.net/yanmingming1989/article/details/8557716
If it is window , then look carefully at the error message: Is there any? ? Squares and the like should be garbled. Note that please do not set Chinese in any path.
2 If you are svn , maven, jdk configuration prompt is wrong, then you are reconfiguring.
Of course, if you, like me, don't even know what maven is: then please enter
http://www.cnblogs.com/bigtall/archive/2011/03/23/1993253.html
If you need more advanced materials, the links below will also help you.
Other advanced configuration:
jenkins user rights configuration
http://blog.csdn.net/ruisheng_412/article/details/8083035
jenkins distributed configuration
http://blog.sina.com.cn/s/blog_5d157a1d01017mut.html
The picture did not come up, there is a word document in the attachment
Attach a linux test sell, a window shell
windows
:@echo off
setlocal
set my.dir=%CD:~-11%
if not "%my.dir%" == "mpleForMave" goto lerr1
goto lgo
:lerr1
echo do at myproject directory
goto lend
: something
call mvn clean
call mvn test
:lend
endlocal
linux shell
#!/bin/sh
MYDIR=$(pwd)
if [ $MYDIR = '/jenkins_work/jobs/example/workspace' ]
then
echo "MyProject Directory IS OK !"
mvn clean
mvn test
else
echo "MyProject Directory Not Ready !"
echo $MYDIR
exit
fi