@@ -17,7 +17,6 @@ package nebula.plugin.extraconfigurations
1717
1818import org.gradle.api.Plugin
1919import org.gradle.api.Project
20- import org.gradle.api.plugins.MavenPlugin
2120import org.gradle.api.publish.PublishingExtension
2221import org.gradle.api.publish.ivy.IvyPublication
2322import org.gradle.api.publish.maven.MavenPublication
@@ -31,7 +30,6 @@ class OptionalBasePlugin implements Plugin<Project> {
3130 enhanceProjectModel(project)
3231 configureMavenPublishPlugin(project)
3332 configureIvyPublishPlugin(project)
34- configureMavenPlugin(project)
3533 }
3634
3735 /**
@@ -110,27 +108,4 @@ class OptionalBasePlugin implements Plugin<Project> {
110108 }
111109 }
112110 }
113-
114- /**
115- * Configures Maven plugin to ensure that published dependencies receive the optional element.
116- *
117- * @param project Project
118- */
119- private void configureMavenPlugin (Project project ) {
120- project. plugins. withType(MavenPlugin ) {
121- // Requires user definition of Maven installer/deployer which could be anywhere in the build script
122- project. afterEvaluate {
123- def installers = project. tasks. install. repositories
124- def deployers = project. tasks. uploadArchives. repositories
125-
126- (installers + deployers)* . activePomFilters. flatten()* . pomTemplate* . whenConfigured { pom ->
127- project. ext. optionalDeps. each { optionalDep ->
128- pom. dependencies. find {
129- dep -> dep. groupId == optionalDep. group && dep. artifactId == optionalDep. name
130- }. optional = true
131- }
132- }
133- }
134- }
135- }
136111}
0 commit comments