Skip to content

Commit d85f7c2

Browse files
committed
Apply License File to Each Jar
Issue gh-1176
1 parent 2845a22 commit d85f7c2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

buildSrc/src/main/groovy/io/spring/gradle/convention/SpringModulePlugin.groovy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import org.gradle.api.JavaVersion
2020
import org.gradle.api.Project
2121
import org.gradle.api.plugins.JavaLibraryPlugin
2222
import org.gradle.api.plugins.PluginManager
23+
import org.gradle.api.tasks.bundling.Jar
2324
import org.springframework.gradle.maven.SpringMavenPlugin
2425

2526
/**
@@ -41,6 +42,11 @@ class SpringModulePlugin extends AbstractSpringJavaPlugin {
4142
deployArtifacts.dependsOn project.tasks.artifactoryPublish
4243
}
4344
project.java.sourceCompatibility = JavaVersion.VERSION_17
45+
project.tasks.withType(Jar) {
46+
from(project.rootProject.files('LICENSE.txt')) {
47+
into('META-INF')
48+
}
49+
}
4450
}
4551

4652
}

0 commit comments

Comments
 (0)