/* * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ configurations { all*.exclude group: 'org.jboss.logging', module: 'jboss-logging-spi' } if ( project.hasProperty( 'overrideInfinispanVersionForTesting' ) ) { println 'Overrriding Infinispan version to test vs Infinispan version: ' + overrideInfinispanVersionForTesting configurations.testRuntime.resolutionStrategy.force 'org.infinispan:infinispan-core:' + overrideInfinispanVersionForTesting } apply plugin: 'java' dependencies { compile project( ':hibernate-core' ) compile( libraries.infinispan ) testCompile project( ':hibernate-testing' ) testCompile( libraries.infinispan_test ) testCompile( libraries.jboss_common_core ) testCompile( libraries.jnp_client ) testCompile( libraries.jnp_server ) testCompile( libraries.mockito ) testCompile ('mysql:mysql-connector-java:5.1.17') // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Java 9 ftw! if ( JavaVersion.current().isJava9Compatible() ) { // The JDK used to run Gradle is Java 9+, and we assume that that is the same // JDK for executing tasks compile( 'com.sun.xml.bind:jaxb-impl:2.2.11' ) compile( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' ) compile( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' ) compile( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' ) compile( 'javax:javaee-api:7.0' ) testCompile( 'com.sun.xml.bind:jaxb-impl:2.2.11' ) testCompile( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' ) testCompile( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' ) testCompile( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' ) testCompile( 'javax:javaee-api:7.0' ) testRuntime( 'com.sun.xml.bind:jaxb-impl:2.2.11' ) testRuntime( 'org.glassfish.jaxb:jaxb-xjc:2.2.11' ) testRuntime( 'org.jvnet.jaxb2_commons:jaxb2-basics:0.11.0' ) testRuntime( 'org.jvnet.jaxb2_commons:jaxb2-basics-ant:0.11.0' ) testRuntime( 'javax:javaee-api:7.0' ) } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } mavenPom { name = 'Hibernate/Infinispan Integration' description = 'Integration for Infinispan into Hibernate as a second-level caching service' } def osgiDescription() { return mavenPom.description } classes.doLast { javaexec { classpath = project.sourceSets.main.runtimeClasspath main = "org.infinispan.factories.components.ComponentMetadataPersister" args = [ project.sourceSets.main.output.classesDir, project.sourceSets.main.output.resourcesDir.toPath().resolve("hibernate-infinispan-component-metadata.dat").toString() ].toList() standardOutput = { def f = File.createTempFile('metadata-log', null ); f.deleteOnExit(); f.newOutputStream() }() } } test { systemProperties['java.net.preferIPv4Stack'] = true systemProperties['jgroups.ping.timeout'] = 500 systemProperties['jgroups.ping.num_initial_members'] = 1 systemProperties['jgroups.udp.enable_bundling'] = false systemProperties['jgroups.bind_addr'] = 'localhost' // Use Infinispan's test JGroups stack that uses TEST_PING systemProperties['hibernate.cache.infinispan.jgroups_cfg'] = '2lc-test-tcp.xml' if (project.hasProperty('log4jconfig')) { systemProperties['log4j.configuration'] = log4jconfig } enabled = project.hasProperty('testInfinispan') if (project.hasProperty('debugInfinispan')) { jvmArgs += '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005' enabled = true; } // Without this I have trouble running specific test using --tests switch doFirst { filter.includePatterns.each { include "${it.replaceAll('\\.', "\\${File.separator}")}.class" } filter.setIncludePatterns('*') } } task packageTests(type: Jar) { from sourceSets.test.output classifier = 'tests' } task sourcesTestJar(type: Jar, dependsOn:classes) { from sourceSets.test.allSource classifier = 'test-sources' } artifacts.archives packageTests artifacts.archives sourcesTestJar