1 Star 0 Fork 0

NATS/jwt.java

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build.gradle 4.34 KB
一键复制 编辑 原始数据 按行查看 历史
scottf 提交于 2024-06-06 14:19 . Start 2.0.2
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
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nats-io/jwt.java.git
git@gitee.com:nats-io/jwt.java.git
nats-io
jwt.java
jwt.java
main

搜索帮助

D67c1975 1850385 1daf7b77 1850385