File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
buildSrc/src/main/java/org/springframework/gradle/maven Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 6
6
import org .gradle .api .plugins .JavaPlugin ;
7
7
import org .gradle .api .plugins .JavaPluginExtension ;
8
8
import org .gradle .api .publish .PublishingExtension ;
9
+ import org .gradle .api .publish .VariantVersionMappingStrategy ;
10
+ import org .gradle .api .publish .VersionMappingStrategy ;
9
11
import org .gradle .api .publish .maven .MavenPom ;
10
12
import org .gradle .api .publish .maven .MavenPomDeveloperSpec ;
11
13
import org .gradle .api .publish .maven .MavenPomIssueManagement ;
@@ -23,7 +25,20 @@ public void apply(Project project) {
23
25
public void execute (MavenPublishPlugin mavenPublish ) {
24
26
PublishingExtension publishing = project .getExtensions ().getByType (PublishingExtension .class );
25
27
publishing .getPublications ().withType (MavenPublication .class )
26
- .all ((mavenPublication ) -> MavenPublishingConventionsPlugin .this .customizePom (mavenPublication .getPom (), project ));
28
+ .all ((mavenPublication ) -> {
29
+ mavenPublication .versionMapping (new Action <VersionMappingStrategy >() {
30
+ @ Override
31
+ public void execute (VersionMappingStrategy versionStrategy ) {
32
+ versionStrategy .usage ("java-runtime" , new Action <VariantVersionMappingStrategy >() {
33
+ @ Override
34
+ public void execute (VariantVersionMappingStrategy mappingStrategy ) {
35
+ mappingStrategy .fromResolutionResult ();
36
+ }
37
+ });
38
+ }
39
+ });
40
+ MavenPublishingConventionsPlugin .this .customizePom (mavenPublication .getPom (), project );
41
+ });
27
42
MavenPublishingConventionsPlugin .this .customizeJavaPlugin (project );
28
43
}
29
44
});
You can’t perform that action at this time.
0 commit comments