2

The Maven Versions Plugin supports the defintion of rules to customize the version resolution process for goals as versions:display-plugin-updates or versions:display-dependency-updates. The location of the rules file can be specified by the rulesUri and the functionality behind this is provided by Maven Wagon.

Therefore I would like to know if it is also supported to provide a rule set within a Jar? I would like to one rule set for multiple projects.

Oliver
  • 3,815
  • 8
  • 35
  • 63
  • No at the moment not..But you can create a [issue](https://github.com/mojohaus/versions-maven-plugin/issues) and maybe you can offer a pull request?... – khmarbaise Jul 31 '17 at 10:31
  • I will have a look at the sources to see how much effort it is to create a PR. – Oliver Jul 31 '17 at 11:25
  • @khmarbaise I had a look at the source code of the versions plugin and it seems to be easy to add the needed functionality. I will create an issue for this and an PR in the next days. – Oliver Jul 31 '17 at 20:38
  • I created issue [#193](https://github.com/mojohaus/versions-maven-plugin/issues/193) on GitHub for this. – Oliver Aug 05 '17 at 17:57

1 Answers1

0

A patch by me has been released with version 2.5 of the Versions Maven Plugin

Now it is possible to create a version rules file and to place it on the classpath.

This example below shows how to reference a rules file called rules.xml which is provided in a jar on the classpath:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>versions-maven-plugin</artifactId>
    <version>2.7</version>
    <executions>
        <execution>
            <id>default-cli</id>
            <configuration>
                <rulesUri>classpath:///rules.xml</rulesUri>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>                                
            <groupId>your.organisation</groupId>
            <artifactId>rulesspec</artifactId>
            <version>1234</version>
        </dependency>
    </dependencies>
</plugin>

Please keep in mind that the provided URI must start with classpath://.

Oliver
  • 3,815
  • 8
  • 35
  • 63