Skip to content

Commit

Permalink
Gradle legacy Archives are not published (jfrog#748)
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi authored Jul 18, 2023
1 parent effcca7 commit 9c66c86
Showing 1 changed file with 8 additions and 3 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 if (projectHasOneOfComponents(artifactoryTask.project, "java", "javaPlatform")) {
addDefaultPublicationsOrConfigurations(artifactoryTask, publishingExtension);
} else {
addDefaultPublicationsOrConfigurations(artifactoryTask, publishingExtension)
}
}
artifactoryTask.projectEvaluated()
Expand Down Expand Up @@ -210,6 +210,9 @@ 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 @@ -231,7 +234,9 @@ public class ProjectsEvaluatedBuildListener extends BuildAdapter implements Proj

// Add publications to Artifactory task
artifactoryTask.addDefaultPublications()
} else {
} 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.
artifactoryTask.addDefaultArchiveConfiguration()
}
}
Expand Down

0 comments on commit 9c66c86

Please sign in to comment.