Merge remote-tracking branch 'upstream/master' into wip/6.0
- up to the point of upgrading Gradle version for wrapper to 5.6.3
This commit is contained in:
commit
40d0c8580e
18
build.gradle
18
build.gradle
|
@ -11,21 +11,22 @@ buildscript {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.1'
|
classpath 'org.hibernate.build.gradle:hibernate-matrix-testing:3.0.0.Final'
|
||||||
classpath 'org.hibernate.build.gradle:hibernate-matrix-testing:2.0.0.Final'
|
|
||||||
classpath 'org.hibernate.build.gradle:version-injection-plugin:1.0.0'
|
classpath 'org.hibernate.build.gradle:version-injection-plugin:1.0.0'
|
||||||
classpath 'org.hibernate.build.gradle:gradle-xjc-plugin:1.0.2.Final'
|
classpath 'gradle.plugin.com.github.lburgazzoli:gradle-karaf-plugin:0.5.1'
|
||||||
classpath 'gradle.plugin.com.github.lburgazzoli:gradle-karaf-plugin:0.1.1'
|
|
||||||
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.7'
|
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.7'
|
||||||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
|
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
|
||||||
classpath 'de.thetaphi:forbiddenapis:2.5'
|
classpath 'de.thetaphi:forbiddenapis:2.5'
|
||||||
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.1'
|
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.1'
|
||||||
|
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.2.0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.gradle.build-scan' version '1.16'
|
id 'com.gradle.build-scan' version '2.4.2'
|
||||||
id 'me.champeau.buildscan-recipes' version '0.2.3'
|
id 'me.champeau.buildscan-recipes' version '0.2.3'
|
||||||
|
id 'org.hibernate.build.xjc' version '2.0.1' apply false
|
||||||
|
id 'org.hibernate.build.maven-repo-auth' version '3.0.2' apply false
|
||||||
id 'org.jetbrains.gradle.plugin.idea-ext' version '0.5'
|
id 'org.jetbrains.gradle.plugin.idea-ext' version '0.5'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,14 +95,15 @@ task ciBuild {
|
||||||
|
|
||||||
|
|
||||||
wrapper {
|
wrapper {
|
||||||
gradleVersion = '4.10.3'
|
// To upgrade the version of gradle used in the wrapper, run:
|
||||||
|
// ./gradlew wrapper --gradle-version NEW_VERSION
|
||||||
distributionType = Wrapper.DistributionType.ALL
|
distributionType = Wrapper.DistributionType.ALL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
buildScan {
|
buildScan {
|
||||||
licenseAgreementUrl = 'https://gradle.com/terms-of-service'
|
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
|
||||||
licenseAgree = 'yes'
|
termsOfServiceAgree = 'yes'
|
||||||
}
|
}
|
||||||
|
|
||||||
buildScanRecipes {
|
buildScanRecipes {
|
||||||
|
|
|
@ -18,5 +18,5 @@ dependencies {
|
||||||
compile localGroovy()
|
compile localGroovy()
|
||||||
|
|
||||||
compile 'org.hibernate.build.gradle:gradle-animalSniffer-plugin:1.0.1.Final'
|
compile 'org.hibernate.build.gradle:gradle-animalSniffer-plugin:1.0.1.Final'
|
||||||
compile 'org.hibernate.build.gradle:hibernate-matrix-testing:2.0.0.Final'
|
compile 'org.hibernate.build.gradle:hibernate-matrix-testing:3.0.0.Final'
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
org.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
|
@ -28,7 +28,7 @@ apply from: rootProject.file( 'gradle/libraries.gradle' )
|
||||||
apply from: rootProject.file( 'gradle/databases.gradle' )
|
apply from: rootProject.file( 'gradle/databases.gradle' )
|
||||||
|
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'osgi'
|
apply plugin: 'biz.aQute.bnd.builder'
|
||||||
|
|
||||||
apply plugin: 'checkstyle'
|
apply plugin: 'checkstyle'
|
||||||
apply plugin: 'build-dashboard'
|
apply plugin: 'build-dashboard'
|
||||||
|
|
|
@ -30,64 +30,87 @@ dependencies {
|
||||||
// Jar
|
// Jar
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest = osgiManifest {
|
manifest {
|
||||||
// GRADLE-1411: Even if we override Imports and Exports
|
attributes(
|
||||||
// auto-generation with instructions, classesDir and classpath
|
// Basic JAR manifest attributes
|
||||||
// need to be here (temporarily).
|
'Specification-Title': project.name,
|
||||||
|
'Specification-Version': project.version,
|
||||||
if ( project.pluginManager.hasPlugin( 'groovy' ) ) {
|
'Specification-Vendor': 'Hibernate.org',
|
||||||
classesDir = sourceSets.main.groovy.outputDir
|
'Implementation-Title': project.name,
|
||||||
}
|
'Implementation-Version': project.version,
|
||||||
else {
|
'Implementation-Vendor': 'Hibernate.org',
|
||||||
classesDir = sourceSets.main.output.classesDir
|
'Implementation-Vendor-Id': 'org.hibernate',
|
||||||
}
|
'Implementation-Url': 'http://hibernate.org/orm',
|
||||||
classpath = configurations.runtime
|
|
||||||
|
|
||||||
|
|
||||||
// Java 9 module name
|
// Java 9 module name
|
||||||
instruction 'Automatic-Module-Name', project.java9ModuleName
|
'Automatic-Module-Name': project.java9ModuleName,
|
||||||
|
|
||||||
// the OSGi metadata
|
// Hibernate-specific JAR manifest attributes
|
||||||
symbolicName project.java9ModuleName
|
'Hibernate-VersionFamily': project.ormVersion.family,
|
||||||
vendor 'Hibernate.org'
|
'Hibernate-JpaVersion': project.jpaVersion.name,
|
||||||
description project.description
|
|
||||||
docURL "http://www.hibernate.org/orm/${project.ormVersion.family}"
|
|
||||||
|
|
||||||
instruction 'Import-Package',
|
// BND Plugin instructions (for OSGi):
|
||||||
|
'Bundle-Name': project.name,
|
||||||
|
'Bundle-SymbolicName': project.java9ModuleName,
|
||||||
|
'Bundle-Vendor': 'Hibernate.org',
|
||||||
|
'Bundle-DocURL': "http://www.hibernate.org/orm/${project.ormVersion.family}",
|
||||||
|
// This is overridden in some sub-projects
|
||||||
|
'Import-Package': [
|
||||||
// Temporarily support JTA 1.1 -- Karaf and other frameworks still
|
// Temporarily support JTA 1.1 -- Karaf and other frameworks still
|
||||||
// use it. Without this, the plugin generates [1.2,2).
|
// use it. Without this, the plugin generates [1.2,2).
|
||||||
'javax.transaction;version="[1.1,2)"',
|
'javax.transaction;version="[1.1,2)"',
|
||||||
// Tell Gradle OSGi to still dynamically import the other packages.
|
// Also import every package referenced in the code
|
||||||
// IMPORTANT: Do not include the * in the modules' .gradle files.
|
// (note that '*' is resolved at build time to a list of packages)
|
||||||
// If it exists more than once, the manifest will physically contain a *.
|
|
||||||
'*'
|
'*'
|
||||||
|
].join( ',' ),
|
||||||
// Basic JAR manifest metadata
|
'-exportcontents': "*;version=${project.version}"
|
||||||
instruction 'Specification-Title', project.name
|
)
|
||||||
instruction 'Specification-Version', project.version
|
|
||||||
instruction 'Specification-Vendor', 'Hibernate.org'
|
|
||||||
instruction 'Implementation-Title', project.name
|
|
||||||
instruction 'Implementation-Version', project.version
|
|
||||||
instruction 'Implementation-Vendor', 'Hibernate.org'
|
|
||||||
instruction 'Implementation-Vendor-Id', 'org.hibernate'
|
|
||||||
instruction 'Implementation-Url', 'http://hibernate.org/orm'
|
|
||||||
|
|
||||||
instruction 'Hibernate-VersionFamily', project.ormVersion.family
|
|
||||||
instruction 'Hibernate-JpaVersion', project.jpaVersion.name
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
task sourcesJar(type: Jar) {
|
task sourcesJar(type: Jar) {
|
||||||
from project.sourceSets.main.allSource
|
from project.sourceSets.main.allSource
|
||||||
manifest = project.tasks.jar.manifest
|
manifest {
|
||||||
classifier = 'sources'
|
attributes(
|
||||||
|
// Basic JAR manifest attributes
|
||||||
|
'Specification-Title': project.name,
|
||||||
|
'Specification-Version': project.version,
|
||||||
|
'Specification-Vendor': 'Hibernate.org',
|
||||||
|
'Implementation-Title': project.name,
|
||||||
|
'Implementation-Version': project.version,
|
||||||
|
'Implementation-Vendor': 'Hibernate.org',
|
||||||
|
'Implementation-Vendor-Id': 'org.hibernate',
|
||||||
|
'Implementation-Url': 'http://hibernate.org/orm',
|
||||||
|
|
||||||
|
// Hibernate-specific JAR manifest attributes
|
||||||
|
'Hibernate-VersionFamily': project.ormVersion.family,
|
||||||
|
'Hibernate-JpaVersion': project.jpaVersion.name
|
||||||
|
)
|
||||||
|
}
|
||||||
|
archiveClassifier.set( 'sources' )
|
||||||
}
|
}
|
||||||
|
|
||||||
task javadocJar(type: Jar) {
|
task javadocJar(type: Jar) {
|
||||||
from project.tasks.javadoc.outputs
|
from project.tasks.javadoc.outputs
|
||||||
manifest = project.tasks.jar.manifest
|
manifest {
|
||||||
classifier = 'javadoc'
|
attributes(
|
||||||
|
// Basic JAR manifest attributes
|
||||||
|
'Specification-Title': project.name,
|
||||||
|
'Specification-Version': project.version,
|
||||||
|
'Specification-Vendor': 'Hibernate.org',
|
||||||
|
'Implementation-Title': project.name,
|
||||||
|
'Implementation-Version': project.version,
|
||||||
|
'Implementation-Vendor': 'Hibernate.org',
|
||||||
|
'Implementation-Vendor-Id': 'org.hibernate',
|
||||||
|
'Implementation-Url': 'http://hibernate.org/orm',
|
||||||
|
|
||||||
|
// Hibernate-specific JAR manifest attributes
|
||||||
|
'Hibernate-VersionFamily': project.ormVersion.family,
|
||||||
|
'Hibernate-JpaVersion': project.jpaVersion.name
|
||||||
|
)
|
||||||
|
}
|
||||||
|
archiveClassifier.set( 'javadoc' )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -150,7 +173,7 @@ javadoc {
|
||||||
|
|
||||||
doFirst {
|
doFirst {
|
||||||
// ordering problems if we try to do this during config phase :(
|
// ordering problems if we try to do this during config phase :(
|
||||||
classpath += project.sourceSets.main.output + project.sourceSets.main.compileClasspath + project.configurations.provided
|
classpath += project.sourceSets.main.output.classesDirs + project.sourceSets.main.compileClasspath + project.configurations.provided
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ apply from: rootProject.file( 'gradle/base-information.gradle' )
|
||||||
|
|
||||||
|
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
apply plugin: 'maven-publish-auth'
|
apply plugin: 'org.hibernate.build.maven-repo-auth'
|
||||||
apply plugin: 'com.jfrog.bintray'
|
apply plugin: 'com.jfrog.bintray'
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.3-all.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.hibernate.build.xjc' version '2.0.0-SNAPSHOT'
|
id 'org.hibernate.build.xjc'
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -144,17 +144,24 @@ dependencies {
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
mainAttributes( 'Main-Class': 'org.hibernate.Version' )
|
attributes(
|
||||||
|
'Main-Class': 'org.hibernate.Version',
|
||||||
|
|
||||||
instructionFirst 'Import-Package',
|
// BND Plugin instructions (for OSGi):
|
||||||
|
'Import-Package': [
|
||||||
'javax.security.auth;resolution:=optional',
|
'javax.security.auth;resolution:=optional',
|
||||||
'javax.security.jacc;resolution:=optional',
|
// Make javax.security.jacc optional and do not reference a version range (because that's what we used to do)
|
||||||
'javax.validation;resolution:=optional',
|
'javax.security.jacc;resolution:=optional;version=!',
|
||||||
'javax.validation.constraints;resolution:=optional',
|
// Make javax.validation optional and do not reference a version range (because that's what we used to do)
|
||||||
'javax.validation.groups;resolution:=optional',
|
'javax.validation;resolution:=optional;version=!',
|
||||||
'javax.validation.metadata;resolution:=optional',
|
'javax.validation.constraints;resolution:=optional;version=!',
|
||||||
// TODO: Shouldn't have to explicitly list this, but the plugin
|
'javax.validation.groups;resolution:=optional;version=!',
|
||||||
// generates it with a [1.0,2) version.
|
'javax.validation.metadata;resolution:=optional;version=!',
|
||||||
|
// Make javax.enterprise optional and do not reference a version range (because that's what we used to do)
|
||||||
|
'!javax.enterprise*',
|
||||||
|
'javax.enterprise.context.spi;resolution:=optional;version=!',
|
||||||
|
'javax.enterprise.inject.spi;resolution:=optional;version=!',
|
||||||
|
// For JPA, we don't want to target the automatically generated range, but a specific version
|
||||||
"javax.persistence;version=\"${project.jpaVersion.osgiName}\"",
|
"javax.persistence;version=\"${project.jpaVersion.osgiName}\"",
|
||||||
// optionals
|
// optionals
|
||||||
'javax.management;resolution:=optional',
|
'javax.management;resolution:=optional',
|
||||||
|
@ -163,20 +170,28 @@ jar {
|
||||||
'org.apache.tools.ant;resolution:=optional',
|
'org.apache.tools.ant;resolution:=optional',
|
||||||
'org.apache.tools.ant.taskdefs;resolution:=optional',
|
'org.apache.tools.ant.taskdefs;resolution:=optional',
|
||||||
'org.apache.tools.ant.types;resolution:=optional',
|
'org.apache.tools.ant.types;resolution:=optional',
|
||||||
'!javax.enterprise*',
|
|
||||||
'javax.enterprise.context.spi;resolution:=optional',
|
|
||||||
'javax.enterprise.inject.spi;resolution:=optional',
|
|
||||||
'javax.inject;resolution:=optional',
|
'javax.inject;resolution:=optional',
|
||||||
'net.bytebuddy.*;resolution:=optional',
|
'net.bytebuddy.*;resolution:=optional',
|
||||||
|
'org.objectweb.jonas_tm;resolution:=optional',
|
||||||
|
'com.ibm.websphere.jtaextensions;resolution:=optional',
|
||||||
// We must specify the version explicitly to allow Karaf
|
// We must specify the version explicitly to allow Karaf
|
||||||
// to use an older version of JAXB (the only one we can use in Karaf)
|
// to use an older version of JAXB (the only one we can use in Karaf)
|
||||||
"javax.xml.bind.*;version=\"${project.jaxbApiVersionOsgiRange}\""
|
"javax.xml.bind.*;version=\"${project.jaxbApiVersionOsgiRange}\"",
|
||||||
|
// Temporarily support JTA 1.1 -- Karaf and other frameworks still
|
||||||
// // TODO: Uncomment once EntityManagerFactoryBuilderImpl no longer
|
// use it. Without this, the plugin generates [1.2,2).
|
||||||
// // uses ClassLoaderServiceImpl.
|
'javax.transaction;version="[1.1,2)"',
|
||||||
// instruction 'Export-Package',
|
// Also import every package referenced in the code
|
||||||
|
'*'
|
||||||
|
].join( ',' ),
|
||||||
|
'-exportcontents': [
|
||||||
|
// Legacy resource packages containing XSDs that were traditionally not exported
|
||||||
|
"!org.hibernate.xsd.cfg",
|
||||||
|
"!org.hibernate.xsd.mapping",
|
||||||
|
// TODO: Uncomment once EntityManagerFactoryBuilderImpl no longer uses ClassLoaderServiceImpl.
|
||||||
//'org.hibernate.boot.registry.classloading.internal',
|
//'org.hibernate.boot.registry.classloading.internal',
|
||||||
// '*'
|
"*;version=${project.version}"
|
||||||
|
].join( ',' ),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,7 +256,7 @@ task copyBundleResources (type: Copy) {
|
||||||
processTestResources.dependsOn copyBundleResources
|
processTestResources.dependsOn copyBundleResources
|
||||||
|
|
||||||
task testJar(type: Jar, dependsOn: testClasses) {
|
task testJar(type: Jar, dependsOn: testClasses) {
|
||||||
classifier = 'test'
|
archiveClassifier.set( 'test' )
|
||||||
from sourceSets.test.output
|
from sourceSets.test.output
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
package org.hibernate.query.criteria;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.EntityManager;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.criteria.CriteriaBuilder;
|
||||||
|
import javax.persistence.criteria.CriteriaQuery;
|
||||||
|
import javax.persistence.criteria.Expression;
|
||||||
|
import javax.persistence.criteria.Root;
|
||||||
|
|
||||||
|
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
|
||||||
|
|
||||||
|
import org.hibernate.testing.TestForIssue;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Michiel Haisma
|
||||||
|
* @author Nathan Xu
|
||||||
|
*/
|
||||||
|
@TestForIssue( jiraKey = "HHH-13889" )
|
||||||
|
public class CriteriaStringInlineLiteralTest extends BaseEntityManagerFunctionalTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Class<?>[] getAnnotatedClasses() {
|
||||||
|
return new Class<?>[] { Animal.class };
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCriteriaInlineStringLiteralRendering() {
|
||||||
|
EntityManager entityManager = getOrCreateEntityManager();
|
||||||
|
CriteriaBuilder cb = entityManager.getCriteriaBuilder();
|
||||||
|
CriteriaQuery<Animal> criteriaQuery = cb.createQuery( Animal.class );
|
||||||
|
|
||||||
|
Root<Animal> animalRoot = criteriaQuery.from( Animal.class );
|
||||||
|
CriteriaBuilder.Case<String> sCase = cb.selectCase();
|
||||||
|
Expression<String> caseSelect =
|
||||||
|
sCase.when( cb.equal( animalRoot.get( "name" ), cb.literal( "kitty" ) ), cb.literal( "Cat" ) )
|
||||||
|
.otherwise("escapez'moi" );
|
||||||
|
criteriaQuery.multiselect( caseSelect );
|
||||||
|
criteriaQuery.where( cb.equal( animalRoot.get( "name" ), "myFavoriteAnimal" ) );
|
||||||
|
entityManager.createQuery( criteriaQuery); // would throw exception for unescaped otherwise literal in HHH-13889
|
||||||
|
}
|
||||||
|
|
||||||
|
@Entity(name = "Animal")
|
||||||
|
public static class Animal {
|
||||||
|
@Id
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
public Animal() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Animal(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,19 +12,21 @@ dependencies {
|
||||||
compile( libraries.jta )
|
compile( libraries.jta )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
// The OSGi JAR manifest support does not like a non-existent classes dir,
|
// Traditionally we used to not include any manifest attributes in this JAR
|
||||||
// so make sure we dont use the OSGi one :)
|
// except "Manifest-Version"
|
||||||
|
// Since it's a legacy JAR, let's continue that way until it's retired.
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest = null
|
manifest.attributes.removeAll { key, value -> key != "Manifest-Version" }
|
||||||
|
// Prevent BND from adding manifest attributes automatically
|
||||||
|
bnd( '-nobundles': 'true' )
|
||||||
}
|
}
|
||||||
|
|
||||||
sourcesJar {
|
sourcesJar {
|
||||||
manifest = null
|
manifest.attributes.removeAll { key, value -> key != "Manifest-Version" }
|
||||||
}
|
}
|
||||||
|
|
||||||
javadocJar {
|
javadocJar {
|
||||||
manifest = null
|
manifest.attributes.removeAll { key, value -> key != "Manifest-Version" }
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,9 @@ sourceSets {
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
instructionFirst 'Import-Package',
|
attributes(
|
||||||
|
// BND Plugin instructions (for OSGi):
|
||||||
|
'Import-Package': [
|
||||||
// TODO: Shouldn't have to explicitly list the JPA packages, but
|
// TODO: Shouldn't have to explicitly list the JPA packages, but
|
||||||
// the plugin generates them with [1.0,2) versions.
|
// the plugin generates them with [1.0,2) versions.
|
||||||
"javax.persistence;version=\"${project.jpaVersion.osgiName}\"",
|
"javax.persistence;version=\"${project.jpaVersion.osgiName}\"",
|
||||||
|
@ -49,7 +51,14 @@ jar {
|
||||||
"javax.persistence.spi;version=\"${project.jpaVersion.osgiName}\"",
|
"javax.persistence.spi;version=\"${project.jpaVersion.osgiName}\"",
|
||||||
// optionals
|
// optionals
|
||||||
'javax.naming;resolution:=optional',
|
'javax.naming;resolution:=optional',
|
||||||
'org.apache.tools.ant;resolution:=optional'
|
'org.apache.tools.ant;resolution:=optional',
|
||||||
|
// Temporarily support JTA 1.1 -- Karaf and other frameworks still
|
||||||
|
// use it. Without this, the plugin generates [1.2,2).
|
||||||
|
'javax.transaction;version="[1.1,2)"',
|
||||||
|
// Also import every package referenced in the code
|
||||||
|
'*'
|
||||||
|
].join( ',' )
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ apply from: rootProject.file( 'gradle/base-information.gradle' )
|
||||||
apply from: rootProject.file( 'gradle/publishing-repos.gradle' )
|
apply from: rootProject.file( 'gradle/publishing-repos.gradle' )
|
||||||
apply from: rootProject.file( 'gradle/publishing-pom.gradle' )
|
apply from: rootProject.file( 'gradle/publishing-pom.gradle' )
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
apply plugin: 'maven-publish-auth'
|
apply plugin: 'org.hibernate.build.maven-repo-auth'
|
||||||
|
|
||||||
description = '(deprecated - use org.infinispan:infinispan-hibernate-cache-v53 instead)'
|
description = '(deprecated - use org.infinispan:infinispan-hibernate-cache-v53 instead)'
|
||||||
|
|
||||||
|
|
|
@ -6,18 +6,22 @@ description = '(deprecated - use hibernate-core instead) Support for Java8-speci
|
||||||
dependencies {
|
dependencies {
|
||||||
compile( project( ':hibernate-core' ) )
|
compile( project( ':hibernate-core' ) )
|
||||||
}
|
}
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
// The OSGi JAR manifest support does not like a non-existent classes dir,
|
// Traditionally we used to not include any manifest attributes in this JAR
|
||||||
// so make sure we dont use the OSGi one :)
|
// except "Manifest-Version"
|
||||||
|
// Since it's a legacy JAR, let's continue that way until it's retired.
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest = null
|
manifest.attributes.removeAll { key, value -> key != "Manifest-Version" }
|
||||||
|
// Prevent BND from adding manifest attributes automatically
|
||||||
|
bnd( '-nobundles': 'true' )
|
||||||
}
|
}
|
||||||
|
|
||||||
sourcesJar {
|
sourcesJar {
|
||||||
manifest = null
|
manifest.attributes.removeAll { key, value -> key != "Manifest-Version" }
|
||||||
}
|
}
|
||||||
|
|
||||||
javadocJar {
|
javadocJar {
|
||||||
manifest = null
|
manifest.attributes.removeAll { key, value -> key != "Manifest-Version" }
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ apply plugin: 'java'
|
||||||
apply from: rootProject.file( 'gradle/libraries.gradle' )
|
apply from: rootProject.file( 'gradle/libraries.gradle' )
|
||||||
|
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
apply plugin: 'maven-publish-auth'
|
apply plugin: 'org.hibernate.build.maven-repo-auth'
|
||||||
apply from: rootProject.file( 'gradle/publishing-repos.gradle' )
|
apply from: rootProject.file( 'gradle/publishing-repos.gradle' )
|
||||||
apply from: rootProject.file( 'gradle/publishing-pom.gradle' )
|
apply from: rootProject.file( 'gradle/publishing-pom.gradle' )
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,8 @@ sourceSets {
|
||||||
test {
|
test {
|
||||||
// send javac output and resource copying to the same output directory for test
|
// send javac output and resource copying to the same output directory for test
|
||||||
// so Pax Exam can more easily find it without explicit TinyBundle hooks
|
// so Pax Exam can more easily find it without explicit TinyBundle hooks
|
||||||
output.classesDir = "${buildDir}/classes/test"
|
java.outputDir = file( "${buildDir}/classes/test" )
|
||||||
output.resourcesDir = output.classesDir
|
output.resourcesDir = java.outputDir
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,13 +98,22 @@ dependencies {
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
instruction 'Bundle-Activator', 'org.hibernate.osgi.HibernateBundleActivator'
|
attributes(
|
||||||
instruction 'Provide-Capability', 'osgi.service;effective:=active;objectClass=javax.persistence.spi.PersistenceProvider'
|
// BND Plugin instructions (for OSGi):
|
||||||
instructionFirst 'Import-Package',
|
'Bundle-Activator': 'org.hibernate.osgi.HibernateBundleActivator',
|
||||||
|
'Provide-Capability': 'osgi.service;effective:=active;objectClass=javax.persistence.spi.PersistenceProvider',
|
||||||
|
'Import-Package': [
|
||||||
// TODO: Shouldn't have to explicitly list this, but the plugin
|
// TODO: Shouldn't have to explicitly list this, but the plugin
|
||||||
// generates it with a [1.0,2) version.
|
// generates it with a [1.0,2) version.
|
||||||
"javax.persistence;version=\"${project.jpaVersion.osgiName}\"",
|
"javax.persistence;version=\"${project.jpaVersion.osgiName}\"",
|
||||||
"javax.persistence.spi;version=\"${project.jpaVersion.osgiName}\""
|
"javax.persistence.spi;version=\"${project.jpaVersion.osgiName}\"",
|
||||||
|
// Temporarily support JTA 1.1 -- Karaf and other frameworks still
|
||||||
|
// use it. Without this, the plugin generates [1.2,2).
|
||||||
|
'javax.transaction;version="[1.1,2)"',
|
||||||
|
// Also import every package referenced in the code
|
||||||
|
'*'
|
||||||
|
].join( ',' )
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,7 +227,7 @@ task generatePaxExamEnvironmentFile {
|
||||||
properties.setProperty( 'org.ops4j.pax.exam.container.karaf.distroUrl', karafDistroFile.toURI().toURL().toExternalForm() )
|
properties.setProperty( 'org.ops4j.pax.exam.container.karaf.distroUrl', karafDistroFile.toURI().toURL().toExternalForm() )
|
||||||
properties.setProperty( 'org.ops4j.pax.exam.container.karaf.unpackDir', karafUnpackDirectory.absolutePath )
|
properties.setProperty( 'org.ops4j.pax.exam.container.karaf.unpackDir', karafUnpackDirectory.absolutePath )
|
||||||
properties.setProperty( 'org.ops4j.pax.exam.container.karaf.version', karafVersion as String )
|
properties.setProperty( 'org.ops4j.pax.exam.container.karaf.version', karafVersion as String )
|
||||||
properties.setProperty( 'org.ops4j.pax.exam.container.karaf.probe.classesDir', sourceSets.test.output.classesDir.absolutePath )
|
properties.setProperty( 'org.ops4j.pax.exam.container.karaf.probe.classesDir', sourceSets.test.java.outputDir.absolutePath )
|
||||||
properties.setProperty( 'org.ops4j.pax.exam.container.karaf.probe.resourcesDir', sourceSets.test.output.resourcesDir.absolutePath )
|
properties.setProperty( 'org.ops4j.pax.exam.container.karaf.probe.resourcesDir', sourceSets.test.output.resourcesDir.absolutePath )
|
||||||
properties.setProperty( 'org.hibernate.osgi.test.karafFeatureFile', karaf.features.outputFile.absolutePath )
|
properties.setProperty( 'org.hibernate.osgi.test.karafFeatureFile', karaf.features.outputFile.absolutePath )
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,6 @@
|
||||||
|
|
||||||
<module name="TreeWalker">
|
<module name="TreeWalker">
|
||||||
|
|
||||||
<module name="FileContentsHolder"/>
|
|
||||||
|
|
||||||
|
|
||||||
<module name="AvoidStarImport">
|
<module name="AvoidStarImport">
|
||||||
<property name="severity" value="warning" />
|
<property name="severity" value="warning" />
|
||||||
</module>
|
</module>
|
||||||
|
@ -150,25 +147,6 @@
|
||||||
<property name="severity" value="warning" />
|
<property name="severity" value="warning" />
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
</module>
|
|
||||||
|
|
||||||
<module name="JavadocPackage">
|
|
||||||
<property name="allowLegacy" value="true" />
|
|
||||||
<property name="severity" value="warning" />
|
|
||||||
</module>
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Used to collect "todo" comments into a single location
|
|
||||||
-->
|
|
||||||
<module name="TreeWalker">
|
|
||||||
<module name="TodoComment">
|
|
||||||
<property name="format" value="[Tt][Oo][Dd][Oo]"/>
|
|
||||||
<property name="severity" value="info" />
|
|
||||||
</module>
|
|
||||||
</module>
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Source code comment-based suppressions
|
Source code comment-based suppressions
|
||||||
-->
|
-->
|
||||||
|
@ -188,3 +166,21 @@
|
||||||
<property name="influenceFormat" value="1"/>
|
<property name="influenceFormat" value="1"/>
|
||||||
</module>
|
</module>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
|
<module name="JavadocPackage">
|
||||||
|
<property name="allowLegacy" value="true" />
|
||||||
|
<property name="severity" value="warning" />
|
||||||
|
</module>
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Used to collect "todo" comments into a single location
|
||||||
|
-->
|
||||||
|
<module name="TreeWalker">
|
||||||
|
<module name="TodoComment">
|
||||||
|
<property name="format" value="[Tt][Oo][Dd][Oo]"/>
|
||||||
|
<property name="severity" value="info" />
|
||||||
|
</module>
|
||||||
|
</module>
|
||||||
|
|
||||||
|
</module>
|
||||||
|
|
|
@ -22,8 +22,6 @@
|
||||||
|
|
||||||
<module name="TreeWalker">
|
<module name="TreeWalker">
|
||||||
|
|
||||||
<module name="FileContentsHolder"/>
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
High-priority warnings : fail the build...
|
High-priority warnings : fail the build...
|
||||||
-->
|
-->
|
||||||
|
@ -63,23 +61,6 @@
|
||||||
<property name="illegalPkgs" value="java.awt, sun, org.slf4j"/>
|
<property name="illegalPkgs" value="java.awt, sun, org.slf4j"/>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
</module>
|
|
||||||
|
|
||||||
<!-- We are not using NewLineAtEndOfFile because the new line chars change
|
|
||||||
on different operating systems and that rule allows only one type. This rule
|
|
||||||
is not actually checking for new lines, but it will work if we check that
|
|
||||||
there are not white spaces at the end of a line with another rule. -->
|
|
||||||
<module name="RegexpMultiline">
|
|
||||||
<property name="format" value="\S\z" />
|
|
||||||
<property name="message" value="Missing new line at the end of file" />
|
|
||||||
</module>
|
|
||||||
|
|
||||||
<module name="RegexpMultiline">
|
|
||||||
<property name="format" value="\S(r?\n){5,}\z" />
|
|
||||||
<property name="message" value="Files should end with no more than 5 (empty) new lines" />
|
|
||||||
</module>
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Source code comment-based suppressions
|
Source code comment-based suppressions
|
||||||
-->
|
-->
|
||||||
|
@ -99,3 +80,19 @@
|
||||||
<property name="influenceFormat" value="1"/>
|
<property name="influenceFormat" value="1"/>
|
||||||
</module>
|
</module>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
|
<!-- We are not using NewLineAtEndOfFile because the new line chars change
|
||||||
|
on different operating systems and that rule allows only one type. This rule
|
||||||
|
is not actually checking for new lines, but it will work if we check that
|
||||||
|
there are not white spaces at the end of a line with another rule. -->
|
||||||
|
<module name="RegexpMultiline">
|
||||||
|
<property name="format" value="\S\z" />
|
||||||
|
<property name="message" value="Missing new line at the end of file" />
|
||||||
|
</module>
|
||||||
|
|
||||||
|
<module name="RegexpMultiline">
|
||||||
|
<property name="format" value="\S(r?\n){5,}\z" />
|
||||||
|
<property name="message" value="Files should end with no more than 5 (empty) new lines" />
|
||||||
|
</module>
|
||||||
|
|
||||||
|
</module>
|
||||||
|
|
|
@ -82,6 +82,8 @@ class HibernatePluginTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
compileTestTask.execute()
|
// TODO find how to do this in Gradle 5
|
||||||
|
// the class-level javadoc says it's not possible, and it was there in Gradle 4.x...
|
||||||
|
//compileTestTask.execute()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue