@@ -83,6 +83,13 @@ def pomConfigurationFor(String pomName, String pomDescription) {
83
83
}
84
84
}
85
85
86
+ def appendDependency (Object dependencies , String artifactId ) {
87
+ def dependency = dependencies. appendNode(' dependency' )
88
+ dependency. appendNode(' groupId' , ' org.hamcrest' )
89
+ dependency. appendNode(' artifactId' , artifactId)
90
+ dependency. appendNode(' version' , rootProject. version)
91
+ }
92
+
86
93
def publishToOssrh = project. hasProperty(' ossrhUsername' ) && project. hasProperty(' ossrhPassword' )
87
94
88
95
publishing {
@@ -97,6 +104,28 @@ publishing {
97
104
' Hamcrest' ,
98
105
' Core API and libraries of hamcrest matcher framework.' )
99
106
}
107
+
108
+ hamcrestCore(MavenPublication ) {
109
+ artifactId ' hamcrest-core'
110
+ pom pomConfigurationFor(
111
+ ' Hamcrest Core' ,
112
+ ' Core Hamcrest API - deprecated, please use "hamcrest" instead' )
113
+ pom. withXml {
114
+ def dependencies = asNode(). appendNode(' dependencies' )
115
+ appendDependency(dependencies, ' hamcrest' )
116
+ }
117
+ }
118
+
119
+ hamcrestLibrary(MavenPublication ) {
120
+ artifactId ' hamcrest-library'
121
+ pom pomConfigurationFor(
122
+ ' Hamcrest Library' ,
123
+ ' A library of Hamcrest matchers - deprecated, please use "hamcrest" instead' )
124
+ pom. withXml {
125
+ def dependencies = asNode(). appendNode(' dependencies' )
126
+ appendDependency(dependencies, ' hamcrest-core' )
127
+ }
128
+ }
100
129
}
101
130
repositories {
102
131
if (publishToOssrh) {
@@ -116,4 +145,6 @@ publishing {
116
145
signing {
117
146
required { publishToOssrh }
118
147
sign publishing. publications. hamcrest
148
+ sign publishing. publications. hamcrestCore
149
+ sign publishing. publications. hamcrestLibrary
119
150
}
0 commit comments