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分多钟.

  • 相关阅读:
    每个android项目都应该使用的android 库
    解决android锁屏或解锁后activity重启的问题
    Git提交时提示‘The file will have its original line endings in your working directory’
    homestead虚拟机,通过npm下载依赖包和解决运行gulp报错问题 yarn出错问题
    免费获取验证码60秒倒计时
    html5表单验证(Bootstrap)
    jQuery 创建html
    HTML5中音频视频标签使用
    分享到朋友圈遮罩层
    TP细节总结1
  • 原文地址:https://www.cnblogs.com/poptest/p/5142858.html
Copyright © 2011-2022 走看看