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 {
84
84
withCredentials([file(credentialsId : ' release.gpg.private-key' , variable : ' RELEASE_GPG_PRIVATE_KEY_PATH' ),
85
85
string(credentialsId : ' release.gpg.passphrase' , variable : ' MAVEN_GPG_PASSPHRASE' )]) {
86
86
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'
87
88
sh ' cat $HOME/.ssh/config'
88
89
sh ' git clone https://github.com/hibernate/hibernate-release-scripts.git'
89
90
env. RELEASE_GPG_HOMEDIR = env. WORKSPACE_TMP + ' /.gpg'
Original file line number Diff line number Diff line change 42
42
<deploy .skip>false</deploy .skip>
43
43
44
44
<gradle .executable>./gradlew</gradle .executable>
45
+ <gradle .maven.local.path>${user.home} /.m2/repository</gradle .maven.local.path>
45
46
</properties >
46
47
47
48
<dependencies >
67
68
<argument >clean</argument >
68
69
<argument >build</argument >
69
70
<argument >-Pversion=${project.version} </argument >
71
+ <argument >-Dmaven.repo.local=${gradle.maven.local.path} </argument >
70
72
</arguments >
71
73
</configuration >
72
74
<goals >
Original file line number Diff line number Diff line change 251
251
</dependencies >
252
252
</dependencyManagement >
253
253
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
-
273
254
<distributionManagement >
274
255
<repository >
275
256
<id >${ossrh.releases.repo.id} </id >
386
367
<groupId >org.codehaus.mojo</groupId >
387
368
<artifactId >flatten-maven-plugin</artifactId >
388
369
</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 >
389
393
</plugins >
390
394
</build >
391
395
398
402
<value >true</value >
399
403
</property >
400
404
</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 >
401
409
<build >
402
410
<plugins >
403
411
<plugin >
Original file line number Diff line number Diff line change 20
20
package org .hibernate .tools .test .util ;
21
21
22
22
import java .io .File ;
23
+ import java .net .URISyntaxException ;
23
24
import java .net .URL ;
24
25
import java .security .CodeSource ;
25
26
import java .util .ArrayList ;
@@ -72,7 +73,12 @@ public static String resolvePathToJarFileFor(Class<?> clazz) {
72
73
if (codeSource != null ) {
73
74
URL url = codeSource .getLocation ();
74
75
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
+ }
76
82
}
77
83
}
78
84
return result ;
You can’t perform that action at this time.
0 commit comments