File tree Expand file tree Collapse file tree 4 files changed +37
-20
lines changed
test/utils/src/main/java/org/hibernate/tools/test/util Expand file tree Collapse file tree 4 files changed +37
-20
lines changed Original file line number Diff line number Diff 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'
Original file line number Diff line number Diff line change 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 >
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 >
Original file line number Diff line number Diff line change 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 >
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
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 >
Original file line number Diff line number Diff line change 2020package org .hibernate .tools .test .util ;
2121
2222import java .io .File ;
23+ import java .net .URISyntaxException ;
2324import java .net .URL ;
2425import java .security .CodeSource ;
2526import 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 ;
You can’t perform that action at this time.
0 commit comments