1

We having a problem trying to commit changes, which happens with maven. Because they are in target folder how could we do it?

Replacing via resources filtering. In properties we've got

<BUILD_VERSION>version-1.0.0</BUILD_VERSION>

that's our property and also such marker occurs in some files - after changing them we should commit it to git

<resource>
    <directory>.</directory>
    <filtering>true</filtering>
</resource> 

Also we doing whole release via maven release plugin, so the final command looks like

mvn clean release:prepare release:perform 

This release plugin is using scm:

<plugin>
    <artifactId>maven-scm-plugin</artifactId>
        <version>${maven-scm-plugin.version}</version>
        <configuration>
            <message>SCM commit</message>
        </configuration>
        <executions>
            <execution>
            <phase>deploy</phase>
            <goals>
                <goal>checkin</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Adding includes and excludes properties to scm plugin didn't help us.

How to do back-commit after those changes? Or how can we change our files and then commit those changes, will maven replacer plugin help?

lummycoder
  • 588
  • 1
  • 7
  • 20
  • Can you elaborate a little bit more for which purpose you need to use those properties. The version is in the pom file and can be used for filtering which can result in a jar/zip which contains the filtered values ? – khmarbaise Apr 17 '15 at 14:58
  • We've got not only java projects, but oracle also and smth other. So in those files we need to change those markers. But not only in poms. For poms we're doing great. – lummycoder Apr 17 '15 at 15:05
  • Where are thos files located? Inside the jar's / war/ ear 's ? – khmarbaise Apr 17 '15 at 15:36
  • Zip with diffs as I know. – lummycoder Apr 17 '15 at 16:16
  • **Vote** for [this feature request](https://issues.apache.org/jira/browse/MRELEASE-798) – Vivek Apr 18 '21 at 09:03

1 Answers1

1

I don't think you can get them committed to git by the maven-release-plugin, it has no hook for this purpose.

You put all those properties into jar files which get released as part of the release. So the released versions of the jar file(s) contain the property files with the substituted values, and at runtime you get them from the classpath.

bmargulies
  • 97,814
  • 39
  • 186
  • 310