Commit some files while maven release:prepare
Asked Answered
D

2

6

Is it possible to commit some file (no pom.xml) while mvn release:prepare?

In My MultiModul Project I configured the rlease plugin with preparationGoals to change the Version in a sql file.

<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>

Everything works fine but the changed sql File will not be commited.

The sql File is in a subdirectory of the parent Folder. There are no pom.xml

Diuresis answered 14/5, 2012 at 12:34 Comment(1)
Vote for this feature requestCaplan
D
3

I use now a scm:checkin in the 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 scm:checkin -Dmessage="..." -DworkingDirectory=./.../...

But that is not the same Commit as what the pom.xml 's commited. This leads to that a mvn rlelease:rollback don't roll back the first commit in preparation goals!

It now look like these :

        <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>
Diuresis answered 15/5, 2012 at 10:41 Comment(1)
Depending on the use case you might want to commit the files during the completion of the preparation step. To do so use <completionGoals> instead of <preparationGoals>. See also documentation.Inevitable
A
1

Try to use the scm:add goal. Should work.

More information:

Admiralty answered 14/5, 2012 at 12:49 Comment(2)
The sql file is already added before release. and Modified after release but not commited.Diuresis
<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 scm:checkin -Dmessage="..." -DworkingDirectory=./.../...</preparationGoals>Diuresis

© 2022 - 2024 — McMap. All rights reserved.