You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2019/06/05 02:12:39 UTC

[lucene-solr] 01/04: SOLR-13452: Add a listDeps task and convert solrj to non transitive.

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch jira/SOLR-13452_gradle_3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 27f4eac8e4310c99444e197035bd06b388b3d777
Author: markrmiller <ma...@apache.org>
AuthorDate: Mon Jun 3 12:33:16 2019 -0500

    SOLR-13452: Add a listDeps task and convert solrj to non transitive.
---
 build.gradle                                       | 21 +++++--
 .../org/apache/lucene/gradle/ListDeps.groovy       | 39 +++++++++++++
 solr/solrj/build.gradle                            | 67 +++++++++++-----------
 3 files changed, 90 insertions(+), 37 deletions(-)

diff --git a/build.gradle b/build.gradle
index 34712ee..63fe65e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -37,6 +37,7 @@ ant.lifecycleLogLevel = "INFO"
 // -> lucene-solr sub module config
 // -> lucene-solr root project config
 // -> lucene-solr IDE config
+// -> other config
 
 // -> lucene-solr all module config - configure all lucene-solr projects, including root project
 configure(luceneSolrProjects) {
@@ -78,6 +79,11 @@ configure(luceneSolrProjects) {
   }
   
   // TODO: check.dependsOn checkMissingJavaDocs
+  
+  task listDeps(type: org.apache.lucene.gradle.ListDeps) {
+    group = 'Help'
+    description = "List deps for a module."
+  }
 }
 
 // -> lucene-solr sub module config - configure all lucene-solr modules (excludes the root project)
@@ -150,14 +156,21 @@ configure(rootProject) {
 configure(allprojects) {
   apply plugin: 'eclipse'
   apply plugin: 'idea'
-}
-
-configure(allprojects) {
+  
   plugins.withType(JavaPlugin) {
-
     project.apply from: new File(rootProjectDir, "buildSrc/ide/eclipse.gradle")
     project.apply from: new File(rootProjectDir, "buildSrc/ide/idea.gradle")
+  }
+}
+
+// -> other config
 
+configure(allprojects) {
+
+  dependencies {
+    modules {
+      module("commons-logging:commons-logging") { replacedBy("org.slf4j:jcl-over-slf4j") }
+    }
   }
 }
 
diff --git a/buildSrc/src/main/groovy/org/apache/lucene/gradle/ListDeps.groovy b/buildSrc/src/main/groovy/org/apache/lucene/gradle/ListDeps.groovy
new file mode 100644
index 0000000..c353656
--- /dev/null
+++ b/buildSrc/src/main/groovy/org/apache/lucene/gradle/ListDeps.groovy
@@ -0,0 +1,39 @@
+package org.apache.lucene.gradle
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import org.gradle.api.DefaultTask
+import org.gradle.api.Project
+import org.gradle.api.tasks.Input
+import org.gradle.api.tasks.Optional
+import org.gradle.api.tasks.InputDirectory
+import org.gradle.api.tasks.InputFile
+import org.gradle.api.tasks.OutputDirectory
+import org.gradle.api.tasks.TaskAction
+import org.gradle.api.tasks.bundling.Compression
+
+class ListDeps extends DefaultTask {
+  
+  @TaskAction
+  void list() {
+    def artifacts = project.configurations.runtimeClasspath.getResolvedConfiguration().getResolvedArtifacts()
+    println 'count: ' + artifacts.size()
+    
+    artifacts.forEach( { ra -> println ra })
+  }
+}
+
+
diff --git a/solr/solrj/build.gradle b/solr/solrj/build.gradle
index 6fad43b..16c8e9a 100644
--- a/solr/solrj/build.gradle
+++ b/solr/solrj/build.gradle
@@ -28,40 +28,41 @@ dependencies {
   
   runtimeOnly ('org.eclipse.jetty:jetty-security') { transitive = false }
   
-  implementation ('org.apache.zookeeper:zookeeper') { transitive = false }
-  implementation ('org.apache.httpcomponents:httpclient') { transitive = false }
-  implementation ('org.apache.httpcomponents:httpmime') { transitive = false }
-  implementation ('org.apache.httpcomponents:httpcore') { transitive = false }
-  implementation ('commons-io:commons-io') { transitive = false }
-  implementation ('org.apache.commons:commons-math3') { transitive = false }
-
-  implementation ('org.noggit:noggit') { transitive = false }
-  implementation ('org.slf4j:slf4j-api') { transitive = false }
-  implementation ('org.slf4j:jcl-over-slf4j') { transitive = false }
-  implementation ('org.eclipse.jetty.http2:http2-client') { transitive = false }
-  implementation ('org.eclipse.jetty.http2:http2-http-client-transport') { transitive = false }
-  implementation ('org.eclipse.jetty.http2:http2-common') { transitive = false }
-  implementation ('org.eclipse.jetty.http2:http2-hpack') { transitive = false }
-  implementation ('org.eclipse.jetty:jetty-client') { transitive = false }
-  implementation ('org.eclipse.jetty:jetty-util') { transitive = false }
-  implementation ('org.eclipse.jetty:jetty-http') { transitive = false }
-  implementation ('commons-codec:commons-codec') { transitive = false }
+  implementation ('org.apache.zookeeper:zookeeper') {
+    exclude group: '*', module: '*' // zk has many deps we don't need
+  }
+  implementation ('org.apache.httpcomponents:httpclient')
+  implementation ('org.apache.httpcomponents:httpmime')
+  implementation ('org.apache.httpcomponents:httpcore')
+  implementation ('org.slf4j:jcl-over-slf4j')
+  implementation ('commons-io:commons-io')
+  implementation ('org.apache.commons:commons-math3')
+  implementation ('org.noggit:noggit')
+  implementation ('org.slf4j:slf4j-api')
+  implementation ('org.eclipse.jetty.http2:http2-client')
+  implementation ('org.eclipse.jetty.http2:http2-http-client-transport')
+  implementation ('org.eclipse.jetty.http2:http2-common')
+  implementation ('org.eclipse.jetty.http2:http2-hpack')
+  implementation ('org.eclipse.jetty:jetty-client')
+  implementation ('org.eclipse.jetty:jetty-util')
+  implementation ('org.eclipse.jetty:jetty-http')
+  implementation ('commons-codec:commons-codec')
   
-  testImplementation ('org.eclipse.jetty:jetty-servlet') { transitive = false }
-  testImplementation ('io.dropwizard.metrics:metrics-core') { transitive = false }
-  testImplementation ('org.restlet.jee:org.restlet') { transitive = false }
-  testImplementation ('org.restlet.jee:org.restlet.ext.servlet') { transitive = false }
-  testImplementation ('org.eclipse.jetty:jetty-webapp') { transitive = false }
-  testImplementation ('org.eclipse.jetty:jetty-server') { transitive = false }
-  testImplementation ('org.eclipse.jetty:jetty-xml') { transitive = false }
-  testImplementation ('commons-collections:commons-collections') { transitive = false }
-  testImplementation ('com.google.guava:guava') { transitive = false }
-  testImplementation ('org.apache.commons:commons-compress') { transitive = false }
-  testImplementation ('org.mockito:mockito-core') { transitive = false }
-  testImplementation ('net.bytebuddy:byte-buddy') { transitive = false }
-  testImplementation ('org.objenesis:objenesis') { transitive = false }
-  testImplementation ('org.apache.commons:commons-lang3') { transitive = false }
-  testImplementation ('javax.servlet:javax.servlet-api') { transitive = false }
+  testImplementation ('org.eclipse.jetty:jetty-servlet')
+  testImplementation ('io.dropwizard.metrics:metrics-core')
+  testImplementation ('org.restlet.jee:org.restlet')
+  testImplementation ('org.restlet.jee:org.restlet.ext.servlet')
+  testImplementation ('org.eclipse.jetty:jetty-webapp')
+  testImplementation ('org.eclipse.jetty:jetty-server')
+  testImplementation ('org.eclipse.jetty:jetty-xml')
+  testImplementation ('commons-collections:commons-collections')
+  testImplementation ('com.google.guava:guava')
+  testImplementation ('org.apache.commons:commons-compress')
+  testImplementation ('org.mockito:mockito-core')
+  testImplementation ('net.bytebuddy:byte-buddy')
+  testImplementation ('org.objenesis:objenesis')
+  testImplementation ('org.apache.commons:commons-lang3')
+  testImplementation ('javax.servlet:javax.servlet-api')
   
   testImplementation project(':solr:solr-core')
   testImplementation project(':lucene:lucene-core')