Skip to content

Commit

Permalink
Revert "Gradle legacy Archives are not published (#748)" (#752)
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi authored Jul 30, 2023
1 parent ae542c3 commit 3f694f8
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ public class ProjectsEvaluatedBuildListener extends BuildAdapter implements Proj
String publicationsNames = clientConfig.publisher.getPublications()
if (publishingExtension != null && StringUtils.isNotBlank(publicationsNames)) {
addPublications(artifactoryTask, publishingExtension, publicationsNames)
} else {
addDefaultPublicationsOrConfigurations(artifactoryTask, publishingExtension)
} else if (projectHasOneOfComponents(artifactoryTask.project, "java", "javaPlatform")) {
addDefaultPublicationsOrConfigurations(artifactoryTask, publishingExtension);
}
}
artifactoryTask.projectEvaluated()
Expand Down Expand Up @@ -210,9 +210,6 @@ public class ProjectsEvaluatedBuildListener extends BuildAdapter implements Proj
*/
private void addDefaultPublicationsOrConfigurations(ArtifactoryTask artifactoryTask, @Nullable PublishingExtension publishingExtension) {
if (publishingExtension != null) {
if (!projectHasOneOfComponents(artifactoryTask.project, "java", "javaPlatform")) {
return
}
Project project = artifactoryTask.project;
// Add mavenWeb publication if war task exists and enabled
Task warTask = project.tasks.findByName("war");
Expand All @@ -234,9 +231,7 @@ public class ProjectsEvaluatedBuildListener extends BuildAdapter implements Proj

// Add publications to Artifactory task
artifactoryTask.addDefaultPublications()
} else if (artifactoryTask.project.plugins.hasPlugin("maven")) {
// Only if the legacy Maven plugin is applied, add the default legacy Archive Configurations.
// The purpose of this filter is to prevent the addition of legacy Archive Configurations when using new Gradle versions.
} else {
artifactoryTask.addDefaultArchiveConfiguration()
}
}
Expand Down

0 comments on commit 3f694f8

Please sign in to comment.