在maven发布时提交一些文件:准备

问题描述 投票:0回答:2

是否可以在 mvn release:prepare 时提交一些文件(没有 pom.xml)?

在我的 MultiModul 项目中,我使用 PreparationGoals 配置了 rlease 插件来更改 sql 文件中的版本。

<preparationGoals>clean verify org.codehaus.mojo:build-helper-maven-plugin:1.5:parse-version com.google.code.maven-replacer-plugin:replacer:1.5.0:replace</preparationGoals>

一切正常,但更改后的 sql 文件将不会被提交。

sql 文件位于父文件夹的子目录中。没有 pom.xml

maven release commit prepare
2个回答
3
投票

我现在使用 scm:checkin 准备目标

清理验证 org.codehaus.mojo:build-helper-maven-plugin:1.5:parse-version com.google.code.maven-replacer-plugin:replacer:1.5.0:replace scm:checkin -Dmessage=".. ." -DworkingDirectory=./.../...

但这与 pom.xml 的提交不同。 这导致 mvn rlelease:rollback 不会回滚准备目标中的第一个提交!

现在看起来像这样:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <configuration>
                <tagBase>
                    ......
                </tagBase>
                <autoVersionSubmodules>true</autoVersionSubmodules>
                <arguments>-Dtest='*IT,*Test' -DfailIfNoTests=false</arguments>
                <tagNameFormat>@{project.version}</tagNameFormat>
                <preparationGoals>clean verify org.codehaus.mojo:build-helper-maven-plugin:parse-version com.google.code.maven-replacer-plugin:replacer:replace scm:checkin -Dmessage="Version in Komponentenversion.sql incrementiert" -DworkingDirectory=./db/include</preparationGoals>
            </configuration>
        </plugin>

1
投票
© www.soinside.com 2019 - 2024. All rights reserved.