Skip to content

Commit

Permalink
Merge pull request #967 from microsoft/fix_poms
Browse files Browse the repository at this point in the history
Fix poms
  • Loading branch information
littleaj authored Jul 9, 2019
2 parents f7e307e + 19a4c44 commit 82532e3
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 17 deletions.
8 changes: 8 additions & 0 deletions agent/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ plugins {
}

apply from: "$buildScriptsDir/common-java.gradle"
apply from: "$buildScriptsDir/publishing.gradle"

shadowJar {
classifier = ''
Expand Down Expand Up @@ -57,3 +58,10 @@ dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
}

projectPomName = project.msftAppInsights + " Java Agent"
projectPomDescription = "This module provides automatic instrumentation for $project.msftAppInsightsJavaSdk"

whenPomConfigured = { p ->
p.dependencies = []
}

Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ public void registerSelf(AgentNotificationsHandler handler) {
/**
* Set the mainHandler for handling the dependency tracking operations.
* @param handler instance of {@link AgentNotificationsHandler}
* @return
*/
public void setMainHandler(AgentNotificationsHandler handler) {
this.mainHandler = handler;
Expand Down
7 changes: 7 additions & 0 deletions collectd/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ plugins {
}

apply from: "$buildScriptsDir/common-java.gradle"
apply from: "$buildScriptsDir/publishing.gradle"

// Since we're building the shadow jar, we have no use in the jar contains only CollectD code.
jar {
Expand Down Expand Up @@ -52,3 +53,9 @@ dependencies {
testCompile files(collectDLibPath)
}

projectPomName = project.msftAppInsights + " Java CollectD Plugin"
projectPomDescription = "This module is the collectd plugin for $project.msftAppInsightsJavaSdk"

whenPomConfigured = { p ->
p.dependencies = []
}
9 changes: 1 addition & 8 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,7 @@ projectPomName = project.msftAppInsights + " Java SDK Core"
projectPomDescription = "This is the core module of " + project.msftAppInsightsJavaSdk

whenPomConfigured = { p ->
def agentArtifactId = project(":agent").jar.baseName
def loggerArtifactId = project(":ApplicationInsightsInternalLogger").jar.baseName
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.code.gson', 'org.apache.httpcomponents',
'io.grpc', 'com.google.protobuf'])
}
p.dependencies = []
}

// endregion Publishing properties
2 changes: 1 addition & 1 deletion logging/log4j2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ projectPomDescription = "This module provides a $project.msftAppInsights appende
// endregion Publishing properties

dependencies {
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
annotationProcessor group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
}
19 changes: 12 additions & 7 deletions web/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,18 @@ projectPomName = project.msftAppInsights + " Java SDK Web Module"
projectPomDescription = "This is the web module of " + project.msftAppInsightsJavaSdk

whenPomConfigured = { p ->
def agentArtifactId = project(":agent").jar.baseName
def loggerArtifactId = project(":ApplicationInsightsInternalLogger").jar.baseName
p.dependencies = p.dependencies.findAll { dep ->
dep.scope == "test" || dep.artifactId != agentArtifactId && dep.artifactId != loggerArtifactId &&
!(dep.groupId in ['org.apache.http', 'org.apache.commons', 'commons-io',
'com.google.guava', 'com.google.code.gson', 'org.apache.httpcomponents'])
}
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
if (it.name == 'xwork' || it.name == 'spring-webmvc') d.optional = 'true'
d
}
}

// endregion Publishing properties

0 comments on commit 82532e3

Please sign in to comment.