mavenSCM问题

1.配置git/svn地址 (读写权限)

  <scm>
        <connection>scm:git:https://xxxxxxxxxx.git</connection>
        <developerConnection>scm:git:https://xxxxxxxxxx.git</developerConnection>
        <url>https:xxxxxxxxxxxx/master</url>
  </scm>

2.上传地址(可以推送私服)

     <distributionManagement>
        <repository>
            <id>dev.release</id>
            <url>file:F:\software\apache-maven-3.2.3-bin\maven\mavenSCM\</url>
        </repository>
    </distributionManagement>

3.配置release插件scm等

<build>
        <plugins>
   <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <version>1.9.5</version>
                <configuration>
                    <connectionType>developerConnection</connectionType>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
  //可以写上账号密码也可以去掉打包的时候验证
                    <!--<username>xxxxxx</username>
                    <password>xxxxxx</password>-->
                    <tagBase>https:xxxxxxxxxxxx/tags</tagBase>
                    <releaseProfiles>release</releaseProfiles>
                </configuration>
            </plugin>
  <!--打包跳过test-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
    <!--打包跳过javadocs-->
    <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <phase>install</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <encoding>UTF-8</encoding>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>

4.推送tag代码mvn release:prepare,清理mvn release:clean,从tag打包mvn release:perform
5.常用命令mvn scm:update 更新代码和服务器同步。和git的pull效果一样
mvn scm:checkin -Dmessage=""提交代码和git的commit+push一样
mvn scm:diff展现和服务器不同的地方,会有.diff文件查看
mvn scm:validate校验SCM的配置信息是否正确
6.打包推送时有三次命名,重要(第三次命名必须以-SNAPSHOT结尾,maven要求)第一次命名打包名字,第二次tag名字,第三次版本号名字
7.打包推送时mvn release:prepare必须让本地代码和服务器代码同步最新才可以,不然报错。
8.如果你的项目中pom分多个模块,就需要使用命令:release:prepare-with-pom进行打包发布

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值