• 项目中应用snapshot和release库


    应用snapshot和release库达到不同环境下发布不同的版本的目的:

    1,自动打包到私服:

    在pom.xml中配置

    <!-- 配置maven部署库:在distributionManagement段中配置的是snapshot快照库和release发布库的地址-->
    <distributionManagement>
    <repository>
    <id>releases</id>
    <url>${nexus.root}/content/repositories/releases</url>
    </repository>
    <snapshotRepository>
    <id>snapshots</id>
    <url>${nexus.root}/content/repositories/snapshots</url>
    </snapshotRepository>
    </distributionManagement>

    <!-- 参数配置 -->
    <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <nexus.root>http://192.168.0.15:8081/nexus</nexus.root>
    </properties>

    cmd控制台切换到pom.xml项目空间下:

    执行命令: mvn deploy   就可以将当前项目打成所需要的格式自动上传到0.15私服里面.

    2,启动项目自动更新最新的包:

    配置maven的setting文件

    添加如下代码:

    (1)配置servers:

    <server>
    <id>thirdparty</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>

    (2)配置profiles:

    <profile>
    <id>nexus</id>
    <repositories>
    <repository>
    <id>public</id>
    <url>http://192.168.0.15:8081/nexus/content/groups/public/</url>
    <release><enabled>true</enabled></release>
    <snapshots>
    <enabled>true</enabled>
    <updatePolicy>always</updatePolicy>
    <checksumPolicy>warn</checksumPolicy>
    </snapshots>
    </repository>
    </repositories>
    <pluginRepositories>
    <pluginRepository>
    <id>public</id>
    <url>http://192.168.0.15:8081/nexus/content/groups/public/</url>
    <release><enabled>true</enabled></release>
    <snapshots>
    <enabled>true></enabled>
    <updatePolicy>always</updatePolicy>
    <checksumPolicy>warn</checksumPolicy>
    </snapshots>
    </pluginRepository>
    </pluginRepositories>
    </profile>

  • 相关阅读:
    快捷键 Msg消息
    类 多态(迟绑定)
    DLL发布 matlab代码发布
    获取ini内容 GetPrivateProfileString GetPrivateProfileInt
    路径操作 getModuleFileName() 等
    事件高级
    JS事件基础
    运动框架
    运动小宗
    workman安装使用
  • 原文地址:https://www.cnblogs.com/lkzp123456/p/6428597.html
Copyright © 2020-2023  润新知