Skip to content

Commit 336eefc

Browse files
committed
HBX-2950 Make adjustments for the release on CI
1 parent 6e614f4 commit 336eefc

File tree

4 files changed

+37
-20
lines changed

4 files changed

+37
-20
lines changed

ci/release/Jenkinsfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ pipeline {
8484
withCredentials([file(credentialsId: 'release.gpg.private-key', variable: 'RELEASE_GPG_PRIVATE_KEY_PATH'),
8585
string(credentialsId: 'release.gpg.passphrase', variable: 'MAVEN_GPG_PASSPHRASE')]) {
8686
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) {
87+
sh 'export MAVEN_LOCAL_REPOSITORY='+env.WORKSPACE_TMP + '/.m2repository'
8788
sh 'cat $HOME/.ssh/config'
8889
sh 'git clone https://github.com/hibernate/hibernate-release-scripts.git'
8990
env.RELEASE_GPG_HOMEDIR = env.WORKSPACE_TMP + '/.gpg'

gradle/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<deploy.skip>false</deploy.skip>
4343

4444
<gradle.executable>./gradlew</gradle.executable>
45+
<gradle.maven.local.path>${user.home}/.m2/repository</gradle.maven.local.path>
4546
</properties>
4647

4748
<dependencies>
@@ -67,6 +68,7 @@
6768
<argument>clean</argument>
6869
<argument>build</argument>
6970
<argument>-Pversion=${project.version}</argument>
71+
<argument>-Dmaven.repo.local=${gradle.maven.local.path}</argument>
7072
</arguments>
7173
</configuration>
7274
<goals>

pom.xml

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -251,25 +251,6 @@
251251
</dependencies>
252252
</dependencyManagement>
253253

254-
<repositories>
255-
<repository>
256-
<snapshots>
257-
<enabled>false</enabled>
258-
</snapshots>
259-
<id>${ossrh.releases.repo.id}</id>
260-
<name>${ossrh.releases.repo.name}</name>
261-
<url>${ossrh.releases.repo.url}</url>
262-
</repository>
263-
<repository>
264-
<snapshots>
265-
<enabled>true</enabled>
266-
</snapshots>
267-
<id>${ossrh.snapshots.repo.id}</id>
268-
<name>${ossrh.snapshots.repo.name}</name>
269-
<url>${ossrh.snapshots.repo.url}</url>
270-
</repository>
271-
</repositories>
272-
273254
<distributionManagement>
274255
<repository>
275256
<id>${ossrh.releases.repo.id}</id>
@@ -386,6 +367,29 @@
386367
<groupId>org.codehaus.mojo</groupId>
387368
<artifactId>flatten-maven-plugin</artifactId>
388369
</plugin>
370+
<plugin>
371+
<groupId>org.apache.maven.plugins</groupId>
372+
<artifactId>maven-enforcer-plugin</artifactId>
373+
<executions>
374+
<execution>
375+
<id>enforce-java-version</id>
376+
<goals>
377+
<goal>enforce</goal>
378+
</goals>
379+
<configuration>
380+
<!--
381+
We want to override the rules for this configuration to remove the bannedRepositories rule from the JBoss parent.
382+
-->
383+
<rules combine.self="override">
384+
<requireJavaVersion>
385+
<message>To build this project JDK ${jdk.min.version} (or greater) is required. Please install it.</message>
386+
<version>${jdk.min.version}</version>
387+
</requireJavaVersion>
388+
</rules>
389+
</configuration>
390+
</execution>
391+
</executions>
392+
</plugin>
389393
</plugins>
390394
</build>
391395

@@ -398,6 +402,10 @@
398402
<value>true</value>
399403
</property>
400404
</activation>
405+
<properties>
406+
<!-- The MAVEN_LOCAL_REPOSITORY env variable is set in the release Jenkins file -->
407+
<gradle.maven.local.path>${MAVEN_LOCAL_REPOSITORY}</gradle.maven.local.path>
408+
</properties>
401409
<build>
402410
<plugins>
403411
<plugin>

test/utils/src/main/java/org/hibernate/tools/test/util/JavaUtil.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
package org.hibernate.tools.test.util;
2121

2222
import java.io.File;
23+
import java.net.URISyntaxException;
2324
import java.net.URL;
2425
import java.security.CodeSource;
2526
import java.util.ArrayList;
@@ -72,7 +73,12 @@ public static String resolvePathToJarFileFor(Class<?> clazz) {
7273
if (codeSource != null) {
7374
URL url = codeSource.getLocation();
7475
if (url != null) {
75-
result = url.getPath();
76+
try {
77+
result = url.toURI().getPath();
78+
}
79+
catch (URISyntaxException e) {
80+
throw new IllegalArgumentException( "Unexpected path to a Jar file: " + url, e );
81+
}
7682
}
7783
}
7884
return result;

0 commit comments

Comments
 (0)