From 75d997077bf02b184bdd1649a1b11a1920d8c3f4 Mon Sep 17 00:00:00 2001 From: Christine Poerschke Date: Mon, 7 Mar 2022 12:43:16 +0000 Subject: [PATCH] SOLR-16072: make solr.jetty metrics reappear again (#726) Co-authored-by: Kevin Risden --- solr/core/build.gradle | 51 ++++++++++++++++++++++++---------------- solr/server/build.gradle | 4 ++++ 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/solr/core/build.gradle b/solr/core/build.gradle index be801e33a70..2a04dbb719f 100644 --- a/solr/core/build.gradle +++ b/solr/core/build.gradle @@ -15,7 +15,6 @@ * limitations under the License. */ - apply plugin: 'java-library' description = 'Apache Solr Core' @@ -45,8 +44,39 @@ dependencies { api project(':solr:solrj') api project(':solr:server') + permitUnusedDeclared project(':solr:server') + // --- start of server/build.grade declared dependencies --- + + // Note: server/build.gradle declares these dependencies yet + // we only want them to show up in server/lib when packaged + // and NOT in server/solr-webapp/webapp/WEB-INF/lib. So any + // "api" dependency in server/build.gradle that is needed in + // core/build.gradle needs to be defined as "compileOnlyApi" + // below. + + compileOnlyApi 'io.dropwizard.metrics:metrics-core' + compileOnlyApi ('io.dropwizard.metrics:metrics-graphite', { + exclude group: "com.rabbitmq", module: "amqp-client" + }) + compileOnlyApi 'io.dropwizard.metrics:metrics-jmx' + compileOnlyApi 'io.dropwizard.metrics:metrics-jvm' + + compileOnlyApi 'org.eclipse.jetty:jetty-alpn-server' + compileOnlyApi 'org.eclipse.jetty:jetty-http' + compileOnlyApi 'org.eclipse.jetty:jetty-io' + compileOnlyApi 'org.eclipse.jetty:jetty-rewrite' + compileOnlyApi 'org.eclipse.jetty:jetty-server' + compileOnlyApi 'org.eclipse.jetty:jetty-servlet' + compileOnlyApi 'org.eclipse.jetty:jetty-util' + + compileOnlyApi 'org.eclipse.jetty.http2:http2-common' + compileOnlyApi 'org.eclipse.jetty.http2:http2-server' + + compileOnlyApi 'javax.servlet:javax.servlet-api' + // --- end of server/build.gradle declared dependencies --- + // Non-API below; although there are exceptions runtimeOnly "org.apache.lucene:lucene-analysis-kuromoji" @@ -89,20 +119,8 @@ dependencies { implementation 'org.apache.httpcomponents:httpclient' implementation 'org.apache.httpcomponents:httpcore' - compileOnlyApi 'javax.servlet:javax.servlet-api' - implementation 'org.eclipse.jetty:jetty-client' - compileOnlyApi 'org.eclipse.jetty.http2:http2-common' - compileOnlyApi 'org.eclipse.jetty.http2:http2-server' - compileOnlyApi 'org.eclipse.jetty:jetty-alpn-server' - compileOnlyApi 'org.eclipse.jetty:jetty-http' - compileOnlyApi 'org.eclipse.jetty:jetty-io' - compileOnlyApi 'org.eclipse.jetty:jetty-rewrite' - compileOnlyApi 'org.eclipse.jetty:jetty-server' - compileOnlyApi 'org.eclipse.jetty:jetty-servlet' - compileOnlyApi 'org.eclipse.jetty:jetty-util' - // ZooKeeper implementation('org.apache.zookeeper:zookeeper', { exclude group: "org.apache.yetus", module: "audience-annotations" @@ -139,13 +157,6 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-core' implementation 'org.apache.logging.log4j:log4j-slf4j-impl' - implementation 'io.dropwizard.metrics:metrics-core' - implementation ('io.dropwizard.metrics:metrics-graphite', { - exclude group: "com.rabbitmq", module: "amqp-client" - }) - implementation 'io.dropwizard.metrics:metrics-jmx' - implementation 'io.dropwizard.metrics:metrics-jvm' - // For faster XML processing than the JDK implementation 'org.codehaus.woodstox:stax2-api' implementation 'com.fasterxml.woodstox:woodstox-core' diff --git a/solr/server/build.gradle b/solr/server/build.gradle index c943f72dc21..364e1e6c65b 100644 --- a/solr/server/build.gradle +++ b/solr/server/build.gradle @@ -30,6 +30,10 @@ configurations { } dependencies { + // If any of the below "api" declared dependencies are + // used in core/build.gradle, then they must be declared + // as "compileOnlyApi" in core/build.gradle. + permitUnusedDeclared 'io.dropwizard.metrics:metrics-core' api('io.dropwizard.metrics:metrics-core', { exclude group: "com.rabbitmq", module: "amqp-client"