Skip to content

Commit

Permalink
#6 progress
Browse files Browse the repository at this point in the history
  • Loading branch information
robertoschwald committed Oct 27, 2021
1 parent 7c9204f commit 8e6ad0a
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 7 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,6 @@ Compared to the quartz-monitor plugin, this plugin is agnostic to the used quart
any quartz-plugin factories.
Its implemented to register an org.quartz.JobListener, which listens to all Job tasks.
This listener updates Job metrics in the QuartzMonitorService, which also provides additional figures like the startTime of a Job.

## Deployment
The plugin artifact is deployed to Sonatype (Maven Central) by GitHub Actions.
70 changes: 69 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository

buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
Expand All @@ -7,4 +9,70 @@ buildscript {
}
}

apply plugin: "io.github.gradle-nexus.publish-plugin"
plugins {
id 'java'
id 'groovy'
id 'java-library'
id 'signing'
id 'idea'
id 'maven-publish'
}

version project.file("version.txt").text.trim()

ext {
isBuildSnapshot = version.endsWith('-SNAPSHOT')
isReleaseVersion = !isBuildSnapshot
}

if (isReleaseVersion) {
apply plugin: "io.github.gradle-nexus.publish-plugin"
nexusPublishing {
repositories {
sonatype {
if(project.hasProperty('mavenUser')) {
username = mavenUser
password = mavenPassword
}
}
}
}
}

subprojects { project ->
sourceCompatibility = '1.8'
targetCompatibility = '1.8'

if (project.name.startsWith("plugin")) {
apply plugin:'maven-publish'
apply plugin:'signing'
afterEvaluate {
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
sign publishing.publications.maven
}
}

tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}

//do not generate extra load on Nexus with new staging repository if signing fails
tasks.withType(InitializeNexusStagingRepository).configureEach {
shouldRunAfter(tasks.withType(Sign))
}
}

}

repositories {
mavenLocal()
mavenCentral()
}

test {
testLogging {
exceptionFormat = 'full'
showStandardStreams = true
}
}
9 changes: 4 additions & 5 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
Expand All @@ -19,7 +18,6 @@ buildscript {


group "com.symentis"
version project.file("../version.txt").text.trim()

apply plugin:"eclipse"
apply plugin:"idea"
Expand All @@ -31,11 +29,12 @@ apply plugin:"org.grails.grails-gsp"
apply plugin: 'maven-publish'
apply plugin: 'signing'


apply plugin:"org.asciidoctor.convert"

ext {
grailsVersion = project.grailsVersion
}

sourceCompatibility = targetCompatibility = 1.8

repositories {
mavenLocal()
Expand Down Expand Up @@ -123,7 +122,7 @@ publishing {
publications {
maven(MavenPublication) {
groupId = project.group
artifactId = 'my-plugin'
artifactId = 'schwartz-monitor'
version = project.version

from components.java
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.3-SNAPSHOT
2.0.2

0 comments on commit 8e6ad0a

Please sign in to comment.