Skip to content

Commit ff76e1d

Browse files
committed
HHH-18644 - New and improved hibernate-maven-plugin
- Add hibernate-core publication to the local Maven repo - Add (incomplete) pom generation for hibernate-maven-plugin Signed-off-by: Koen Aers <[email protected]>
1 parent c4ea4d2 commit ff76e1d

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tooling/hibernate-maven-plugin/hibernate-maven-plugin.gradle

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,42 @@ dependencies {
2121
implementation "org.apache.maven.shared:file-management:3.1.0"
2222
}
2323

24+
publishing {
25+
publications {
26+
hibernateMavenPlugin(MavenPublication) {
27+
from components.java
28+
pom.withXml {
29+
asNode()
30+
.version
31+
.plus {
32+
packaging('maven-plugin')
33+
}
34+
asNode()
35+
.dependencies
36+
.plus {
37+
def plugins = build().appendNode('plugins')
38+
def pluginPlugin = plugins.appendNode('plugin')
39+
pluginPlugin.appendNode('groupId', 'org.apache.maven.plugins')
40+
pluginPlugin.appendNode('artifactId', 'maven-plugin-plugin')
41+
pluginPlugin.appendNode('version', '3.15.0')
42+
def configuration = pluginPlugin.appendNode('configuration')
43+
configuration.appendNode('goalPrefix', 'plugin')
44+
configuration.appendNode('outputDirectory', 'target/generated/sources/plugin-descriptors/META-INF/maven' )
45+
}
46+
}
47+
}
48+
hibernateCore(MavenPublication) {
49+
artifactId 'org.hibernate.orm'
50+
from project(":hibernate-core").components.java
51+
}
52+
}
53+
repositories {
54+
mavenLocal {
55+
url = layout.buildDirectory.dir('maven-embedder/maven-local')
56+
}
57+
}
58+
}
59+
60+
tasks.generatePluginDescriptor.dependsOn generatePomFileForHibernateMavenPluginPublication
61+
tasks.integrationTest.dependsOn publishHibernateCorePublicationToMavenLocalRepository
62+

0 commit comments

Comments
 (0)