Skip to content

Commit b993d3f

Browse files
committed
HBX-2936 Install gradle plugin with build-helper-maven-plugin
as it is build by Gradle, and we need to add an extra jar to the artifacts we publish
1 parent 0b4a0ea commit b993d3f

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

gradle/pom.xml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
-->
1717
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1818
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
19-
19+
2020
<modelVersion>4.0.0</modelVersion>
2121

2222
<parent>
@@ -26,6 +26,7 @@
2626
</parent>
2727

2828
<artifactId>hibernate-tools-gradle</artifactId>
29+
<packaging>pom</packaging>
2930

3031
<name>Hibernate Tools Gradle Plugin</name>
3132
<description>Gradle plugin to provide hibernate-tools reverse engineering and code/schema generation abilities.</description>
@@ -37,9 +38,19 @@
3738
</issueManagement>
3839

3940
<properties>
41+
<!-- This is a publicly distributed module that should be published: -->
42+
<deploy.skip>false</deploy.skip>
43+
4044
<gradle.executable>./gradlew</gradle.executable>
4145
</properties>
42-
46+
47+
<dependencies>
48+
<dependency>
49+
<groupId>org.hibernate.tool</groupId>
50+
<artifactId>hibernate-tools-orm</artifactId>
51+
</dependency>
52+
</dependencies>
53+
4354
<build>
4455
<plugins>
4556
<!-- execute Gradle command -->
@@ -64,6 +75,28 @@
6475
</execution>
6576
</executions>
6677
</plugin>
78+
<!-- As the artifact is built by Gradle, we attach it with the helper plugin so that it gets published: -->
79+
<plugin>
80+
<groupId>org.codehaus.mojo</groupId>
81+
<artifactId>build-helper-maven-plugin</artifactId>
82+
<executions>
83+
<execution>
84+
<id>attach-artifacts</id>
85+
<phase>package</phase>
86+
<goals>
87+
<goal>attach-artifact</goal>
88+
</goals>
89+
<configuration>
90+
<artifacts>
91+
<artifact>
92+
<file>${project.basedir}/plugin/build/libs/${project.artifactId}-${project.version}.jar</file>
93+
<type>jar</type>
94+
</artifact>
95+
</artifacts>
96+
</configuration>
97+
</execution>
98+
</executions>
99+
</plugin>
67100
</plugins>
68101
</build>
69102

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@
337337
<!-- Keep things like url, inceptionYear, authors...
338338
everything that's required by the OSSRH Maven repository -->
339339
<flattenMode>ossrh</flattenMode>
340+
<!-- To make sure that `hibernate-tools-gradle` module that has a pom packaging will also publish the flattened pom -->
341+
<updatePomFile>true</updatePomFile>
340342
</configuration>
341343
<executions>
342344
<execution>

0 commit comments

Comments
 (0)