Skip to content

Commit

Permalink
remove test dependencies from pom. ensure provided dependencies are i…
Browse files Browse the repository at this point in the history
…ncluded.
  • Loading branch information
littleaj committed Jul 9, 2019
1 parent 19a4c44 commit 218164e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion azure-application-insights-spring-boot-starter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit 218164e

Please sign in to comment.