条件提交maven-scm-plugin

时间:2016-10-27 09:49:58

标签: git maven maven-release-plugin maven-scm

如果没有更改,有没有办法不将test.html提交给scm?

因为,当您使用 git commit 提交未更改的文件时,它会提供 无需提交

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-scm-plugin</artifactId>
    <version>1.9.2</version>
    <configuration>
        <connectionType>connection</connectionType>
    </configuration>
    <inherited>false</inherited>
    <executions>
        <execution>
            <id>add-version-to-git</id>
            <phase>package</phase>
            <goals>
                <goal>checkin</goal>
            </goals>
            <configuration>
                <basedir>${project.basedir}</basedir>
                <includes>test.html</includes>
                <message>Test HTML Update</message>
            </configuration>
        </execution>
    </executions>
</plugin>

1 个答案:

答案 0 :(得分:0)

可以使用Maven配置文件激活,例如:

<activation>
    <property>
        <name>testChanged</name>
    </property>
</activation>  

testChanged 属性可以设置在进行更改的位置。