Skip to content

Commit

Permalink
HBX-2936 Install gradle plugin with build-helper-maven-plugin
Browse files Browse the repository at this point in the history
as it is build by Gradle, and we need to add an extra jar to the artifacts we publish
  • Loading branch information
marko-bekhta committed Dec 2, 2024
1 parent 628809a commit c043280
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
37 changes: 35 additions & 2 deletions gradle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
Expand All @@ -26,6 +26,7 @@
</parent>

<artifactId>hibernate-tools-gradle</artifactId>
<packaging>pom</packaging>

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

<properties>
<!-- This is a publicly distributed module that should be published: -->
<deploy.skip>false</deploy.skip>

<gradle.executable>./gradlew</gradle.executable>
</properties>


<dependencies>
<dependency>
<groupId>org.hibernate.tool</groupId>
<artifactId>hibernate-tools-orm</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<!-- execute Gradle command -->
Expand All @@ -64,6 +75,28 @@
</execution>
</executions>
</plugin>
<!-- As the artifact is built by Gradle, we attach it with the helper plugin so that it gets published: -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${project.basedir}/plugin/build/libs/${project.artifactId}-${project.version}.jar</file>
<type>jar</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@
<!-- Keep things like url, inceptionYear, authors...
everything that's required by the OSSRH Maven repository -->
<flattenMode>ossrh</flattenMode>
<!-- To make sure that `hibernate-tools-gradle` module that has a pom packaging will also publish the flattened pom -->
<updatePomFile>true</updatePomFile>
</configuration>
<executions>
<execution>
Expand Down

0 comments on commit c043280

Please sign in to comment.