sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins
vi /etc/sysconfig/jenkins
修改端口
service jenkins restart 啓動
安裝完成啓動顯示:java
Jenkins requires Java 8, but you are running 1.7.0_99-mockbuild_2016_05_11_0。。。apache
此時須要安裝jdk1.8而且進行 jenkins配置的修改vim
vim /etc/init.d/jenkins maven
將使用的java設置成本身的java配置(默認從下往上加載 保留有最後一個)便可ui
添加憑據this
Jenkins配置mavenurl
自動安裝maven spa
[/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/](自動安裝路徑)3d
安裝完成後進行setting.xml配置修改rest
<?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <pluginGroups> <pluginGroup>org.mortbay.jetty</pluginGroup> </pluginGroups> <proxies> </proxies> <servers> <server> <id>releases</id> <username>admin</username> <password>admin123</password> </server> <server> <id>snapshots</id> <username>admin</username> <password>admin123</password> </server> </servers> <mirrors> <mirror> <id>nexus</id> <mirrorOf>*</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://*.*.*.*:8081/nexus/content/groups/public</url> </mirror> </mirrors>
jenkins構建 java.io.IOException: Cannot run program "java...異常
須要將jdk路徑配置到jenkins中