使用Maven Build Helper插件跳过部署目标

时间:2018-07-17 12:58:30

标签: java maven maven-plugin maven-release-plugin build-helper-maven-plugin

我当前在一个简单的Java项目中使用Maven Build Helper插件(为什么我使用插件here的完整上下文)。

pom.xml文件如下所示:

http://maven.apache.org/xsd/maven-4.0.0.xsd“>     4.0.0

<groupId>org.ea</groupId>
<artifactId>VersioningDemo</artifactId>
<version>1.25.0-SNAPSHOT</version>

<properties>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.source>1.8</maven.compiler.source>
    <encoding>UTF-8</encoding>
    <project.build.sourceEncoding>${encoding}</project.build.sourceEncoding>
    <project.reporting.outputEncoding>${encoding}</project.reporting.outputEncoding>
    <project.resources.sourceEncoding>${encoding}</project.resources.sourceEncoding>
    <archetype.encoding>${encoding}</archetype.encoding>
</properties>

<scm>
    <connection>scm:git:ssh://git@my-remote-repo:7999/bddo/versioningdemo.git</connection>
    <developerConnection>scm:git:ssh://git@my-remote-repo:7999/bddo/versioningdemo.git</developerConnection>
    <url>https://my-remote-repo/projects/BDDO/repos/versioningdemo/browse</url>
    <tag>VersioningDemo-1.14.2</tag>
</scm>

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>3.0.0</version>
            <configuration>
                <checkModificationExcludes>
                    <checkModificationExclude>pom.xml</checkModificationExclude>
                </checkModificationExcludes>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.0.0</version>
            <configuration>
                <archive>
                    <manifest>
                        <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        <mainClass>org.ea.VersioningDemo</mainClass>
                    </manifest>
                </archive>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

我有两个问题: 1.当我运行mvn build-helper:parse-version versions:set release:prepare -B -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.0-SNAPSHOT release:perform更改下一个版本时,本地pom.xml文件会相应地增加版本,但更改不会传播到远程存储库。 2.上一步中的同一命令在最后部分失败,因为它尝试运行我不希望的maven-deploy-plugin目标。

如何跳过部署部分?另外,将pom.xml文件配置为具有maven build-helper插件的正确方法是仅执行发行增量,将更改推送到远程仓库并相应地创建标签?我只对发布管理感兴趣,而不对部署感兴趣。

0 个答案:

没有答案