@@ -83,6 +83,13 @@ def pomConfigurationFor(String pomName, String pomDescription) {
8383 }
8484}
8585
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+
8693def publishToOssrh = project. hasProperty(' ossrhUsername' ) && project. hasProperty(' ossrhPassword' )
8794
8895publishing {
@@ -97,6 +104,28 @@ publishing {
97104 ' Hamcrest' ,
98105 ' Core API and libraries of hamcrest matcher framework.' )
99106 }
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+ }
100129 }
101130 repositories {
102131 if (publishToOssrh) {
@@ -116,4 +145,6 @@ publishing {
116145signing {
117146 required { publishToOssrh }
118147 sign publishing. publications. hamcrest
148+ sign publishing. publications. hamcrestCore
149+ sign publishing. publications. hamcrestLibrary
119150}
0 commit comments