Using the Gradle Enterprise Maven Extension with only the local cache and no Gradle Enterprise servers

Viewed 581

I'm trying to use the gradle-enterprise-maven-extension for Maven. My understanding is that you can decide to use a remote cache via a Gradle Enterprise server and/or a local cache. I wanted to disable any remote cache and enable the local one.

The project configuration of the extension is:

$ cat .mvn/gradle-enterprise.xml
<gradleEnterprise xmlns="https://www.gradle.com/gradle-enterprise-maven" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="https://www.gradle.com/gradle-enterprise-maven https://www.gradle.com/schema/gradle-enterprise-maven.xsd">
  <buildCache>
    <local>
      <enabled>true</enabled>
    </local>
    <remote>
      <enabled>false</enabled>
    </remote>
  </buildCache>
  <buildScan>
    <publish>ON_DEMAND</publish>
    <termsOfService>
      <url>https://gradle.com/terms-of-service</url>
      <accept>false</accept>
    </termsOfService>
  </buildScan>
</gradleEnterprise>

(I didn't accept the terms of service for build scan because I don't want to send the scan outside my company)

When I run maven with the gradle goal logging enabled, the extension notifies my that the build cache is disabled and at the end the $HOME/.m2./.gradle-enterprise/build-cache directory does not exist. This is the command and output:

$ mvn clean verify -Dorg.slf4j.simpleLogger.log.gradle.goal.cache=debug
[DEBUG] Gradle Enterprise Maven Extension: 1.2.8^M
[DEBUG] Not using the build cache: Build caching requires a Gradle Enterprise server and none was specified.

Probably I misunderstood how the extension works. Is a Gradle Enterprise required in order to be able to use the extension? And if yes, why is it needed? Why I can't use a local cache like I would do in Gradle?

1 Answers

The gradle-enterprise-maven-extension, as it name implies, is an enterprise only extension. All of its features require a valid license, checked for by contacting a Gradle Enterprise server.

Unlike the Gradle build tool which offers its caching abilities as part of the open source solution, both local and remote, the Maven extension has no free features.

Related