diff --git a/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java b/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java index 57600824aef..87fe48391c6 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java @@ -73,6 +73,8 @@ import org.gradle.jvm.toolchain.JavaLanguageVersion; import org.springframework.boot.build.architecture.ArchitecturePlugin; import org.springframework.boot.build.classpath.CheckClasspathForProhibitedDependencies; import org.springframework.boot.build.optional.OptionalDependenciesPlugin; +import org.springframework.boot.build.properties.BuildProperties; +import org.springframework.boot.build.properties.BuildType; import org.springframework.boot.build.springframework.CheckAotFactories; import org.springframework.boot.build.springframework.CheckSpringFactories; import org.springframework.boot.build.testing.TestFailuresPlugin; @@ -172,12 +174,16 @@ class JavaConventions { } private void configureJarManifestConventions(Project project) { + BuildType buildType = BuildProperties.get(project).buildType(); + String license = (buildType == BuildType.OPEN_SOURCE) ? "Apache License, Version 2.0" + : "Broadcom Foundation License"; TaskProvider extractLegalResources = project.getTasks() .register("extractLegalResources", ExtractResources.class, (task) -> { task.getPackageName().set("org.springframework.boot.build.legal"); task.getDestinationDirectory().set(project.getLayout().getBuildDirectory().dir("legal")); task.getResourceNames().set(Arrays.asList("LICENSE.txt", "NOTICE.txt")); task.getProperties().put("version", project.getVersion().toString()); + task.getProperties().put("license", license); }); SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); Set sourceJarTaskNames = sourceSets.stream() diff --git a/buildSrc/src/main/resources/org/springframework/boot/build/legal/NOTICE.txt b/buildSrc/src/main/resources/org/springframework/boot/build/legal/NOTICE.txt index 14f53a2659b..70b02d71088 100644 --- a/buildSrc/src/main/resources/org/springframework/boot/build/legal/NOTICE.txt +++ b/buildSrc/src/main/resources/org/springframework/boot/build/legal/NOTICE.txt @@ -1,6 +1,6 @@ Spring Boot ${version} Copyright (c) 2012-2026 VMware, Inc. -This product is licensed to you under the Apache License, Version 2.0 +This product is licensed to you under the ${license} (the "License"). You may not use this product except in compliance with the License. \ No newline at end of file