Skip to content

Commit

Permalink
添加发布设置
Browse files Browse the repository at this point in the history
  • Loading branch information
chaofanx committed Nov 25, 2023
1 parent 241e552 commit ef2c4a0
Showing 1 changed file with 64 additions and 5 deletions.
69 changes: 64 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}

group = 'xyz.chaofan.solon'
version = '1.0.0'
description = 'solon-detector-prometheus is a Prometheus monitoring plug-in based on the Solon framework.'

repositories {
mavenCentral()
Expand All @@ -14,14 +17,70 @@ dependencies {
implementation 'org.noear:solon'
implementation 'org.slf4j:slf4j-api'
implementation 'io.micrometer:micrometer-registry-prometheus:1.11.5'
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
}

test {
useJUnitPlatform()
}

artifacts {
archives jar
}

java {
withJavadocJar()
withSourcesJar()
}

javadoc {
options.addStringOption("charset", "UTF-8")
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'solon-detector-prometheus'
from components.java
pom {
name = project.name
description = description
url = 'https://github.com/chaofanx/solon-detector-prometheus'
licenses {
license {
name = 'Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'chaofanx'
name = 'chaofanx'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/chaofanx/solon-detector-prometheus'
developerConnection = 'scm:git:ssh://github.com/chaofanx/solon-detector-prometheus.git'
url = 'https://github.com/chaofanx/solon-detector-prometheus'
}
}
}
}
repositories {
maven {
name = "OSSRH"
if (project.version.toString().endsWith("-SNAPSHOT")) {
url = "https://s01.oss.sonatype.org/content/repositories/snapshots"
} else {
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
}
credentials {
username = findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
password = findProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD")
}
}
}
}

signing {
sign(publishing.publications.mavenJava)
}

0 comments on commit ef2c4a0

Please sign in to comment.