You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/02/07 17:44:31 UTC

[GitHub] [solr] madrob commented on a change in pull request #604: SOLR-15984: Ensure all used dependencies are declared

madrob commented on a change in pull request #604:
URL: https://github.com/apache/solr/pull/604#discussion_r800892265



##########
File path: gradle/validation/dependency-analyze.gradle
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+// This adds gradle-dependency-analyze validation of project dependencies

Review comment:
       minor addition, might be nice to include a link to https://github.com/gradle-dependency-analyze/gradle-dependency-analyze here. might save future explorers some time.

##########
File path: gradle/validation/dependency-analyze.gradle
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+// This adds gradle-dependency-analyze validation of project dependencies
+
+allprojects { prj ->
+  plugins.withId("java", {
+    prj.apply plugin: 'ca.cutterslade.analyze'
+
+    analyzeClassesDependencies {
+      warnUsedUndeclared = false
+      warnUnusedDeclared = true

Review comment:
       Does this give us a bunch of false positives due to reflective access or something like that?

##########
File path: solr/modules/analysis-extras/build.gradle
##########
@@ -15,25 +15,33 @@
  * limitations under the License.
  */
 
-
 apply plugin: 'java-library'
 
 description = 'Additional analysis components'
 
 dependencies {
   api project(':solr:core')
 
+  implementation project(':solr:solrj')
+
   implementation 'commons-io:commons-io'
-  implementation "org.apache.lucene:lucene-analysis-icu"
-  implementation "org.apache.lucene:lucene-analysis-smartcn"
-  implementation "org.apache.lucene:lucene-analysis-morfologik"
-  implementation "org.apache.lucene:lucene-analysis-opennlp"
-  implementation "org.apache.lucene:lucene-analysis-smartcn"
-  implementation "org.apache.lucene:lucene-analysis-stempel"
+  implementation 'com.ibm.icu:icu4j'
+  implementation 'org.apache.lucene:lucene-analysis-icu'
+  implementation 'org.apache.lucene:lucene-analysis-smartcn'
+  implementation 'org.apache.lucene:lucene-analysis-morfologik'
+  implementation 'org.apache.lucene:lucene-analysis-opennlp'
+  implementation 'org.apache.lucene:lucene-analysis-smartcn'
+  implementation 'org.apache.lucene:lucene-analysis-stempel'
+  implementation 'org.apache.lucene:lucene-core'
+  implementation 'org.apache.opennlp:opennlp-tools'
+  implementation 'org.slf4j:slf4j-api'
 
   testImplementation project(':solr:test-framework')
+  testImplementation 'org.apache.lucene:lucene-analysis-common'
+  testImplementation 'junit:junit'
   testImplementation('org.mockito:mockito-core', {
     exclude group: "net.bytebuddy", module: "byte-buddy-agent"
   })
-  testImplementation('org.apache.logging.log4j:log4j-core')
+  testImplementation 'org.apache.logging.log4j:log4j-api'

Review comment:
       This seems wrong to me, since shouldn't we be using slf4j-api everywhere except for the log4j specific log-level handling code in core? Maybe this is a good follow on issue though.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org