blob: 613318fa5797e645e74f3fa0b9cd4644a7e9df36 [file] [log] [blame]
/*
* 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.
*/
apply plugin: 'java-library'
// this is actually more of an 'application' but we don't want all of what Gradle adds
description = 'Prometheus exporter for exposing metrics from Solr using Metrics API and Search API'
dependencies {
implementation project(':solr:solrj')
runtimeOnly project(':solr:solrj-zookeeper')
// ideally remove ZK dep
implementation('org.apache.zookeeper:zookeeper', {
exclude group: "org.apache.yetus", module: "audience-annotations"
})
implementation ('io.prometheus:simpleclient')
implementation ('io.prometheus:simpleclient_httpserver')
implementation ('net.thisptr:jackson-jq', {
exclude group: "org.jruby.joni", module: "joni"
exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
})
implementation ('com.fasterxml.jackson.core:jackson-databind')
implementation ('net.sourceforge.argparse4j:argparse4j')
implementation ('com.github.ben-manes.caffeine:caffeine') { transitive = false }
implementation 'org.slf4j:slf4j-api'
implementation 'commons-codec:commons-codec'
runtimeOnly 'org.apache.logging.log4j:log4j-api'
runtimeOnly 'org.apache.logging.log4j:log4j-core'
runtimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl'
runtimeOnly 'com.lmax:disruptor'
testImplementation project(':solr:core')
testImplementation project(':solr:test-framework')
testImplementation 'com.carrotsearch.randomizedtesting:randomizedtesting-runner'
testImplementation 'junit:junit'
testImplementation 'commons-io:commons-io'
testImplementation 'org.apache.httpcomponents:httpclient'
testImplementation 'org.apache.httpcomponents:httpcore'
}
ext {
mainClass = 'org.apache.solr.prometheus.exporter.SolrExporter'
}
task run(type: JavaExec) {
group = 'application'
description = 'Run the main class with JavaExecTask'
main = project.ext.mainClass
classpath = sourceSets.main.runtimeClasspath
systemProperties = ["log4j.configurationFile":"file:conf/log4j2.xml"]
args = ["-f", "conf/solr-exporter-config.xml"]
}
jar {
manifest {
attributes('Main-Class': project.ext.mainClass)
}
}
assemblePackaging {
// Add two folders to default packaging.
from(projectDir, {
include "bin/**"
include "conf/**"
})
}