plugins { id 'maven-publish' alias(catalog.plugins.multi.release.jar) alias(catalog.plugins.lombok) apply false } allprojects { apply plugin: 'java-library' apply plugin: catalog.plugins.lombok.get().pluginId group = "net.woggioni" version = getProperty('jwo.version') repositories { maven { url = 'https://woggioni.net/mvn/' } mavenCentral() } dependencies { testImplementation catalog.junit.jupiter.api testImplementation catalog.junit.jupiter.params testRuntimeOnly catalog.junit.jupiter.engine } lombok { version = catalog.versions.lombok.get() } } ext { setProperty('jpms.module.name', 'net.woggioni.jwo') } configurations { pathClassloaderTest } dependencies { implementation catalog.slf4j.api pathClassloaderTest group: 'com.google.inject', name: 'guice', version: getProperty('guice.version') } java { withJavadocJar() withSourcesJar() } compileJava { options.release = 8 options.compilerArgs << '-parameters' } TaskProvider pathClassLoaderTestBundleTask = tasks.register("pathClassLoaderTestBundle", Zip) { from(configurations.pathClassloaderTest) archiveBaseName = "pathClassLoaderTestBundle" } test { inputs.files(pathClassLoaderTestBundleTask) useJUnitPlatform() File junitJupiterEngineJar = configurations.getByName(JavaPlugin.TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME) .resolvedConfiguration.resolvedArtifacts.grep { ResolvedArtifact resolvedArtifact -> ModuleVersionIdentifier id = resolvedArtifact.moduleVersion.id id.group == 'org.junit.jupiter' && id.name == 'junit-jupiter-engine' }.collect { ResolvedArtifact resolvedArtifact -> resolvedArtifact.file }.first() systemProperties([ 'junit.jupiter.engine.jar' : junitJupiterEngineJar.toString(), 'path.classloader.test.bundle' : pathClassLoaderTestBundleTask.get().outputs.files.singleFile ]) } publishing { repositories { maven { url = 'https://mvn.woggioni.net/' } } publications { maven(MavenPublication) { from(components["java"]) } } }