Merge branch '2.5.x' into 2.6.x
Closes gh-30213
This commit is contained in:
@@ -133,7 +133,7 @@ final class JavaPluginAction implements PluginApplicationAction {
|
||||
|
||||
private void configureArtifactPublication(TaskProvider<BootJar> bootJar) {
|
||||
LazyPublishArtifact artifact = new LazyPublishArtifact(bootJar);
|
||||
this.singlePublishedArtifact.addCandidate(artifact);
|
||||
this.singlePublishedArtifact.addJarCandidate(artifact);
|
||||
}
|
||||
|
||||
private void configureBootRunTask(Project project) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -38,14 +38,22 @@ final class SinglePublishedArtifact implements Buildable {
|
||||
this.artifacts = artifacts;
|
||||
}
|
||||
|
||||
void addCandidate(PublishArtifact candidate) {
|
||||
if (this.currentArtifact == null || "war".equals(candidate.getExtension())) {
|
||||
this.artifacts.remove(this.currentArtifact);
|
||||
this.artifacts.add(candidate);
|
||||
this.currentArtifact = candidate;
|
||||
void addWarCandidate(PublishArtifact candidate) {
|
||||
add(candidate);
|
||||
}
|
||||
|
||||
void addJarCandidate(PublishArtifact candidate) {
|
||||
if (this.currentArtifact == null) {
|
||||
add(candidate);
|
||||
}
|
||||
}
|
||||
|
||||
private void add(PublishArtifact artifact) {
|
||||
this.artifacts.remove(this.currentArtifact);
|
||||
this.artifacts.add(artifact);
|
||||
this.currentArtifact = artifact;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaskDependency getBuildDependencies() {
|
||||
return this.artifacts.getBuildDependencies();
|
||||
|
||||
@@ -108,7 +108,7 @@ class WarPluginAction implements PluginApplicationAction {
|
||||
|
||||
private void configureArtifactPublication(TaskProvider<BootWar> bootWar) {
|
||||
LazyPublishArtifact artifact = new LazyPublishArtifact(bootWar);
|
||||
this.singlePublishedArtifact.addCandidate(artifact);
|
||||
this.singlePublishedArtifact.addWarCandidate(artifact);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user