1+ /*
2+ * Copyright 2015-2019 the original author or authors.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+ plugins {
17+ id ' java-library'
18+ id ' maven'
19+ id ' maven-publish'
20+ id ' com.jfrog.artifactory'
21+ id ' com.jfrog.bintray'
22+ id ' io.morethan.jmhreport'
23+ id ' me.champeau.gradle.jmh'
24+ }
25+
26+ description = ' Bill of materials to make sure a consistent set of versions is used for RSocket-Java.'
27+ configurations. archives. artifacts. clear()
28+
29+ build. doLast {
30+ pom {
31+ customizePom(it, project)
32+ }
33+ }
34+
35+ dependencies {
36+ compile project(' :rsocket-core' )
37+ compile project(' :rsocket-test' )
38+ compile project(' :rsocket-load-balancer' )
39+ compile project(' :rsocket-micrometer' )
40+ compile project(' :rsocket-transport-local' )
41+ compile project(' :rsocket-transport-netty' )
42+ }
43+
44+ def customizePom (generatedPom , gradleProject ) {
45+ // make sure that dependencies are under <dependencyManagement>
46+ generatedPom. withXml {
47+ if (generatedPom. generatedDependencies. size > 0 ) {
48+ asNode(). appendNode(' dependencyManagement' , asNode(). dependencies)
49+ asNode(). dependencies. replaceNode {}
50+ }
51+ }
52+
53+ generatedPom. project {
54+ name = ' RSocket-Java Release Train - BOM'
55+ description = gradleProject. description
56+ url = ' http://rsocket.io'
57+ groupId = group
58+ packaging = " pom"
59+ licenses {
60+ license {
61+ name = ' The Apache License, Version 2.0'
62+ url = ' http://www.apache.org/licenses/LICENSE-2.0.txt'
63+ }
64+ }
65+ developers {
66+ developer {
67+ id ' robertroeser'
68+ name ' Robert Roeser'
69+ email ' robert@netifi.com'
70+ }
71+ developer {
72+ id ' rdegnan'
73+ name ' Ryland Degnan'
74+ email ' ryland@netifi.com'
75+ }
76+ developer {
77+ id ' yschimke'
78+ name ' Yuri Schimke'
79+ email ' yuri@schimke.ee'
80+ }
81+ developer {
82+ id ' OlegDokuka'
83+ name ' Oleh Dokuka'
84+ email ' oleh@netifi.com'
85+ }
86+ developer {
87+ id ' mostroverkhov'
88+ name ' Maksym Ostroverkhov'
89+ email ' m.ostroverkhov@gmail.com'
90+ }
91+ }
92+ scm {
93+ connection = ' scm:git:git://github.com/rsocket/rsocket-java.git'
94+ developerConnection = ' scm:git:ssh://github.com/rsocket/rsocket-java.git'
95+ url = ' http://github.com/rsocket/rsocket-java/'
96+ }
97+ issueManagement {
98+ system = " GitHub Issues"
99+ url = " https://github.com/rsocket/rsocket-java/issues"
100+ }
101+ }
102+
103+ generatedPom. writeTo(" $buildDir /poms/rsocket-bom-${ version} .xml" )
104+ }
105+ plugins. withType(MavenPublishPlugin ) {
106+ publishing {
107+ publications {
108+ mavenJava(MavenPublication ) {
109+ pom. withXml {
110+ def sb = asString()
111+ sb. setLength 0
112+ sb. append file(" $buildDir /poms/rsocket-bom-${ version} .xml" ). text
113+ println (sb. toString())
114+ }
115+ }
116+ }
117+ }
118+ }
119+
120+ publish. dependsOn(" build" )
121+ publishToMavenLocal. dependsOn(" build" )
0 commit comments