Home > database >  Using maven-build-cache-extension and running into compatibility issues
Using maven-build-cache-extension and running into compatibility issues

Time:01-03

I guess this is relatively new, so I added this extension in my .mvn/extensions.xml

And it's complaining [WARNING] Cache requires Maven >= 3.9, but version is 3.8.1. Disabling cache.

But when I look for the latest maven, it's 3.8.6... there's 4.x, but it's in the beta channel and it's incompatible with v3 enforcers. Anyone resolve this in the past?

<extensions>
  <extension>
    <groupId>org.apache.maven.extensions</groupId>
    <artifactId>maven-build-cache-extension</artifactId>
    <version>1.0.1-SNAPSHOT</version>
  </extension>
</extensions>

CodePudding user response:

https://github.com/apache/maven-build-cache-extension/blob/master/pom.xml#L487

The extension has this in their pom:

<profile>
    <id>maven3</id>
    <properties>
        <mavenVersion>3.9.0-SNAPSHOT</mavenVersion>
        <maven.dir>maven3</maven.dir
        <maven.basedir>${project.build.directory}/${maven.dir}</maven.basedir
    </properties>
</profile>

And this in the readme:

The code currently relies on un-released modifications in the core Maven project, available both for latest 3.9.x and for 4.0-alpha-x SNAPSHOTS described in MNG-7391.

So you can run with mvn -Pmaven3 ... to use Maven 3.9.0-SNAPSHOT. There is no released version of Maven that will work with this extension besides >= 3.9.0.

CodePudding user response:

You’re right, at this point need to use 3.9 or 4.0 snapshots. Official snapshots builds could be found in Apache snapshots repository - https://repository.apache.org/content/groups/snapshots/org/apache/maven/apache-maven/

Also, it is more convenient to use Maven Wrapper to bootstrap snapshot version - just point url to the latest snapshot.

  • Related