From 218164e96c4d19855b9e5012173478c2706bc52e Mon Sep 17 00:00:00 2001 From: littleaj <1690572+littleaj@users.noreply.github.com> Date: Tue, 9 Jul 2019 15:14:28 -0700 Subject: [PATCH] remove test dependencies from pom. ensure provided dependencies are included. --- .../build.gradle | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/azure-application-insights-spring-boot-starter/build.gradle b/azure-application-insights-spring-boot-starter/build.gradle index 3e99cb8e9dd..10e550843b3 100644 --- a/azure-application-insights-spring-boot-starter/build.gradle +++ b/azure-application-insights-spring-boot-starter/build.gradle @@ -122,9 +122,20 @@ projectPomDescription = "This is the Spring Boot starter of " + project.msftAppI whenPomConfigured = { p -> def agentArtifactId = project(":agent").jar.baseName def loggerArtifactId = project(":ApplicationInsightsInternalLogger").jar.baseName - p.dependencies = p.dependencies.findAll { dep -> dep.scope == "test" || + p.dependencies = p.dependencies.findAll { dep -> dep.scope != 'test' && dep.artifactId != agentArtifactId && dep.artifactId != loggerArtifactId && !(dep.groupId in ['org.apache.http', 'eu.infomas', 'org.apache.commons', 'commons-io', 'com.google.guava', 'com.google.code.gson', 'org.apache.httpcomponents', 'io.grpc', 'com.google.protobuf'])} + p.dependencies += project.configurations.compileOnly.allDependencies + .findAll { it.group != 'com.microsoft.azure' } + .collect { + def d = p.dependencies[0].class.newInstance() // related to https://issues.gradle.org/browse/GRADLE-1497 + d.artifactId = it.name + d.groupId = it.group + d.version = it.version + d.scope = 'provided' + d.type = null + d + } }