Centos7+svn+jenkins+maven+nexus+SonarQube+docker持续集成高级配置(三)

系统运维 waitig 573℃ 百度已收录 0评论

Centos7+svn+jenkins+maven+SonarQube+docker持续集成安装(一)
Centos7+svn+jenkins+maven+SonarQube+docker持续集成安装(二)

1:jenkins配置jdk、maven

系统管理–》Global Tool Configuration–>MAVEN
这里写图片描述
编辑maven的配置文件:显示的格式大家自行调整一下
vim /usr/local/maven3/conf/settings.xml

<?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">

<servers>
        <server>
                <id>central</id>
                <username>admin</username>
        <server>
                <id>thirdparty</id>
                <username>admin</username>
                <password>admin123</password>
        </server>
        <server>
                <id>central</id>
                <username>admin</username>
                <password>admin123</password>
        </server>

        <server>
                <id>releases</id>
                <username>admin</username>
                <password>admin123</password>
        </server>

        <server>
                <id>snapshots</id>
                <username>admin</username>
                <password>admin123</password>
        </server>
        <server>
                <id>pro</id>
                <username>admin</username>
                <password>admin123</password>
        </server>
        <server>
                <id>pre</id>
                <username>admin</username>
                <password>admin123</password>
        </server>
        <server>
                <id>test01</id>
                <username>admin</username>

        <server>
                <id>releases</id>
                <username>admin</username>
                <password>admin123</password>
        </server>

        <server>
                <id>snapshots</id>
                <username>admin</username>
                <password>admin123</password>
        </server>
        <server>
                <id>pro</id>
                <username>admin</username>
                <password>admin123</password>
        </server>
        <server>
                <id>pre</id>
                <username>admin</username>
                <password>admin123</password>
        </server>
        <server>
                <id>test01</id>
                <username>admin</username>
                <password>admin123</password>
        </server>
</servers>


  <mirrors>
      <mirror>
      <id>mirror</id>
      <mirrorOf>*</mirrorOf>
      <url>http://192.168.150.150:8081/nexus/content/groups/public/</url>
    </mirror>
 </mirrors>



  <profiles>
  <mirrors>
      <mirror>
      <id>mirror</id>
      <mirrorOf>*</mirrorOf>
      <url>http://192.168.150.150:8081/nexus/content/groups/public/</url>
    </mirror>
 </mirrors>



  <profiles>
        <profile>
        <id>pro</id>
                <repositories>
                <repository>
                        <id>pro</id>
                                <name>pro</name>
                                 <url>http://192.168.150.150:8081/content/repositories/pro</url>
                                </repository>

                                <repository>
                                <id>3rdparties</id>
                                <name>3rdparties</name>
                                <url>http://192.168.150.150:8081/content/repositories/3rdparties</url>
                                </repository>
                        </repositories>

        </profile>


        <profile>
                <id>pre</id>
                        <repositories>
                        <repository>
                                <id>pre</id>
                                <name>pre</name>
                                <url>http://192.168.150.150:8081/nexus/content/repositories/pre</url>
                                </repository>

                                <repository>
                                <id>3rdparties</id>
                                <name>3rdparties</name>
                                <url>http://192.168.150.150:8081/content/repositories/3rdparties</url>
                                </repository>
                        </repositories>

        </profile>


        <profile>
                <id>test01</id>
                        <repositories>
                        <repository>
                                <id>test01</id>
                                <name>test01</name>
                                <url>http://192.168.150.150:8081/content/repositories/test01/</url>
                                </repository>

                        <repository>
                                <id>3rdparties</id>
                                <name>3rdparties</name>                                                              <url>http://192.168.150.150:8081/content/repositories/3rdparties</url>
                        </repository>
                        </repositories>
        </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>alwaysActiveProfile</activeProfile>
    <activeProfile>anotherAlwaysActiveProfile</activeProfile>
  </activeProfiles>
</settings>

系统管理–》Global Tool Configuration–>JDK
这里写图片描述

2:配置sonarqube
系统管理–》Global Tool Configuration
这里写图片描述
系统管理–》系统设置
这里写图片描述

如果设置为5.3 or higher选择,就必须使用sonarQube account token进行连接,这个更安全。
Server authentication token项需要在sonar server端生成
访问sonar server端
菜单–》配置–》权限–》用户–》TOKENS–》Generate 生成token,将生成token添加到此处,完成添加
这里写图片描述

3: 配置nexus2.4
首先修改中央仓库的地址为阿里云地址,提高拉包速度
这里写图片描述

登陆系统,我们自建三个私有库,分别是test01 、pre、 pro,对应我们的三个不同的环境
这里写图片描述

把各个库都加入到public仓库地址,这样才能正常下载到依赖
这里写图片描述


本文由【waitig】发表在等英博客
本文固定链接:Centos7+svn+jenkins+maven+nexus+SonarQube+docker持续集成高级配置(三)
欢迎关注本站官方公众号,每日都有干货分享!
等英博客官方公众号
点赞 (0)分享 (0)