| /* |
| * 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.apache.lucene.gradle.UnusedDeps |
| |
| apply plugin: 'java-library' |
| apply plugin: 'maven-publish' |
| apply plugin: org.apache.lucene.gradle.PartOfDist |
| |
| archivesBaseName = 'solr-core' |
| |
| dependencies { |
| |
| runtimeOnly project(':lucene:analysis:lucene-analyzers-phonetic') |
| implementation project(':lucene:lucene-core') |
| implementation project(':lucene:lucene-codecs') |
| implementation project(':lucene:analysis:lucene-analyzers-common') |
| implementation project(':lucene:analysis:lucene-analyzers-kuromoji') |
| implementation project(':lucene:analysis:lucene-analyzers-nori') |
| implementation project(':lucene:lucene-suggest') |
| implementation project(':lucene:lucene-queries') |
| implementation project(':lucene:lucene-highlighter') |
| implementation project(':lucene:lucene-spatial-extras') |
| implementation project(':lucene:lucene-grouping') |
| implementation project(':lucene:lucene-classification') |
| implementation project(':lucene:lucene-expressions') |
| implementation project(':lucene:lucene-sandbox') |
| implementation project(':lucene:lucene-queryparser') |
| implementation project(':lucene:lucene-misc') |
| implementation project(':lucene:lucene-join') |
| implementation project(':solr:solr-solrj') |
| |
| // used for log4j2 async support |
| runtimeOnly ('com.lmax:disruptor') |
| runtimeOnly ('org.slf4j:log4j-over-slf4j') // bridge for deps that use log4j12 directly |
| runtimeOnly ('org.slf4j:jcl-over-slf4j') // bridge java common logging to slf4j |
| |
| // kerb, kerby, and curator deps used for security and auth with zk/hdfs/kerberos |
| runtimeOnly ('org.apache.curator:curator-recipes') { transitive = false } // brings in a lot we don't use |
| runtimeOnly ('org.apache.kerby:kerb-core') |
| runtimeOnly ('org.apache.kerby:kerb-util') |
| runtimeOnly ('org.apache.kerby:kerby-asn1') |
| runtimeOnly ('org.apache.kerby:kerby-pkix') |
| |
| runtimeOnly ('com.google.protobuf:protobuf-java') // used by calicte.avatica |
| |
| compileOnly ('javax.servlet:javax.servlet-api') |
| |
| // logging |
| implementation ('org.slf4j:slf4j-api') |
| implementation ('org.apache.logging.log4j:log4j-api') |
| implementation ('org.apache.logging.log4j:log4j-core') |
| // implementation ('org.apache.logging.log4j:log4j-1.2-api') // used by StartupLoggingUtils |
| implementation ('org.apache.logging.log4j:log4j-slf4j-impl') // still have to work out logging dist strat |
| |
| implementation ('org.apache.zookeeper:zookeeper') { transitive = false } // brings in a lot we don't use |
| implementation ('org.apache.httpcomponents:httpclient') |
| implementation ('org.apache.httpcomponents:httpcore') |
| implementation ('org.codehaus.woodstox:stax2-api') |
| implementation ('org.codehaus.woodstox:woodstox-core-asl') |
| implementation ('io.dropwizard.metrics:metrics-core') { |
| exclude group: 'com.rabbitmq', module: 'amqp-client' // we don't use this |
| } |
| implementation ('io.dropwizard.metrics:metrics-graphite') { |
| exclude group: 'com.rabbitmq', module: 'amqp-client' // we don't use this |
| } |
| implementation ('io.dropwizard.metrics:metrics-jvm') |
| implementation ('io.dropwizard.metrics:metrics-jmx') |
| implementation ('commons-codec:commons-codec') |
| implementation ('commons-io:commons-io') |
| implementation ('org.apache.commons:commons-exec') |
| implementation ('commons-fileupload:commons-fileupload') |
| implementation ('commons-cli:commons-cli') |
| implementation ('org.apache.commons:commons-text') |
| implementation ('com.google.guava:guava') { transitive = false } // many annotation deps we don't need |
| implementation ('org.locationtech.spatial4j:spatial4j') |
| implementation ('org.apache.commons:commons-math3') |
| implementation ('org.ow2.asm:asm') |
| |
| implementation ('org.restlet.jee:org.restlet') |
| implementation ('com.carrotsearch:hppc') |
| |
| implementation ('com.fasterxml.jackson.core:jackson-core') |
| implementation ('com.fasterxml.jackson.core:jackson-databind') |
| implementation ('com.fasterxml.jackson.core:jackson-annotations') |
| implementation ('com.fasterxml.jackson.dataformat:jackson-dataformat-smile') |
| implementation ('com.fasterxml.jackson.dataformat:jackson-dataformat-yaml') // added for calcite sql deps |
| |
| implementation ('commons-collections:commons-collections') |
| implementation ('com.github.ben-manes.caffeine:caffeine') |
| implementation ('com.google.re2j:re2j') |
| implementation ('org.apache.commons:commons-lang3') |
| implementation ('org.apache.htrace:htrace-core4') |
| implementation ('org.apache.curator:curator-framework') { transitive = false } // brings in a lot we don't use |
| implementation ('org.apache.curator:curator-client') { transitive = false } // brings in a lot we don't use |
| implementation ('com.tdunning:t-digest') // StatsComponents percentiles |
| |
| // hdfs |
| implementation ('org.apache.hadoop:hadoop-auth') { transitive = false } // brings in a lot we don't use |
| implementation ('org.apache.hadoop:hadoop-common') { transitive = false } // brings in a lot we don't use |
| implementation ('org.apache.hadoop:hadoop-hdfs-client') { transitive = false } // brings in a lot we don't use |
| implementation ('org.apache.hadoop:hadoop-annotations') { transitive = false } // brings in a lot we don't use |
| |
| // sql parser |
| implementation ('org.apache.calcite:calcite-core') { transitive = false } // brings in a lot we don't use |
| implementation ('org.apache.calcite:calcite-linq4j') { transitive = false } // brings in a lot we don't use |
| implementation ('org.apache.calcite.avatica:avatica-core') { transitive = false } // brings in a lot we don't use |
| implementation ('org.codehaus.janino:janino') |
| implementation ('org.codehaus.janino:commons-compiler') |
| implementation ('com.jayway.jsonpath:json-path') |
| implementation ('org.apache.commons:commons-lang3') |
| |
| implementation ('org.rrd4j:rrd4j') |
| implementation ('org.bitbucket.b_c:jose4j') |
| |
| implementation ('org.eclipse.jetty:jetty-alpn-server') |
| implementation ('org.eclipse.jetty.http2:http2-server') |
| implementation ('org.eclipse.jetty.http2:http2-common') |
| implementation ('org.eclipse.jetty:jetty-server') |
| implementation ('org.eclipse.jetty:jetty-client') |
| implementation ('org.eclipse.jetty:jetty-util') |
| implementation ('org.eclipse.jetty:jetty-servlet') |
| implementation ('org.eclipse.jetty:jetty-server') |
| |
| testImplementation ('org.restlet.jee:org.restlet.ext.servlet') |
| |
| // kerb, kerby, and curator deps used for security and auth with zk/hdfs/kerberos |
| testRuntimeOnly ('org.apache.kerby:kerb-core') |
| testRuntimeOnly ('org.apache.kerby:kerby-asn1') |
| testRuntimeOnly ('org.apache.kerby:kerby-pkix') |
| testRuntimeOnly ('org.apache.kerby:kerby-config') |
| testRuntimeOnly ('org.apache.kerby:kerb-crypto') |
| testRuntimeOnly ('org.apache.kerby:kerb-util') |
| |
| // hdfs |
| testRuntimeOnly ('org.apache.commons:commons-configuration2') |
| |
| testImplementation ('org.eclipse.jetty:jetty-xml') |
| testImplementation ('org.mockito:mockito-core') |
| testImplementation ('net.bytebuddy:byte-buddy') |
| testImplementation ('org.objenesis:objenesis') |
| testImplementation ('commons-logging:commons-logging') |
| testImplementation ('io.netty:netty-all') |
| testImplementation ('org.apache.commons:commons-text') |
| testImplementation ('org.eclipse.jetty:jetty-webapp') |
| testImplementation ('com.sun.jersey:jersey-servlet:1.19.4') { transitive = false } // brings in a lot we don't use |
| |
| // hdfs |
| testImplementation ('org.apache.hadoop:hadoop-common::tests') { transitive = false } // brings in a lot we don't use |
| testImplementation ('org.apache.hadoop:hadoop-hdfs') { transitive = false } // brings in a lot we don't use |
| testImplementation ('org.apache.hadoop:hadoop-hdfs::tests') { transitive = false } // brings in a lot we don't use |
| testImplementation ('org.apache.hadoop:hadoop-minikdc') { transitive = false } // brings in a lot we don't use |
| testImplementation ('com.google.protobuf:protobuf-java') |
| |
| // kerby |
| testImplementation ('org.apache.kerby:kerb-client') { transitive = false } // brings in a lot we don't use |
| testImplementation ('org.apache.kerby:kerb-common') { transitive = false } // brings in a lot we don't use |
| testImplementation ('org.apache.kerby:kerb-identity') { transitive = false } // brings in a lot we don't use |
| testImplementation ('org.apache.kerby:kerb-server') { transitive = false } // brings in a lot we don't use |
| testImplementation ('org.apache.kerby:kerb-simplekdc') { transitive = false } // brings in a lot we don't use |
| testImplementation ('org.apache.kerby:kerb-admin') { transitive = false } // brings in a lot we don't use |
| testImplementation ('org.apache.kerby:kerby-kdc') { transitive = false } // brings in a lot we don't use |
| |
| testImplementation project(path: ':lucene:lucene-backward-codecs', configuration: 'testOutput') |
| testImplementation project(path: ':lucene:lucene-queryparser', configuration: 'testOutput') |
| testImplementation project(':lucene:lucene-test-framework') |
| testImplementation project(':solr:solr-test-framework') |
| testImplementation project(':lucene:analysis:lucene-analyzers-icu') |
| testImplementation project(':solr:contrib:solr-contrib-analysis-extras') |
| |
| } |
| |
| ratSources { |
| excludes = ['**/htmlStripReaderTest.html', '**/*.iml'] |
| } |
| |
| forbiddenApisTest { |
| exclude 'org/apache/solr/internal/**' |
| exclude 'org/apache/hadoop/**' |
| } |
| |
| missingDeps { |
| depExclude '**/*hadoop*.dot' // we exclude examining hadoop jars because we don't need lots of these deps |
| |
| classExclude 'org\\.apache\\.yetus\\.audience\\.InterfaceAudience.*' // annotations |
| classExclude 'javax\\.annotation\\..*' // annotations |
| classExclude 'com\\.google\\.errorprone\\.annotations\\..*' // annotations |
| classExclude 'org\\.fusesource\\.jansi\\..*' // log4j extra functionality we don't use |
| classExclude 'org\\.slf4j\\.ext\\.EventData' // log4j extra functionality we don't use |
| classExclude 'org\\.osgi\\.framework\\..*' // log4j osgi stuff we don't have |
| classExclude 'org\\.apache\\.log4j\\.jmx\\.HierarchyDynamicMBean' // zookeeper refs this log4j class directly |
| classExclude 'org\\.locationtech\\.jts\\..*' // spatial4j does not yet use jts |
| classExclude 'com\\.esri\\.core.geometry\\..*' // calcite sql stuff we appraently don't need |
| classExclude 'org\\.pentaho\\.aggdes\\..*' // calcite sql stuff we apparently don't need |
| classExclude 'org\\.apache\\.commons\\.dbcp2\\.BasicDataSource' // calcite jdbc sql stuff we apparently don't need |
| classExclude 'com\\.yahoo\\.sketches\\.hll\\..*' // calcite sql stuff we apparently don't need |
| } |
| |
| unusedDeps { |
| jarExclude 'kerby-pkix-.*?\\.jar' // used by security components dynamically |
| } |
| |
| task runJavacc(type: org.apache.lucene.gradle.JavaCC) { |
| inputFile file('src/java/org/apache/solr/parser/QueryParser.jj') |
| target file('src/java/org/apache/solr/parser') |
| |
| doLast { |
| // Change the incorrect public ctors for QueryParser to be protected instead |
| ant.replaceregexp(file: project.filePath('src/java/org/apache/solr/parser/QueryParser.java'), |
| byline: 'true', |
| match: 'public QueryParser\\(CharStream ', |
| replace: 'protected QueryParser(CharStream ') |
| |
| ant.replaceregexp(file: project.filePath('src/java/org/apache/solr/parser/QueryParser.java'), |
| byline: 'true', |
| match: 'public QueryParser\\(QueryParserTokenManager ', |
| replace:'protected QueryParser(QueryParserTokenManager ') |
| |
| // change an exception used for signaling to be static |
| ant.replaceregexp(file: project.filePath("src/java/org/apache/solr/parser/QueryParser.java"), |
| byline: "true", |
| match: "final private LookaheadSuccess jj_ls =", |
| replace: "static final private LookaheadSuccess jj_ls =") |
| ant.replace(token: "StringBuffer", value: "StringBuilder", encoding: "UTF-8") { |
| ant.fileset(dir: project.filePath("src/java/org/apache/solr/parser"), includes: "ParseException.java TokenMgrError.java") |
| } |
| } |
| } |
| |
| task regenerate { |
| group = 'Build Regenerate' |
| description = "Regenerates various generated src files, automoton, packedints, jflex, javacc, etc" |
| dependsOn runJavacc |
| } |
| |
| |