Skip to content

Commit 121be65

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 f709b7c commit 121be65

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
@@ -19,3 +19,42 @@ dependencies {
1919
implementation "org.apache.maven.shared:file-management:3.1.0"
2020
}
2121

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

0 commit comments

Comments
 (0)