Skip to content

Commit 24548a5

Browse files
authored
Merge branch 'hibernate:main' into HBX-2931
2 parents 58c1af2 + 251b6e6 commit 24548a5

File tree

25 files changed

+1090
-65
lines changed

25 files changed

+1090
-65
lines changed

.github/workflows/build_test.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ jobs:
2424
- name: Build and Test
2525
uses: GabrielBB/xvfb-action@v1
2626
with:
27-
run: mvn clean install
28-
27+
run: ./mvnw clean install

.mvn/wrapper/maven-wrapper.jar

61.6 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
wrapperVersion=3.3.2
18+
distributionType=bin
19+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip
20+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar

ant/pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
<description>Hibernate Tools Ant Tasks</description>
3131
<packaging>jar</packaging>
3232

33+
<properties>
34+
<!-- This is a publicly distributed module that should be published: -->
35+
<deploy.skip>false</deploy.skip>
36+
</properties>
37+
3338
<dependencies>
3439
<dependency>
3540
<groupId>org.apache.ant</groupId>

ci/release/Jenkinsfile

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/*
2+
* Hibernate Tools, Tooling for your Hibernate Projects
3+
*
4+
* Copyright 2016-2024 Red Hat, Inc.
5+
*
6+
* Licensed under the GNU Lesser General Public License (LGPL),
7+
* version 2.1 or later (the "License").
8+
* You may not use this file except in compliance with the License.
9+
* You may read the licence in the 'lgpl.txt' file in the root folder of
10+
* project or obtain a copy at
11+
*
12+
* http://www.gnu.org/licenses/lgpl-2.1.html
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" basis,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*/
20+
@Library('hibernate-jenkins-pipeline-helpers') _
21+
22+
import org.hibernate.jenkins.pipeline.helpers.version.Version
23+
24+
pipeline {
25+
agent {
26+
label 'Release'
27+
}
28+
tools {
29+
maven 'Apache Maven 3.9'
30+
jdk 'OpenJDK 21 Latest'
31+
}
32+
options {
33+
buildDiscarder logRotator(daysToKeepStr: '30', numToKeepStr: '10')
34+
disableConcurrentBuilds(abortPrevious: false)
35+
}
36+
parameters {
37+
string(
38+
name: 'RELEASE_VERSION',
39+
defaultValue: '',
40+
description: 'The version to be released, e.g. 7.0.0.Final.',
41+
trim: true
42+
)
43+
string(
44+
name: 'DEVELOPMENT_VERSION',
45+
defaultValue: '',
46+
description: 'The next version to be used after the release, e.g. 7.0.1-SNAPSHOT.',
47+
trim: true
48+
)
49+
booleanParam(
50+
name: 'RELEASE_DRY_RUN',
51+
defaultValue: false,
52+
description: 'If true, just simulate the release, without pushing any commits or tags, and without uploading any artifacts or documentation.'
53+
)
54+
}
55+
stages {
56+
stage('Release') {
57+
when {
58+
beforeAgent true
59+
// Releases must be triggered explicitly
60+
// This is just for safety; normally the Jenkins job for this pipeline
61+
// should be configured to "Suppress automatic SCM triggering"
62+
// See https://stackoverflow.com/questions/58259326/prevent-jenkins-multibranch-pipeline-from-triggering-builds-for-new-branches
63+
triggeredBy cause: "UserIdCause"
64+
}
65+
steps {
66+
script {
67+
// Check that all the necessary parameters are set
68+
if (!params.RELEASE_VERSION) {
69+
throw new IllegalArgumentException("Missing value for parameter RELEASE_VERSION.")
70+
}
71+
if (!params.DEVELOPMENT_VERSION) {
72+
throw new IllegalArgumentException("Missing value for parameter DEVELOPMENT_VERSION.")
73+
}
74+
75+
def releaseVersion = Version.parseReleaseVersion(params.RELEASE_VERSION)
76+
def developmentVersion = Version.parseDevelopmentVersion(params.DEVELOPMENT_VERSION)
77+
echo "Performing full release for version ${releaseVersion.toString()}"
78+
79+
withMaven(mavenSettingsConfig: params.RELEASE_DRY_RUN ? null : 'ci-hibernate.deploy.settings.maven',
80+
mavenLocalRepo: env.WORKSPACE_TMP + '/.m2repository') {
81+
configFileProvider([configFile(fileId: 'release.config.ssh', targetLocation: env.HOME + '/.ssh/config'),
82+
configFile(fileId: 'release.config.ssh.knownhosts', targetLocation: env.HOME + '/.ssh/known_hosts')]) {
83+
// using MAVEN_GPG_PASSPHRASE (the default env variable name for passphrase in maven gpg plugin)
84+
withCredentials([file(credentialsId: 'release.gpg.private-key', variable: 'RELEASE_GPG_PRIVATE_KEY_PATH'),
85+
string(credentialsId: 'release.gpg.passphrase', variable: 'MAVEN_GPG_PASSPHRASE')]) {
86+
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) {
87+
sh 'cat $HOME/.ssh/config'
88+
sh 'git clone https://github.com/hibernate/hibernate-release-scripts.git'
89+
env.RELEASE_GPG_HOMEDIR = env.WORKSPACE_TMP + '/.gpg'
90+
sh """
91+
bash -xe hibernate-release-scripts/release.sh ${params.RELEASE_DRY_RUN ? '-d' : ''} \
92+
tools ${releaseVersion.toString()} ${developmentVersion.toString()}
93+
"""
94+
}
95+
}
96+
}
97+
}
98+
}
99+
}
100+
}
101+
}
102+
post {
103+
always {
104+
notifyBuildResult notifySuccessAfterSuccess: true, maintainers: '[email protected]'
105+
}
106+
}
107+
}

gradle/pom.xml

+36-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
-->
1717
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1818
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
19-
19+
2020
<modelVersion>4.0.0</modelVersion>
2121

2222
<parent>
@@ -26,6 +26,7 @@
2626
</parent>
2727

2828
<artifactId>hibernate-tools-gradle</artifactId>
29+
<packaging>pom</packaging>
2930

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

3940
<properties>
41+
<!-- This is a publicly distributed module that should be published: -->
42+
<deploy.skip>false</deploy.skip>
43+
4044
<gradle.executable>./gradlew</gradle.executable>
4145
</properties>
42-
46+
47+
<dependencies>
48+
<dependency>
49+
<groupId>org.hibernate.tool</groupId>
50+
<artifactId>hibernate-tools-orm</artifactId>
51+
</dependency>
52+
</dependencies>
53+
4354
<build>
4455
<plugins>
4556
<!-- execute Gradle command -->
@@ -56,6 +67,7 @@
5667
<argument>clean</argument>
5768
<argument>build</argument>
5869
<argument>-Pversion=${project.version}</argument>
70+
<argument>-Dmaven.repo.local=${settings.localRepository}</argument>
5971
</arguments>
6072
</configuration>
6173
<goals>
@@ -64,6 +76,28 @@
6476
</execution>
6577
</executions>
6678
</plugin>
79+
<!-- As the artifact is built by Gradle, we attach it with the helper plugin so that it gets published: -->
80+
<plugin>
81+
<groupId>org.codehaus.mojo</groupId>
82+
<artifactId>build-helper-maven-plugin</artifactId>
83+
<executions>
84+
<execution>
85+
<id>attach-artifacts</id>
86+
<phase>package</phase>
87+
<goals>
88+
<goal>attach-artifact</goal>
89+
</goals>
90+
<configuration>
91+
<artifacts>
92+
<artifact>
93+
<file>${project.basedir}/plugin/build/libs/${project.artifactId}-${project.version}.jar</file>
94+
<type>jar</type>
95+
</artifact>
96+
</artifacts>
97+
</configuration>
98+
</execution>
99+
</executions>
100+
</plugin>
67101
</plugins>
68102
</build>
69103

jbt/pom.xml

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
~
55
~ Copyright 2022-2023 Red Hat, Inc.
66
~
7-
~ Licensed under the GNU Lesser General Public License (LGPL),
7+
~ Licensed under the GNU Lesser General Public License (LGPL),
88
~ version 2.1 or later (the "License").
99
~ You may not use this file except in compliance with the License.
10-
~ You may read the licence in the 'lgpl.txt' file in the root folder of
10+
~ You may read the licence in the 'lgpl.txt' file in the root folder of
1111
~ project or obtain a copy at
1212
~
1313
~ http://www.gnu.org/licenses/lgpl-2.1.html
@@ -35,6 +35,11 @@
3535
<name>Hibernate Tools ORM - JBoss Tools Adapter</name>
3636
<description>Hibernate Tools ORM - JBoss Tools Adapter</description>
3737

38+
<properties>
39+
<!-- This is a publicly distributed module that should be published: -->
40+
<deploy.skip>false</deploy.skip>
41+
</properties>
42+
3843
<dependencies>
3944
<dependency>
4045
<groupId>com.h2database</groupId>

jbt/src/main/java/org/hibernate/tool/orm/jbt/internal/factory/SessionFactoryWrapperFactory.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public Map<String, ClassMetadataWrapper> getAllClassMetadata() {
4444
Map<String, ClassMetadataWrapper> result = new HashMap<String, ClassMetadataWrapper>();
4545
MappingMetamodelImpl mappingMetaModel = (MappingMetamodelImpl)((SessionFactoryImplementor)sessionFactory).getMappingMetamodel();
4646
for (String key : mappingMetaModel.getAllEntityNames()) {
47-
result.put(key, ClassMetadataWrapperFactory.createClassMetadataWrapper(mappingMetaModel.entityPersister(key)));
47+
result.put(key, ClassMetadataWrapperFactory.createClassMetadataWrapper(mappingMetaModel.findEntityDescriptor(key)));
4848
}
4949
return result;
5050
}
@@ -54,7 +54,7 @@ public Map<String, CollectionMetadataWrapper> getAllCollectionMetadata() {
5454
Map<String, CollectionMetadataWrapper> result = new HashMap<String, CollectionMetadataWrapper>();
5555
MappingMetamodelImpl mappingMetaModel = (MappingMetamodelImpl)((SessionFactoryImplementor)sessionFactory).getMappingMetamodel();
5656
for (String key : mappingMetaModel.getAllCollectionRoles()) {
57-
result.put(key, CollectionMetadataWrapperFactory.createCollectionMetadataWrapper(mappingMetaModel.collectionPersister(key)));
57+
result.put(key, CollectionMetadataWrapperFactory.createCollectionMetadataWrapper(mappingMetaModel.findCollectionDescriptor(key)));
5858
}
5959
return result;
6060
}

maven/pom.xml

+8-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@
6868
</prerequisites>
6969

7070
<properties>
71-
<maven.deploy.skip>false</maven.deploy.skip>
71+
<!-- This is a publicly distributed module that should be published: -->
72+
<deploy.skip>false</deploy.skip>
7273
<maven.install.skip>false</maven.install.skip>
7374

7475
<maven-plugin-annotations.version>3.5</maven-plugin-annotations.version>
@@ -128,12 +129,18 @@
128129
<execution>
129130
<id>default-descriptor</id>
130131
<phase>process-classes</phase>
132+
<configuration>
133+
<goalPrefix>hibernate-tools</goalPrefix>
134+
</configuration>
131135
</execution>
132136
<execution>
133137
<id>help-goal</id>
134138
<goals>
135139
<goal>helpmojo</goal>
136140
</goals>
141+
<configuration>
142+
<goalPrefix>hibernate-tools</goalPrefix>
143+
</configuration>
137144
</execution>
138145
</executions>
139146
</plugin>

0 commit comments

Comments
 (0)