20
20
import org .gradle .api .Plugin ;
21
21
import org .gradle .api .Project ;
22
22
import org .gradle .api .artifacts .Configuration ;
23
- import org .gradle .api .artifacts .ResolutionStrategy ;
24
23
import org .gradle .api .file .FileCollection ;
25
24
import org .gradle .api .plugins .JavaBasePlugin ;
26
25
import org .gradle .api .plugins .JavaPluginExtension ;
@@ -64,7 +63,6 @@ public void apply(Project project) {
64
63
project .getPluginManager ().apply (ElasticsearchTestBasePlugin .class );
65
64
project .getPluginManager ().apply (PrecommitTaskPlugin .class );
66
65
project .getPluginManager ().apply (MutedTestPlugin .class );
67
- configureConfigurations (project );
68
66
configureCompile (project );
69
67
configureInputNormalization (project );
70
68
configureNativeLibraryPath (project );
@@ -73,37 +71,6 @@ public void apply(Project project) {
73
71
project .getExtensions ().getExtraProperties ().set ("versions" , VersionProperties .getVersions ());
74
72
}
75
73
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
-
107
74
/**
108
75
* Adds compiler settings to the project
109
76
*/
0 commit comments