Skip to content

Commit 3f694f8

Browse files
authored
Revert "Gradle legacy Archives are not published (#748)" (#752)
1 parent ae542c3 commit 3f694f8

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

build-info-extractor-gradle/src/main/groovy/org/jfrog/gradle/plugin/artifactory/extractor/listener/ProjectsEvaluatedBuildListener.groovy

+3-8
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ public class ProjectsEvaluatedBuildListener extends BuildAdapter implements Proj
148148
String publicationsNames = clientConfig.publisher.getPublications()
149149
if (publishingExtension != null && StringUtils.isNotBlank(publicationsNames)) {
150150
addPublications(artifactoryTask, publishingExtension, publicationsNames)
151-
} else {
152-
addDefaultPublicationsOrConfigurations(artifactoryTask, publishingExtension)
151+
} else if (projectHasOneOfComponents(artifactoryTask.project, "java", "javaPlatform")) {
152+
addDefaultPublicationsOrConfigurations(artifactoryTask, publishingExtension);
153153
}
154154
}
155155
artifactoryTask.projectEvaluated()
@@ -210,9 +210,6 @@ public class ProjectsEvaluatedBuildListener extends BuildAdapter implements Proj
210210
*/
211211
private void addDefaultPublicationsOrConfigurations(ArtifactoryTask artifactoryTask, @Nullable PublishingExtension publishingExtension) {
212212
if (publishingExtension != null) {
213-
if (!projectHasOneOfComponents(artifactoryTask.project, "java", "javaPlatform")) {
214-
return
215-
}
216213
Project project = artifactoryTask.project;
217214
// Add mavenWeb publication if war task exists and enabled
218215
Task warTask = project.tasks.findByName("war");
@@ -234,9 +231,7 @@ public class ProjectsEvaluatedBuildListener extends BuildAdapter implements Proj
234231

235232
// Add publications to Artifactory task
236233
artifactoryTask.addDefaultPublications()
237-
} else if (artifactoryTask.project.plugins.hasPlugin("maven")) {
238-
// Only if the legacy Maven plugin is applied, add the default legacy Archive Configurations.
239-
// The purpose of this filter is to prevent the addition of legacy Archive Configurations when using new Gradle versions.
234+
} else {
240235
artifactoryTask.addDefaultArchiveConfiguration()
241236
}
242237
}

0 commit comments

Comments
 (0)