Skip to content

Commit 3237f5c

Browse files
committed
[Java] Filter unneeded dependencies from POMs.
1 parent 9a8d214 commit 3237f5c

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

build.gradle

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ subprojects {
174174

175175
install {
176176
repositories.mavenInstaller.pom.project(projectPom)
177+
178+
repositories.mavenInstaller.pom.whenConfigured {
179+
p -> p.dependencies = p.dependencies.findAll {
180+
dep -> !(dep.artifactId.contains("hamcrest") ||
181+
dep.artifactId.contains("mockito") ||
182+
dep.artifactId.contains("junit"))
183+
}
184+
}
177185
}
178186
}
179187

@@ -301,19 +309,8 @@ project(':sbe-tool') {
301309
project(':sbe-all') {
302310
apply plugin: 'com.github.johnrengelman.shadow'
303311

304-
configurations {
305-
customCompile
306-
}
307-
308312
dependencies {
309-
customCompile project(':sbe-tool')
310-
}
311-
312-
sourceSets {
313-
main {
314-
compileClasspath += configurations.customCompile
315-
runtimeClasspath += compileClasspath
316-
}
313+
implementation project(':sbe-tool')
317314
}
318315

319316
task sourcesJar(type: Jar) {
@@ -322,7 +319,6 @@ project(':sbe-all') {
322319
}
323320

324321
javadoc {
325-
classpath += configurations.customCompile
326322
source += project(':sbe-tool').sourceSets.main.allJava
327323
}
328324

@@ -332,7 +328,6 @@ project(':sbe-all') {
332328
}
333329

334330
shadowJar {
335-
configurations = [project.configurations.customCompile]
336331
archiveClassifier.set ''
337332
manifest.attributes(
338333
'Main-Class': 'uk.co.real_logic.sbe.SbeTool',
@@ -390,6 +385,12 @@ project(':sbe-all') {
390385
archives javadocJar
391386
}
392387

388+
install {
389+
repositories.mavenInstaller.pom.whenConfigured {
390+
p -> p.dependencies = []
391+
}
392+
}
393+
393394
signing {
394395
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
395396
sign configurations.shadow

0 commit comments

Comments
 (0)