Skip to content

Commit 3fb67a2

Browse files
committed
[Java] Filter dependencies in POMs.
1 parent 3237f5c commit 3fb67a2

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

build.gradle

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ subprojects {
144144
version = sbeVersion
145145

146146
jar.enabled = true
147-
148147
checkstyle.toolVersion = "${checkstyleVersion}"
149148

150149
compileJava {
@@ -174,7 +173,6 @@ subprojects {
174173

175174
install {
176175
repositories.mavenInstaller.pom.project(projectPom)
177-
178176
repositories.mavenInstaller.pom.whenConfigured {
179177
p -> p.dependencies = p.dependencies.findAll {
180178
dep -> !(dep.artifactId.contains("hamcrest") ||
@@ -183,6 +181,20 @@ subprojects {
183181
}
184182
}
185183
}
184+
185+
uploadArchives {
186+
repositories {
187+
mavenDeployer {
188+
pom.whenConfigured {
189+
p -> p.dependencies = p.dependencies.findAll {
190+
dep ->!(dep.artifactId.contains("hamcrest") ||
191+
dep.artifactId.contains("mockito") ||
192+
dep.artifactId.contains("junit"))
193+
}
194+
}
195+
}
196+
}
197+
}
186198
}
187199

188200
def validationXsdPath = project(':sbe-tool').projectDir.toString() + '/src/main/resources/fpl/sbe.xsd'
@@ -345,7 +357,13 @@ project(':sbe-all') {
345357
uploadArchives {
346358
repositories {
347359
mavenDeployer {
348-
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
360+
pom.whenConfigured {
361+
p -> p.dependencies = []
362+
}
363+
364+
beforeDeployment {
365+
MavenDeployment deployment -> signing.signPom(deployment)
366+
}
349367

350368
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
351369
authentication(userName: ossrhUsername, password: ossrhPassword)
@@ -363,7 +381,13 @@ project(':sbe-all') {
363381
uploadShadow {
364382
repositories {
365383
mavenDeployer {
366-
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
384+
pom.whenConfigured {
385+
p -> p.dependencies = []
386+
}
387+
388+
beforeDeployment {
389+
MavenDeployment deployment -> signing.signPom(deployment)
390+
}
367391

368392
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
369393
authentication(userName: ossrhUsername, password: ossrhPassword)

0 commit comments

Comments
 (0)