Code Monkey home page Code Monkey logo

Comments (5)

eitan-rosenberg avatar eitan-rosenberg commented on June 2, 2024

Hi,

I about 130 small projects.

A few years back I face the same problem.

What I did to write a program that collect all the dependencies and create aggregated POM and then run the org.apache.maven.shared.invoker.Invoker to do the job.

I use maven.version.rules = file:///K:/JavaAPPs/MyMaven/maven.version.rules.xml

<ignoreVersions>
	<ignoreVersion type="regex">(?i).*(-alpha|.alpha|beta|-ea|-m1|-m2|-m3|-m4|cr|rc).*</ignoreVersion>
</ignoreVersions>

<rules>
	
	<rule groupId="org.apache.maven.archetypes" artifactId="maven-archetype-quickstart" comparisonMethod="maven">
		<ignoreVersions>
			<ignoreVersion type="regex">(?i).*</ignoreVersion>
		</ignoreVersions>
	</rule>

	<rule groupId="com.google.guava" comparisonMethod="maven">
		<ignoreVersions>
			<ignoreVersion type="regex">(?i).*(android).*</ignoreVersion>
		</ignoreVersions>
	</rule>

	<rule groupId="org.openjfx" comparisonMethod="maven">
		<ignoreVersions>
			<ignoreVersion type="regex">(?i).*(20.0.1).*</ignoreVersion>
		</ignoreVersions>
	</rule>
					
</rules>

Another program use a list of dependencies to scan the projects and for each found run "versions:use-next-releases"

Regards.

p.s. I will be happy to share the code. please let me know.

from versions.

skin27 avatar skin27 commented on June 2, 2024

That's interesting. But the question I still have, why does the default approach not work (the ignore rules and exclude parameters). Is it because submodules are used? Or is it something different?

from versions.

eitan-rosenberg avatar eitan-rosenberg commented on June 2, 2024

I do not use submodules so I can't say.
Have you tried my rules just to omit problems with regular expressions ?

from versions.

eitan-rosenberg avatar eitan-rosenberg commented on June 2, 2024

I copied your rules.
I had to change one so "-ea" will work.

<!-- <ignoreVersion type="regex">.*[-_\.](alpha|Alpha|ALPHA|b|beta|Beta|BETA|rc|RC|M|EA)[-_\.]?[0-9]*</ignoreVersion> -->
	<ignoreVersion type="regex">(?i).*(alpha|Alpha|ALPHA|b|beta|Beta|BETA|rc|RC|M|EA).*</ignoreVersion>

from versions.

skin27 avatar skin27 commented on June 2, 2024

I found out that (probably due to a misconfiguration) the rules.xml wasn't applied. So even when I made the XML file invalid it didn't give an error.

The configuration that worked for me was:

project pom.xml

	<properties>
		<maven.versions.rules>file:///${project.basedir}/rules.xml</maven.versions.rules>
	<properties>
        
        <build>
          <plugins>         
            <plugin>
                  <groupId>org.codehaus.mojo</groupId>
                  <artifactId>versions-maven-plugin</artifactId>
                  <version>2.15.0</version>
                  <configuration>
                      <rulesUri>${maven.versions.rules}</rulesUri>
                  </configuration>
            </plugin> 
        </plugins>
    </build>

pom.xml for every submodule

    <properties>
    	<maven.versions.rules>file:///${project.basedir}/../rules.xml</maven.versions.rules>
    </properties>

Thanks for your help

from versions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.