Skip to content

Commit

Permalink
HBX-2950 Make adjustments for the release on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
marko-bekhta committed Jan 9, 2025
1 parent 6e614f4 commit 336eefc
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 20 deletions.
1 change: 1 addition & 0 deletions ci/release/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ pipeline {
withCredentials([file(credentialsId: 'release.gpg.private-key', variable: 'RELEASE_GPG_PRIVATE_KEY_PATH'),
string(credentialsId: 'release.gpg.passphrase', variable: 'MAVEN_GPG_PASSPHRASE')]) {
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) {
sh 'export MAVEN_LOCAL_REPOSITORY='+env.WORKSPACE_TMP + '/.m2repository'
sh 'cat $HOME/.ssh/config'
sh 'git clone https://github.com/hibernate/hibernate-release-scripts.git'
env.RELEASE_GPG_HOMEDIR = env.WORKSPACE_TMP + '/.gpg'
Expand Down
2 changes: 2 additions & 0 deletions gradle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<deploy.skip>false</deploy.skip>

<gradle.executable>./gradlew</gradle.executable>
<gradle.maven.local.path>${user.home}/.m2/repository</gradle.maven.local.path>
</properties>

<dependencies>
Expand All @@ -67,6 +68,7 @@
<argument>clean</argument>
<argument>build</argument>
<argument>-Pversion=${project.version}</argument>
<argument>-Dmaven.repo.local=${gradle.maven.local.path}</argument>
</arguments>
</configuration>
<goals>
Expand Down
46 changes: 27 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -251,25 +251,6 @@
</dependencies>
</dependencyManagement>

<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>${ossrh.releases.repo.id}</id>
<name>${ossrh.releases.repo.name}</name>
<url>${ossrh.releases.repo.url}</url>
</repository>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>${ossrh.snapshots.repo.id}</id>
<name>${ossrh.snapshots.repo.name}</name>
<url>${ossrh.snapshots.repo.url}</url>
</repository>
</repositories>

<distributionManagement>
<repository>
<id>${ossrh.releases.repo.id}</id>
Expand Down Expand Up @@ -386,6 +367,29 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-java-version</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<!--
We want to override the rules for this configuration to remove the bannedRepositories rule from the JBoss parent.
-->
<rules combine.self="override">
<requireJavaVersion>
<message>To build this project JDK ${jdk.min.version} (or greater) is required. Please install it.</message>
<version>${jdk.min.version}</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand All @@ -398,6 +402,10 @@
<value>true</value>
</property>
</activation>
<properties>
<!-- The MAVEN_LOCAL_REPOSITORY env variable is set in the release Jenkins file -->
<gradle.maven.local.path>${MAVEN_LOCAL_REPOSITORY}</gradle.maven.local.path>
</properties>
<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.hibernate.tools.test.util;

import java.io.File;
import java.net.URISyntaxException;
import java.net.URL;
import java.security.CodeSource;
import java.util.ArrayList;
Expand Down Expand Up @@ -72,7 +73,12 @@ public static String resolvePathToJarFileFor(Class<?> clazz) {
if (codeSource != null) {
URL url = codeSource.getLocation();
if (url != null) {
result = url.getPath();
try {
result = url.toURI().getPath();
}
catch (URISyntaxException e) {
throw new IllegalArgumentException( "Unexpected path to a Jar file: " + url, e );
}
}
}
return result;
Expand Down

0 comments on commit 336eefc

Please sign in to comment.