代码拉取完成,页面将自动刷新
import org.gradle.internal.os.OperatingSystem
plugins {
id 'java'
id 'java-library'
id 'maven-publish'
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.12.0'
id "org.gradle.test-retry" version "1.1.9"
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
id 'signing'
}
def jarVersion = "2.0.2"
group = 'io.nats'
def isMerge = System.getenv("BUILD_EVENT") == "push"
def isRelease = System.getenv("BUILD_EVENT") == "release"
// version is the variable the build actually uses.
version = isRelease ? jarVersion : jarVersion + "-SNAPSHOT"
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
dependencies {
api 'io.nats:nkeys-java:2.0.1'
api 'io.nats:jnats-json:2.0.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.0'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.12.3'
}
test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
events "started", "passed", "skipped", "failed"
showStandardStreams = true
}
}
javadoc {
options.overview = 'src/main/javadoc/overview.html' // relative to source root
source = sourceSets.main.allJava
title = "NATS.IO Java JWT Utilities"
classpath = sourceSets.main.runtimeClasspath
doLast {
if (!OperatingSystem.current().isWindows()) {
exec {
println "Updating favicon on all html files"
workingDir 'build/docs/javadoc'
// Only on linux, mac at this point
commandLine 'find', '.', '-name', '*.html', '-exec', 'sed', '-i', '-e', 's#<head>#<head><link rel="icon" type="image/ico" href="favicon.ico">#', '{}', ';'
}
copy {
println "Copying images to javadoc folder"
from 'src/main/javadoc/images'
into 'build/docs/javadoc'
}
}
}
}
task javadocJar(type: Jar) {
archiveClassifier.set('javadoc')
from javadoc
}
task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
jacoco {
toolVersion = "0.8.6"
}
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
afterEvaluate { // only report on main library not examples
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it,
exclude: ['**/examples**'])
}))
}
}
artifacts {
archives javadocJar, sourcesJar
}
if (isMerge || isRelease) {
nexusPublishing {
repositories {
sonatype {
username = System.getenv('OSSRH_USERNAME')
password = System.getenv('OSSRH_PASSWORD')
}
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = rootProject.name
packaging = 'jar'
groupId = group
artifactId = archivesBaseName
description = 'Java NATS.io server runner.'
url = 'https://github.com/nats-io/jwt.java'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = "synadia"
name = "Synadia"
email = "info@synadia.com"
url = "https://nats.io"
}
}
scm {
url = 'https://github.com/nats-io/jwt.java'
}
}
}
}
}
if (isRelease) {
signing {
def signingKeyId = System.getenv('SIGNING_KEY_ID')
def signingKey = System.getenv('SIGNING_KEY')
def signingPassword = System.getenv('SIGNING_PASSWORD')
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign configurations.archives
sign publishing.publications.mavenJava
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。