Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,45 @@ updates:
directory: "/"
schedule:
interval: monthly
groups:
workflow-actions:
patterns:
- "*"
allow:
- dependency-name: "actions/*"
- dependency-name: "redhat-actions/*"
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "weekly"
day: "tuesday"
open-pull-requests-limit: 20
groups:
gradle-plugins:
patterns:
- "com.diffplug.spotless*"
- "com.dorongold.task-tree*"
- "org.checkerframework*"
- "com.gradle.develocity*"
jakarta:
patterns:
- "jakarta.*"
- "org.glassfish.jaxb*"
logging:
patterns:
- "org.jboss.logging*"
- "org.apache.logging*"
json:
patterns:
- "com.fasterxml.jackson*"
- "org.eclipse:yasson"
test:
patterns:
- "org.junit.jupiter*"
- "org.junit.platform*"
- "org.assertj*"
- "com.h2database*"
ignore:
# Handle major Jakarta updates manually:
- dependency-name: "jakarta*"
update-types: ["version-update:semver-major"]
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id "release-process"
id 'com.diffplug.spotless' version '6.25.0' apply false

id "com.dorongold.task-tree" version "4.0.0"
alias(libs.plugins.spotless) apply false
alias(libs.plugins.taskTree)
}
8 changes: 4 additions & 4 deletions buildSrc/src/main/groovy/java-module.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ plugins {
}

dependencies {
implementation libs.logging
implementation libs.loggingCore

compileOnly libs.loggingAnnotations

annotationProcessor libs.loggingCore
annotationProcessor libs.loggingProcessor
annotationProcessor libs.logging
annotationProcessor libs.loggingAnnotations
}

Expand All @@ -19,8 +19,8 @@ dependencies {
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

java {
sourceCompatibility = jdks.versions.baseline.get() as int
targetCompatibility = jdks.versions.baseline.get() as int
sourceCompatibility = libs.versions.jdks.baseline.get() as int
targetCompatibility = libs.versions.jdks.baseline.get() as int
}

// create a single "compile" task
Expand Down
16 changes: 9 additions & 7 deletions buildSrc/src/main/groovy/testing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ plugins {
}

dependencies {
testImplementation jakartaLibs.jpa
testImplementation testLibs.junit5Api
testImplementation testLibs.assertjCore
testImplementation testLibs.junit5Params
testImplementation libs.jakarta.jpa
testImplementation libs.test.assertjCore

testImplementation testLibs.junit5Engine
testImplementation testLibs.log4j
testImplementation libs.test.junitJupiterApi
testImplementation libs.test.junitJupiterEngine
testImplementation libs.test.junitJupiterParams
testRuntimeOnly libs.test.junitPlatformLauncher

testImplementation libs.test.log4jCore
}

test {
Expand All @@ -42,4 +44,4 @@ jacocoTestReport {

tasks.named( "check" ) {
dependsOn jacocoReportTask
}
}
69 changes: 69 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
[versions]
# libs
byteBuddy = "1.17.7"
classmate = "1.7.0"
jackson = "2.20.0"
jandex = "3.5.0"
jbossLogging = "3.6.1.Final"
jbossLoggingTool = "3.0.4.Final"

# jdks
jdks-baseline = "17"

# jakartaLibs
jpa = "3.2.0"
inject = "2.0.1"
jaxbApi = "4.0.4"
jaxbRuntime = "4.0.5"
jsonbApi = "3.0.1"
jsonbRuntime = "3.0.4"

# testLibs
assertj = "3.27.4"
h2 = "2.3.232"
junit5 = "5.13.4"
junitPlatform5= "1.13.4"
log4j = "2.25.1"

# plugins
spotless="7.2.1"
develocity="4.1.1"
checkerframework="0.6.59"
taskTree="4.0.1"

[libraries]
# libs
byteBuddy = { group = "net.bytebuddy", name = "byte-buddy", version.ref = "byteBuddy" }
byteBuddyAgent = { group = "net.bytebuddy", name = "byte-buddy-agent", version.ref = "byteBuddy" }
classmate = { group = "com.fasterxml", name = "classmate", version.ref = "classmate" }
jacksonDatabind = { group = "com.fasterxml.jackson.core", name = "jackson-databind", version.ref = "jackson" }
jacksonDataformatXml = { group = "com.fasterxml.jackson.dataformat", name = "jackson-dataformat-xml", version.ref = "jackson" }
jacksonDatatypeJsr310 = { group = "com.fasterxml.jackson.datatype", name = "jackson-datatype-jsr310", version.ref = "jackson" }
jandex = { group = "io.smallrye", name = "jandex", version.ref = "jandex" }
loggingCore = { group = "org.jboss.logging", name = "jboss-logging", version.ref = "jbossLogging" }
loggingAnnotations = { group = "org.jboss.logging", name = "jboss-logging-annotations", version.ref = "jbossLoggingTool" }
loggingProcessor = { group = "org.jboss.logging", name = "jboss-logging-processor", version.ref = "jbossLoggingTool" }

# jakartaLibs
jakarta-jpa = { group = "jakarta.persistence", name = "jakarta.persistence-api", version.ref = "jpa" }
jakarta-inject = { group = "jakarta.inject", name = "jakarta.inject-api", version.ref = "inject" }
jakarta-jaxbApi = { group = "jakarta.xml.bind", name = "jakarta.xml.bind-api", version.ref = "jaxbApi" }
jakarta-jaxbRuntime = { group = "org.glassfish.jaxb", name = "jaxb-runtime", version.ref = "jaxbRuntime" }
jakarta-xjc = { group = "org.glassfish.jaxb", name = "jaxb-xjc", version.ref = "jaxbRuntime" }
jakarta-jsonbApi = { group = "jakarta.json.bind", name = "jakarta.json.bind-api", version.ref = "jsonbApi" }
jakarta-jsonb = { group = "org.eclipse", name = "yasson", version.ref = "jsonbRuntime" }

# testLibs
test-assertjCore = { group = "org.assertj", name = "assertj-core", version.ref = "assertj" }
test-h2 = { group = "com.h2database", name = "h2", version.ref = "h2" }
test-junitJupiterApi = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit5" }
test-junitJupiterEngine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit5" }
test-junitJupiterParams = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junit5" }
test-junitPlatformLauncher = { group = "org.junit.platform", name = "junit-platform-launcher", version.ref = "junitPlatform5" }
test-log4jCore = { group = "org.apache.logging.log4j", name = "log4j-core", version.ref = "log4j" }

[plugins]
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
develocity = { id = "com.gradle.develocity", version.ref = "develocity" }
checkerframework = { id = "org.checkerframework", version.ref = "checkerframework" }
taskTree = { id = "com.dorongold.task-tree", version.ref = "taskTree" }
4 changes: 2 additions & 2 deletions hibernate-models-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ description = "Test fixtures for modules performing tests"

dependencies {
implementation project( ":hibernate-models" )
implementation jakartaLibs.jpa
}
implementation libs.jakarta.jpa
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class ColumnAnnotation implements Column, ColumnDetails {
private String options;
private int length;
private int precision;
private int secondPrecision;
private int scale;

private CheckConstraint[] check;
Expand Down Expand Up @@ -180,6 +181,15 @@ public int scale() {
return scale;
}

@Override
public int secondPrecision() {
return secondPrecision;
}

public void secondPrecision(int secondPrecision) {
this.secondPrecision = secondPrecision;
}

public void scale(int scale) {
this.scale = scale;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,27 @@ public class NamedQueryAnnotation implements NamedQuery, Named {
private String name;
private String query;
private LockModeType lockModeType;
private Class<?> resultClass;
private QueryHint[] hints;

public NamedQueryAnnotation(ModelsContext modelContext) {
lockModeType = LockModeType.NONE;
hints = new QueryHint[0];
resultClass = void.class;
}

public NamedQueryAnnotation(NamedQuery usage, ModelsContext modelContext) {
name = usage.name();
query = usage.query();
hints = extractRepeatedValues( usage, NAMED_QUERY.getAttribute( "hints" ), modelContext );
resultClass = usage.resultClass();
}

public NamedQueryAnnotation(Map<String,Object> attributeValues, ModelsContext modelContext) {
name = (String) attributeValues.get( "name" );
query = attributeValues.get( "query" ).toString();
hints = (QueryHint[]) attributeValues.get( "hints" );
resultClass = (Class<?>) attributeValues.get( "resultClass" );
}

@Override
Expand All @@ -58,6 +62,11 @@ public String query() {
return query;
}

@Override
public Class<?> resultClass() {
return resultClass;
}

public void query(String query) {
this.query = query;
}
Expand Down
105 changes: 24 additions & 81 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pluginManagement {
plugins {
id "org.checkerframework" version "0.6.34" apply false
id "org.checkerframework" version "0.6.59" apply false
}
repositories {
gradlePluginPortal()
Expand All @@ -9,19 +9,21 @@ pluginManagement {
}

plugins {
id 'com.gradle.develocity' version '3.17.4'
id 'com.gradle.develocity' version '4.1.1'
}

rootProject.name = "hibernate-models-group"

dependencyResolutionManagement {
repositories {
mavenCentral()
maven {
// temporary - OSSRH snapshot repo for ORM 7.0 snapshot
url "https://oss.sonatype.org/content/repositories/snapshots/"
mavenContent {
snapshotsOnly()
if (rootProject.hasProperty("enableSnapshotRepositories")) {
maven {
// temporary - Maven Central snapshots repo for ORM snapshots
url "https://central.sonatype.com/repository/maven-snapshots/"
mavenContent {
snapshotsOnly()
}
}
}
// Needed for RC versions of Jakarta Persistence
Expand All @@ -32,86 +34,28 @@ dependencyResolutionManagement {
maven {
url "https://jakarta.oss.sonatype.org/content/groups/staging/"
}
// Needed for SNAPSHOT versions of Jakarta Persistence (wtf)
maven {
url "https://jakarta.oss.sonatype.org/content/repositories/snapshots/"
if (rootProject.hasProperty("enableSnapshotRepositories")) {
// Needed for SNAPSHOT versions of Jakarta Persistence (wtf)
maven {
url "https://jakarta.oss.sonatype.org/content/repositories/snapshots/"
}
}
}
}

versionCatalogs {
jdks {
version "baseline", "17"
}
libs {
def byteBuddyVersion = version "byteBuddy", "1.14.7"
library( "byteBuddy", "net.bytebuddy", "byte-buddy" ).versionRef( byteBuddyVersion )
library( "byteBuddyAgent", "net.bytebuddy", "byte-buddy-agent" ).versionRef( byteBuddyVersion )

def classmateVersion = version "classmate", "1.5.1"
library( "classmate", "com.fasterxml", "classmate" ).versionRef( classmateVersion )

def jacksonVersion = version "jackson", "2.14.1"
library( "jackson", "com.fasterxml.jackson.core", "jackson-databind" ).versionRef( jacksonVersion )
library( "jacksonXml", "com.fasterxml.jackson.dataformat", "jackson-dataformat-xml" ).versionRef( jacksonVersion )
library( "jacksonJsr310", "com.fasterxml.jackson.datatype", "jackson-datatype-jsr310" ).versionRef( jacksonVersion )

def jandexVersion = version "jandex", "3.3.0"
library( "jandex", "io.smallrye", "jandex" ).versionRef( jandexVersion )

def jbossLoggingVersion = version "jbossLogging", "3.5.0.Final"
library( "logging", "org.jboss.logging", "jboss-logging" ).versionRef( jbossLoggingVersion )

def jbossLoggingToolVersion = version "jbossLoggingTool", "2.2.1.Final"
library( "loggingAnnotations", "org.jboss.logging", "jboss-logging-annotations" ).versionRef( jbossLoggingToolVersion )
library( "loggingProcessor", "org.jboss.logging", "jboss-logging-processor" ).versionRef( jbossLoggingToolVersion )
}
jakartaLibs {
def jpaVersion = version "jpa", "3.2.0-B02"
library( "jpa", "jakarta.persistence", "jakarta.persistence-api" ).versionRef( jpaVersion )

def injectVersion = version "inject", "2.0.1"
def jaxbApiVersion = version "jaxbApi", "4.0.0"
def jaxbRuntimeVersion = version "jaxbRuntime", "4.0.2"
library( "inject", "jakarta.inject", "jakarta.inject-api" ).versionRef( injectVersion )
library( "jaxbApi", "jakarta.xml.bind", "jakarta.xml.bind-api" ).versionRef( jaxbApiVersion )
library( "jaxb", "org.glassfish.jaxb", "jaxb-runtime" ).versionRef( jaxbRuntimeVersion )
library( "xjc", "org.glassfish.jaxb", "jaxb-xjc" ).versionRef( jaxbRuntimeVersion )
develocity {
server = 'https://develocity.commonhaus.dev'

def jsonbApiVersion = version "jsonbApi", "3.0.0"
def jsonbRuntimeVersion = version "jsonbRuntime", "3.0.2"
library( "jsonbApi", "jakarta.json.bind", "jakarta.json.bind-api" ).versionRef( jsonbApiVersion )
library( "jsonb", "org.eclipse", "yasson" ).versionRef( jsonbRuntimeVersion )
buildScan {
capture {
fileFingerprints = true
}
testLibs {
def assertjVersion = version "assertj", "3.22.0"
library( "assertjCore", "org.assertj", "assertj-core" ).versionRef( assertjVersion )

def h2Version = version "h2", "2.2.224"
library( "h2", "com.h2database", "h2" ).versionRef( h2Version )

def junit5Version = version "junit5", "5.11.0"
library( "junit5Api", "org.junit.jupiter", "junit-jupiter-api" ).versionRef( junit5Version )
library( "junit5Engine", "org.junit.jupiter", "junit-jupiter-engine" ).versionRef( junit5Version )
library( "junit5Params", "org.junit.jupiter", "junit-jupiter-params" ).versionRef( junit5Version )
publishing.onlyIf { it.authenticated }

def log4jVersion = version "log4j", "2.17.1"
library( "log4j", "org.apache.logging.log4j", "log4j-core" ).versionRef( log4jVersion )
obfuscation {
// Don't share ip addresses
ipAddresses { addresses -> addresses.collect { address -> "0.0.0.0" } }
}
}

develocity {
server = 'https://develocity.commonhaus.dev'

buildScan {
capture {
fileFingerprints = true
}
publishing.onlyIf { it.authenticated }

obfuscation {
// Don't share ip addresses
ipAddresses { addresses -> addresses.collect { address -> "0.0.0.0" } }
}

// uploadInBackground = !settings.ext.isCiEnvironment
//
Expand All @@ -122,7 +66,6 @@ dependencyResolutionManagement {
// if ( settings.extensions.findByName( 'ci.node' ) ) {
// tag settings.extensions.findByName( 'ci.node' )
// }
}
}
}

Expand Down