Skip to content

Commit 80d7974

Browse files
committed
Fixed gradle settings for publishing release.
1 parent a968b19 commit 80d7974

File tree

2 files changed

+139
-30
lines changed

2 files changed

+139
-30
lines changed

build.gradle

Lines changed: 138 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
buildscript {
22
repositories {
33
maven { url "https://repo.grails.org/grails/core" }
4+
maven { url "https://plugins.gradle.org/m2" }
45
}
56
dependencies {
67
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
78
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.0.10"
89
classpath "org.grails.plugins:hibernate5:7.0.4"
10+
classpath "io.github.gradle-nexus:publish-plugin:1.0.0"
911
}
1012
}
1113

12-
version "3.0.0"
13-
group "org.grails.plugins"
14+
group "io.github.gpc"
1415

1516
apply plugin:"eclipse"
1617
apply plugin: 'idea'
1718
apply plugin:"org.grails.grails-plugin"
18-
apply plugin:"org.grails.grails-plugin-publish"
1919
apply plugin:"asset-pipeline"
2020
apply plugin:"org.grails.grails-gsp"
21+
apply plugin: "maven-publish"
22+
apply plugin: "signing"
23+
apply plugin: "io.github.gradle-nexus.publish-plugin"
2124

2225
repositories {
2326
maven { url "https://repo.grails.org/grails/core" }
@@ -89,34 +92,139 @@ tasks.withType(GroovyCompile) {
8992
}
9093
// enable if you wish to package this plugin as a standalone application
9194
bootJar.enabled = false
92-
grailsPublish {
93-
userOrg = 'kefirsf'
94-
license {
95-
name = 'Apache-2.0'
96-
}
97-
websiteUrl = 'https://grails.org/plugins.html#plugin/asynchronous-mail'
98-
issueTrackerUrl = 'https://github.com/kefirfromperm/grails-asynchronous-mail/issues'
99-
vcsUrl = 'https://github.com/kefirfromperm/grails-asynchronous-mail.git'
100-
title = "Grails Asynchronous Mail plugin"
101-
desc = "The plugin realises asynchronous mail sending. It stores messages in a DB and sends them asynchronously by a quartz job."
102-
developers = [
103-
kefirfromperm:"Vitalii Samolovskikh",
104-
stokito:"Sergey Ponomarev",
105-
ilopmar:"Iván López",
106-
burtbeckwith:"Burt Beckwith",
107-
puneetbehl:"Puneet Behl",
108-
aberbenni:"Alessandro Berbenni",
109-
dpcasady:"Danny Casady",
110-
SAgrawal14:"Shashank Agrawal",
111-
visheshd:"Vishesh",
112-
'micke-a':"Mikael Andersson",
113-
pgdoval:"Pablo González Doval",
114-
Uniqen:"Magnus Dalin",
115-
demon101:"Demon",
116-
matrei:"Mattias Reichel"
117-
]
118-
}
11995

12096
assets {
12197
packagePlugin = true
12298
}
99+
100+
publishing {
101+
publications {
102+
maven(MavenPublication) {
103+
groupId = project.group
104+
artifactId = 'asynchronous-mail'
105+
version = project.version
106+
107+
from components.java
108+
artifact sourcesJar
109+
artifact javadocJar
110+
111+
pom {
112+
name = 'Grails Asynchronous Mail Plugin'
113+
description = 'The plugin realises asynchronous mail sending. It stores messages in a DB and sends them asynchronously by a quartz job.'
114+
url = 'https://github.com/gpc/grails-asynchronous-mail'
115+
licenses {
116+
license {
117+
name = 'The Apache License, Version 2.0'
118+
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
119+
}
120+
}
121+
developers {
122+
developer {
123+
id = 'kefirfromperm'
124+
name = 'Vitalii Samolovskikh'
125+
}
126+
developer {
127+
id = 'stokito'
128+
name = 'Sergey Ponomarev'
129+
}
130+
developer {
131+
id = 'ilopmar'
132+
name = 'Iván López'
133+
}
134+
developer {
135+
id = 'burtbeckwith'
136+
name = 'Burt Beckwith'
137+
}
138+
developer {
139+
id = 'puneetbehl'
140+
name = 'Puneet Behl'
141+
}
142+
developer {
143+
id = 'aberbenni'
144+
name = 'Alessandro Berbenni'
145+
}
146+
developer {
147+
id = 'dpcasady'
148+
name = 'Danny Casady'
149+
}
150+
developer {
151+
id = 'SAgrawal14'
152+
name = 'Shashank Agrawal'
153+
}
154+
developer {
155+
id = 'visheshd'
156+
name = 'Vishesh'
157+
}
158+
developer {
159+
id = 'micke-a'
160+
name = 'Mikael Andersson'
161+
}
162+
developer {
163+
id = 'pgdoval'
164+
name = 'Pablo González Doval'
165+
}
166+
developer {
167+
id = 'Uniqen'
168+
name = 'Magnus Dalin'
169+
}
170+
developer {
171+
id = 'demon101'
172+
name = 'Demon'
173+
}
174+
developer {
175+
id = 'matrei'
176+
name = 'Mattias Reichel'
177+
}
178+
}
179+
scm {
180+
connection = 'scm:git:git://github.com/gpc/grails-asynchronous-mail.git'
181+
developerConnection = 'scm:git:ssh://github.com:gpc/grails-asynchronous-mail.git'
182+
url = 'https://github.com/gpc/grails-asynchronous-mail'
183+
}
184+
}
185+
}
186+
}
187+
}
188+
189+
ext."signing.keyId" = project.findProperty('signing.keyId') ?: System.getenv('SIGNING_KEY_ID')
190+
ext."signing.password" = project.findProperty('signing.password') ?: System.getenv('SIGNING_PASSPHRASE')
191+
ext."signing.secretKeyRingFile" = project.findProperty('signing.secretKeyRingFile') ?: (System.getenv('SIGNING_PASSPHRASE') ?: "${System.getProperty('user.home')}/.gnupg/secring.gpg")
192+
193+
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
194+
195+
afterEvaluate {
196+
signing {
197+
required { isReleaseVersion }
198+
sign publishing.publications.maven
199+
}
200+
}
201+
202+
tasks.withType(Sign) {
203+
onlyIf { isReleaseVersion }
204+
}
205+
206+
nexusPublishing {
207+
repositories {
208+
sonatype {
209+
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.findProperty('sonatypeOss2Username') ?: ''
210+
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.findProperty("sonatypeOss2Password") ?: ''
211+
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.findProperty("sonatypeOssStagingProfileIdJms") ?: ''
212+
213+
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
214+
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
215+
username = ossUser
216+
password = ossPass
217+
stagingProfileId = ossStagingProfileId
218+
}
219+
}
220+
}
221+
222+
task snapshotVersion {
223+
doLast {
224+
if(!project.version.endsWith('-SNAPSHOT')) {
225+
ant.propertyfile(file: "gradle.properties") {
226+
entry(key: "version", value: "${project.version}-SNAPSHOT")
227+
}
228+
}
229+
}
230+
}

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version=3.0.0-SNAPSHOT
12
grailsVersion=4.0.6
23
gormVersion=7.0.8.RELEASE
34
org.gradle.daemon=true

0 commit comments

Comments
 (0)