我想使用 maven scm 插件(v1.9.4)在不同的文件夹中 git 提交两个文件。例如:abc/p.json
and xyz\p.json
。我不想提交任何其他文件,例如other/p.json
根据文档 http://maven.apache.org/scm-archives/scm-1.9.4/maven-scm-plugin/checkin-mojo.html为了chekin
目标,逗号分隔的列表,例如abc/p.json,xyz/p.json
应该管用。但它最终会提交所有文件。
我正在使用scm:checkin
Maven 发布插件的目标<preparationGoals>
配置。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${maven.release.plugin.version}</version>
<configuration>
<preparationGoals>
clean verify
scm:checkin -DpushChanges=false -Dmessage="[maven-release-plugin] Update version text"
-Dincludes="abc/p.json,xyz/p.json"
</configuration>
</plugin>
我如何提交abc/p.json
and xyz/p.json
files?
我能够通过创建配置文件来获取签入的文件列表,类似于:
<profile>
<id>commit-changed-files</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<configuration>
<includes>file1,file2,file3,file4</includes>
<message>[maven-release-plugin] commit changed files</message>
<pushChanges>false</pushChanges><!-- because I use git -->
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
然后,在发布插件配置中:
<preparationGoals>-Pcommit-changed-files clean scm:add scm:checkin</preparationGoals>
<completionGoals>-Pcommit-changed-files clean scm:add scm:checkin</completionGoals>
参考:formatter-m2e-configurator 的 pom.xml https://github.com/revelc/formatter-m2e-configurator/blob/master/pom.xml
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)