From 1924fc0aada99a1cb796d603836f988f8c0c1459 Mon Sep 17 00:00:00 2001 From: littleaj <1690572+littleaj@users.noreply.github.com> Date: Mon, 8 Jul 2019 18:35:22 -0700 Subject: [PATCH 1/5] remove dependencies from web/core poms --- core/build.gradle | 9 +-------- web/build.gradle | 8 +------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/core/build.gradle b/core/build.gradle index 6ec759b7fb5..e7226327cd3 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -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 diff --git a/web/build.gradle b/web/build.gradle index 652acd8764f..307413bce4c 100644 --- a/web/build.gradle +++ b/web/build.gradle @@ -75,13 +75,7 @@ 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 = [] } // endregion Publishing properties From 70a2d09e2c5cd4df3da88c32b96be5273a9dc6b0 Mon Sep 17 00:00:00 2001 From: littleaj <1690572+littleaj@users.noreply.github.com> Date: Mon, 8 Jul 2019 18:35:43 -0700 Subject: [PATCH 2/5] add poms for collectd and agent --- agent/build.gradle | 8 ++++++++ collectd/build.gradle | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/agent/build.gradle b/agent/build.gradle index 4a4d38bd9c4..eddcaf00c17 100644 --- a/agent/build.gradle +++ b/agent/build.gradle @@ -24,6 +24,7 @@ plugins { } apply from: "$buildScriptsDir/common-java.gradle" +apply from: "$buildScriptsDir/publishing.gradle" shadowJar { classifier = '' @@ -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 = [] +} + diff --git a/collectd/build.gradle b/collectd/build.gradle index ccdcb12a73f..a18d91109fd 100644 --- a/collectd/build.gradle +++ b/collectd/build.gradle @@ -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 { @@ -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 = [] +} From 908e63e9e3e1e4d77b82e08de8f0ed853901308d Mon Sep 17 00:00:00 2001 From: littleaj <1690572+littleaj@users.noreply.github.com> Date: Tue, 9 Jul 2019 09:57:40 -0700 Subject: [PATCH 3/5] remove invalid @return javadoc --- .../agent/internal/coresync/impl/ImplementationsCoordinator.java | 1 - 1 file changed, 1 deletion(-) diff --git a/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/impl/ImplementationsCoordinator.java b/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/impl/ImplementationsCoordinator.java index feebc084920..50a75f9b7b2 100644 --- a/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/impl/ImplementationsCoordinator.java +++ b/agent/src/main/java/com/microsoft/applicationinsights/agent/internal/coresync/impl/ImplementationsCoordinator.java @@ -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; From 209beb168b511ea4bc42d1b5cb48fa8606f8999b Mon Sep 17 00:00:00 2001 From: littleaj <1690572+littleaj@users.noreply.github.com> Date: Tue, 9 Jul 2019 11:39:22 -0700 Subject: [PATCH 4/5] fix provided dependencies in web module pom --- web/build.gradle | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/web/build.gradle b/web/build.gradle index 307413bce4c..98621ff53df 100644 --- a/web/build.gradle +++ b/web/build.gradle @@ -75,7 +75,18 @@ projectPomName = project.msftAppInsights + " Java SDK Web Module" projectPomDescription = "This is the web module of " + project.msftAppInsightsJavaSdk whenPomConfigured = { p -> - p.dependencies = [] + 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 From 19a4c44d47d224538ce17c7e00eff66acd13b9d4 Mon Sep 17 00:00:00 2001 From: littleaj <1690572+littleaj@users.noreply.github.com> Date: Tue, 9 Jul 2019 11:39:44 -0700 Subject: [PATCH 5/5] fix compile dependencies in log4j2 appender pom --- logging/log4j2/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logging/log4j2/build.gradle b/logging/log4j2/build.gradle index 02e97d58a72..70554a89e1c 100644 --- a/logging/log4j2/build.gradle +++ b/logging/log4j2/build.gradle @@ -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' }