zoukankan      html  css  js  c++  java
  • 老李分享:持续集成学好jenkins之Git和Maven配置 2

    8.检查代码更新并编译

    可以通过Poll SCM来设置定时检查编译功能

    比如*/5 * * * * 就是每隔5分钟检查一次,如果git仓库中有更新,则执行build操作。

    9.使用Maven私服加快下载速度

    参阅:http://blog.csdn.net/sheismylife/article/details/7209722

    Jenkins的.m2目录路径在:/var/lib/jenkins/.m2/

    先清空所有jar包,后创建settings.xml文件,编辑内容如下:

    <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 in central repo to direct -->

          <!--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 profile active all the time -->

        <activeProfile>nexus</activeProfile>

      </activeProfiles>

    </settings>

    现在点击build now测试一下,打开console output,看看命令行输出结果,如果发现从S1下载jar包,就正确。和不用私服的比较了一下,节省了1分多钟.

  • 相关阅读:
    代码规范总结
    git记住提交密码的技巧
    php foreach遍历
    flight学习笔记
    the resource is not on the build path of a php project
    Google安装postman插件
    PHP开发框架CodeIgniter
    eclipse中php项目开发的环境配置说明
    MyBatis入门篇
    mybatis学习(十二)——mybatis逆向工程
  • 原文地址:https://www.cnblogs.com/poptest/p/5142858.html
Copyright © 2011-2022 走看看