1- apply plugin : ' maven-publish'
2- apply plugin : ' signing'
3-
4- ext. set(' signing.keyId' , System . getenv(' SIGNING_KEY' ))
5- ext. set(' signing.password' , System . getenv(' SIGNING_PASSPHRASE' ))
6- ext. set(' signing.secretKeyRingFile' , project. findProperty(' signing.secretKeyRingFile' ) ?: " ${ System.properties['user.home']}${ File.separator} .gnupg${ File.separator} secring.gpg" )
7-
8- publishing {
9- if (isSnapshot) {
10- repositories {
11- maven {
12- credentials {
13- username = System . getenv(' ARTIFACTORY_USERNAME' ) ?: ' '
14- password = System . getenv(' ARTIFACTORY_PASSWORD' ) ?: ' '
15- }
16- url = ' https://repo.grails.org/grails/libs-snapshots-local'
17- }
18- }
19- }
20-
21- publications {
22- maven(MavenPublication ) {
23-
24- artifactId = project. findProperty(' artifactId' ) ?: project. name
25- groupId = project. group
26- version = project. version
27-
28- from components. java
29-
30- pom {
31- name = project. findProperty(' pomTitle' ) ?: ' Grails GORM'
32- description = project. findProperty(' pomDescription' ) ?: ' GORM - Grails Data Access Framework'
33- url = ' https://gorm.grails.org/'
34-
35- licenses {
36- license {
37- name = ' The Apache Software License, Version 2.0'
38- url = ' https://www.apache.org/licenses/LICENSE-2.0.txt'
39- distribution = ' repo'
40- }
41- }
42-
43- developers {
44- for (dev in project. findProperty(' pomDevelopers' ) ?: [[id : ' graemerocher' , name : ' Graeme Rocher' ], [id : ' jeffscottbrown' , name : ' Jeff Brown' ], [id : ' burtbeckwith' , name : ' Burt Beckwith' ], [id : ' jameskleeh' , name : ' James Kleeh' ], [id : ' puneetbehl' , name : ' Puneet Behl' ], [id : ' jamesfredley' , name : ' James Fredley' ]]) {
45- developer {
46- id = dev. id
47- name = dev. name
48- }
49- }
50- }
51-
52- scm {
53- url
= ' scm:[email protected] :grails/grails-data-mapping.git' 54- connection
= ' scm:[email protected] :grails/grails-data-mapping.git' 55- developerConnection
= ' scm:[email protected] :grails/grails-data-mapping.git' 56- }
57- }
58-
59- // dependency management shouldn't be included
60- pom. withXml {
61- def pomNode = asNode()
62- try { pomNode. dependencyManagement. replaceNode({}) } catch (Throwable ignore) {}
63- }
64- }
65- }
1+ import org.grails.gradle.plugin.publishing.GrailsPublishExtension
2+
3+ apply plugin : ' org.grails.grails-publish'
4+
5+ project. extensions. configure(GrailsPublishExtension ) {
6+ it. githubSlug = ' grails/grails-data-mapping'
7+ it. license. name = ' Apache-2.0'
8+ it. title = findProperty(' pomTitle' ) ?: ' Grails GORM'
9+ it. desc = findProperty(' pomDescription' ) ?: ' GORM - Grails Data Access Framework'
10+ it. developers = findProperty(' pomDevelopers' ) as Map<String ,String > ?: [
11+ ' graemerocher' : ' Graeme Rocher' ,
12+ ' jeffscottbrown' : ' Jeff Brown' ,
13+ ' burtbeckwith' : ' Burt Beckwith' ,
14+ ' jameskleeh' : ' James Kleeh' ,
15+ ' puneetbehl' : ' Puneet Behl' ,
16+ ' jamesfredley' : ' James Fredley'
17+ ]
6618}
67-
68- afterEvaluate {
69- signing {
70- required = { isReleaseVersion && gradle. taskGraph. hasTask(' publish' ) }
71- sign(publishing. publications. maven)
72- }
73- }
74-
75- tasks. withType(Sign ). configureEach {
76- onlyIf { isReleaseVersion }
77- }
0 commit comments