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

bennixview
  • 91
  • 7
  • **Vote** for [this feature request](https://issues.apache.org/jira/browse/MRELEASE-798) – Vivek Apr 18 '21 at 09:02

2 Answers2

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>
bennixview
  • 91
  • 7
  • Depending on the use case you might want to commit the files during the *completion* of the preparation step. To do so use `` instead of ``. See also [documentation](http://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#completionGoals). – schnatterer Nov 25 '14 at 21:35
1

Try to use scm:add goal. Should work.

More information:
http://maven.apache.org/scm/plugins/add-mojo.html
http://maven.apache.org/scm/plugins/usage.html

Michał Kalinowski
  • 16,925
  • 5
  • 35
  • 48
  • The sql file is already added before release. and Modified after release but not commited. – bennixview May 14 '12 at 13:59
  • 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=./.../... – bennixview May 14 '12 at 14:54