diff --git a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/GitInfoPlugin.java b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/GitInfoPlugin.java index 8a1e3cabf890..28b90714508b 100644 --- a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/GitInfoPlugin.java +++ b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/GitInfoPlugin.java @@ -44,7 +44,7 @@ class GitInfoPlugin implements Plugin { gitInfo.disallowChanges(); gitInfo.finalizeValueOnRead(); - revision = gitInfo.map(info -> info.getRevision() == null ? info.getRevision() : "master"); + revision = gitInfo.map(info -> info.getRevision() == null ? info.getRevision() : "main"); } public Property getGitInfo() { diff --git a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/LicensingPlugin.java b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/LicensingPlugin.java index 92ce2a3658a0..ba170d083c88 100644 --- a/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/LicensingPlugin.java +++ b/build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/LicensingPlugin.java @@ -21,6 +21,7 @@ import java.util.Map; public class LicensingPlugin implements Plugin { static final String ELASTIC_LICENSE_URL_PREFIX = "https://raw.githubusercontent.com/elastic/elasticsearch/"; static final String ELASTIC_LICENSE_URL_POSTFIX = "/licenses/ELASTIC-LICENSE-2.0.txt"; + static final String AGPL_ELASTIC_LICENSE_URL_POSTFIX = "/licenses/AGPL-3.0+SSPL-1.0+ELASTIC-LICENSE-2.0.txt"; private ProviderFactory providerFactory; @@ -36,15 +37,18 @@ public class LicensingPlugin implements Plugin { isSnapshotVersion(project) ? revision.get() : "v" + project.getVersion() ); - Provider projectLicenseURL = licenseCommitProvider.map(licenseCommit -> ELASTIC_LICENSE_URL_PREFIX + + Provider elasticLicenseURL = licenseCommitProvider.map(licenseCommit -> ELASTIC_LICENSE_URL_PREFIX + licenseCommit + ELASTIC_LICENSE_URL_POSTFIX); + Provider agplLicenseURL = licenseCommitProvider.map(licenseCommit -> ELASTIC_LICENSE_URL_PREFIX + + licenseCommit + AGPL_ELASTIC_LICENSE_URL_POSTFIX); // But stick the Elastic license url in project.ext so we can get it if we need to switch to it - project.getExtensions().getExtraProperties().set("elasticLicenseUrl", projectLicenseURL); + project.getExtensions().getExtraProperties().set("elasticLicenseUrl", elasticLicenseURL); MapProperty licensesProperty = project.getObjects().mapProperty(String.class, String.class).convention( providerFactory.provider(() -> Map.of( "Server Side Public License, v 1", "https://www.mongodb.com/licensing/server-side-public-license", - "Elastic License 2.0", projectLicenseURL.get()) + "Elastic License 2.0", elasticLicenseURL.get(), + "GNU Affero General Public License Version 3", agplLicenseURL.get()) ) ); diff --git a/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/PublishPluginFuncTest.groovy b/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/PublishPluginFuncTest.groovy index e275a56682c0..c0b85ed7450f 100644 --- a/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/PublishPluginFuncTest.groovy +++ b/build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/PublishPluginFuncTest.groovy @@ -74,6 +74,11 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest { https://www.mongodb.com/licensing/server-side-public-license repo + + The OSI-approved Open Source license Version 3.0 + https://raw.githubusercontent.com/elastic/elasticsearch/v1.0/licenses/AGPL-3.0+SSPL-1.0+ELASTIC-LICENSE-2.0.txt + repo + @@ -149,6 +154,11 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest { https://www.mongodb.com/licensing/server-side-public-license repo + + The OSI-approved Open Source license Version 3.0 + https://raw.githubusercontent.com/elastic/elasticsearch/v1.0/licenses/AGPL-3.0+SSPL-1.0+ELASTIC-LICENSE-2.0.txt + repo + @@ -233,6 +243,11 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest { https://www.mongodb.com/licensing/server-side-public-license repo + + The OSI-approved Open Source license Version 3.0 + https://raw.githubusercontent.com/elastic/elasticsearch/v1.0/licenses/AGPL-3.0+SSPL-1.0+ELASTIC-LICENSE-2.0.txt + repo + @@ -326,6 +341,11 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest { https://www.mongodb.com/licensing/server-side-public-license repo + + The OSI-approved Open Source license Version 3.0 + https://raw.githubusercontent.com/elastic/elasticsearch/v1.0/licenses/AGPL-3.0+SSPL-1.0+ELASTIC-LICENSE-2.0.txt + repo + @@ -399,6 +419,11 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest { https://www.mongodb.com/licensing/server-side-public-license repo + + The OSI-approved Open Source license Version 3.0 + https://raw.githubusercontent.com/elastic/elasticsearch/v2.0/licenses/AGPL-3.0+SSPL-1.0+ELASTIC-LICENSE-2.0.txt + repo +