Skip to content

Commit 82532e3

Browse files
authored
Merge pull request #967 from microsoft/fix_poms
Fix poms
2 parents f7e307e + 19a4c44 commit 82532e3

File tree

6 files changed

+29
-17
lines changed

6 files changed

+29
-17
lines changed

agent/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ plugins {
2424
}
2525

2626
apply from: "$buildScriptsDir/common-java.gradle"
27+
apply from: "$buildScriptsDir/publishing.gradle"
2728

2829
shadowJar {
2930
classifier = ''
@@ -57,3 +58,10 @@ dependencies {
5758
testCompile group: 'junit', name: 'junit', version: '4.12'
5859
}
5960

61+
projectPomName = project.msftAppInsights + " Java Agent"
62+
projectPomDescription = "This module provides automatic instrumentation for $project.msftAppInsightsJavaSdk"
63+
64+
whenPomConfigured = { p ->
65+
p.dependencies = []
66+
}
67+

agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/impl/ImplementationsCoordinator.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ public void registerSelf(AgentNotificationsHandler handler) {
349349
/**
350350
* Set the mainHandler for handling the dependency tracking operations.
351351
* @param handler instance of {@link AgentNotificationsHandler}
352-
* @return
353352
*/
354353
public void setMainHandler(AgentNotificationsHandler handler) {
355354
this.mainHandler = handler;

collectd/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ plugins {
2424
}
2525

2626
apply from: "$buildScriptsDir/common-java.gradle"
27+
apply from: "$buildScriptsDir/publishing.gradle"
2728

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

56+
projectPomName = project.msftAppInsights + " Java CollectD Plugin"
57+
projectPomDescription = "This module is the collectd plugin for $project.msftAppInsightsJavaSdk"
58+
59+
whenPomConfigured = { p ->
60+
p.dependencies = []
61+
}

core/build.gradle

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,7 @@ projectPomName = project.msftAppInsights + " Java SDK Core"
163163
projectPomDescription = "This is the core module of " + project.msftAppInsightsJavaSdk
164164

165165
whenPomConfigured = { p ->
166-
def agentArtifactId = project(":agent").jar.baseName
167-
def loggerArtifactId = project(":ApplicationInsightsInternalLogger").jar.baseName
168-
p.dependencies = p.dependencies.findAll { dep ->
169-
dep.scope == "test" || dep.artifactId != agentArtifactId && dep.artifactId != loggerArtifactId &&
170-
!(dep.groupId in ['org.apache.http', 'eu.infomas', 'org.apache.commons', 'commons-io',
171-
'com.google.code.gson', 'org.apache.httpcomponents',
172-
'io.grpc', 'com.google.protobuf'])
173-
}
166+
p.dependencies = []
174167
}
175168

176169
// endregion Publishing properties

logging/log4j2/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ projectPomDescription = "This module provides a $project.msftAppInsights appende
3333
// endregion Publishing properties
3434

3535
dependencies {
36-
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
36+
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
3737
annotationProcessor group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
3838
}

web/build.gradle

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,18 @@ projectPomName = project.msftAppInsights + " Java SDK Web Module"
7575
projectPomDescription = "This is the web module of " + project.msftAppInsightsJavaSdk
7676

7777
whenPomConfigured = { p ->
78-
def agentArtifactId = project(":agent").jar.baseName
79-
def loggerArtifactId = project(":ApplicationInsightsInternalLogger").jar.baseName
80-
p.dependencies = p.dependencies.findAll { dep ->
81-
dep.scope == "test" || dep.artifactId != agentArtifactId && dep.artifactId != loggerArtifactId &&
82-
!(dep.groupId in ['org.apache.http', 'org.apache.commons', 'commons-io',
83-
'com.google.guava', 'com.google.code.gson', 'org.apache.httpcomponents'])
84-
}
78+
p.dependencies = project.configurations.compileOnly.allDependencies
79+
.findAll { it.group != 'com.microsoft.azure' }
80+
.collect {
81+
def d = p.dependencies[0].class.newInstance() // related to https://issues.gradle.org/browse/GRADLE-1497
82+
d.artifactId = it.name
83+
d.groupId = it.group
84+
d.version = it.version
85+
d.scope = 'provided'
86+
d.type = null
87+
if (it.name == 'xwork' || it.name == 'spring-webmvc') d.optional = 'true'
88+
d
89+
}
8590
}
8691

8792
// endregion Publishing properties

0 commit comments

Comments
 (0)