8. Check code updates and compile
You can set the timer check compile function by poll SCM.
For example, */5 * * * * is checked every 5 minutes, if there is an update in the Git repository, the build operation is performed.
9. Speed up download with maven
See: http://blog.csdn.net/sheismylife/article/details/7209722
Jenkins '. M2 directory path in:/var/lib/jenkins/.m2/
Clear all Jar packages First, then create the settings.xml file and edit the following:
<settings>
<mirrors>
<mirror>
<!--this sends everything else to/public-
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://S1:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built on central repo to direct-to-
<!--all requests to nexus via the mirror--
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profiles active all the time-
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
Now click on Build to test, open console output, see the command line output, if you find the jar package downloaded from S1, it is correct. Compared with the use of a few, save more than 1 minutes.
Lao Li share: Continuous integration Learn Jenkins's git and MAVEN configuration 2