Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Commit some files while maven release:prepare

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

like image 627
bennixview Avatar asked May 14 '12 12:05

bennixview


2 Answers

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>
like image 123
bennixview Avatar answered Nov 10 '22 23:11

bennixview


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

like image 44
Michał Kalinowski Avatar answered Nov 11 '22 00:11

Michał Kalinowski