Skip to content

Commit

Permalink
Remove configuration for org.gradle.api.plugins.MavenPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalcolea committed Dec 13, 2022
1 parent 95b5231 commit 8572372
Showing 1 changed file with 0 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package nebula.plugin.extraconfigurations

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.MavenPlugin
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.ivy.IvyPublication
import org.gradle.api.publish.maven.MavenPublication
Expand All @@ -31,7 +30,6 @@ class OptionalBasePlugin implements Plugin<Project> {
enhanceProjectModel(project)
configureMavenPublishPlugin(project)
configureIvyPublishPlugin(project)
configureMavenPlugin(project)
}

/**
Expand Down Expand Up @@ -110,27 +108,4 @@ class OptionalBasePlugin implements Plugin<Project> {
}
}
}

/**
* Configures Maven plugin to ensure that published dependencies receive the optional element.
*
* @param project Project
*/
private void configureMavenPlugin(Project project) {
project.plugins.withType(MavenPlugin) {
// Requires user definition of Maven installer/deployer which could be anywhere in the build script
project.afterEvaluate {
def installers = project.tasks.install.repositories
def deployers = project.tasks.uploadArchives.repositories

(installers + deployers)*.activePomFilters.flatten()*.pomTemplate*.whenConfigured { pom ->
project.ext.optionalDeps.each { optionalDep ->
pom.dependencies.find {
dep -> dep.groupId == optionalDep.group && dep.artifactId == optionalDep.name
}.optional = true
}
}
}
}
}
}

0 comments on commit 8572372

Please sign in to comment.