2020import org .gradle .api .Plugin ;
2121import org .gradle .api .Project ;
2222import org .gradle .api .artifacts .Configuration ;
23- import org .gradle .api .artifacts .ResolutionStrategy ;
2423import org .gradle .api .file .FileCollection ;
2524import org .gradle .api .plugins .JavaBasePlugin ;
2625import org .gradle .api .plugins .JavaPluginExtension ;
@@ -64,7 +63,6 @@ public void apply(Project project) {
6463 project .getPluginManager ().apply (ElasticsearchTestBasePlugin .class );
6564 project .getPluginManager ().apply (PrecommitTaskPlugin .class );
6665 project .getPluginManager ().apply (MutedTestPlugin .class );
67- configureConfigurations (project );
6866 configureCompile (project );
6967 configureInputNormalization (project );
7068 configureNativeLibraryPath (project );
@@ -73,37 +71,6 @@ public void apply(Project project) {
7371 project .getExtensions ().getExtraProperties ().set ("versions" , VersionProperties .getVersions ());
7472 }
7573
76- /**
77- * Makes dependencies non-transitive.
78- * <p>
79- * Gradle allows setting all dependencies as non-transitive very easily.
80- * Sadly this mechanism does not translate into maven pom generation. In order
81- * to effectively make the pom act as if it has no transitive dependencies,
82- * we must exclude each transitive dependency of each direct dependency.
83- * <p>
84- * Determining the transitive deps of a dependency which has been resolved as
85- * non-transitive is difficult because the process of resolving removes the
86- * transitive deps. To sidestep this issue, we create a configuration per
87- * direct dependency version. This specially named and unique configuration
88- * will contain all of the transitive dependencies of this particular
89- * dependency. We can then use this configuration during pom generation
90- * to iterate the transitive dependencies and add excludes.
91- */
92- public static void configureConfigurations (Project project ) {
93- // we are not shipping these jars, we act like dumb consumers of these things
94- if (project .getPath ().startsWith (":test:fixtures" ) || project .getPath ().equals (":build-tools" )) {
95- return ;
96- }
97- // fail on any conflicting dependency versions
98- project .getConfigurations ().all (configuration -> {
99- if (configuration .getName ().endsWith ("Fixture" )) {
100- // just a self contained test-fixture configuration, likely transitive and hellacious
101- return ;
102- }
103- configuration .resolutionStrategy (ResolutionStrategy ::failOnVersionConflict );
104- });
105- }
106-
10774 /**
10875 * Adds compiler settings to the project
10976 */
0 commit comments