166 lines
4.2 KiB
Groovy
166 lines
4.2 KiB
Groovy
plugins {
|
|
alias(catalog.plugins.lombok) apply false
|
|
alias(catalog.plugins.wildfly)
|
|
id 'java-library'
|
|
id 'war'
|
|
id 'maven-publish'
|
|
}
|
|
|
|
import net.woggioni.gradle.wildfly.Deploy2WildflyTask
|
|
|
|
allprojects {
|
|
|
|
pluginManager.withPlugin('java-library') {
|
|
apply plugin: 'net.woggioni.gradle.lombok'
|
|
|
|
lombok {
|
|
version = catalog.versions.lombok.get()
|
|
}
|
|
|
|
tasks.withType(JavaCompile) {
|
|
options.release = 21
|
|
}
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(21)
|
|
}
|
|
}
|
|
|
|
tasks.withType(Test) {
|
|
useJUnitPlatform()
|
|
}
|
|
}
|
|
|
|
group = 'net.woggioni'
|
|
version = getProperty('jpacrepo.version')
|
|
|
|
repositories {
|
|
maven {
|
|
url = getProperty('gitea.maven.url')
|
|
content {
|
|
includeGroup 'net.woggioni'
|
|
includeGroup 'com.lys'
|
|
}
|
|
}
|
|
mavenCentral()
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
deployableArchives {
|
|
attributes {
|
|
attribute(
|
|
LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE,
|
|
objects.named(LibraryElements.class, LibraryElements.JAR))
|
|
}
|
|
|
|
transitive = false
|
|
canBeConsumed = false
|
|
visible = false
|
|
canBeResolved = true
|
|
}
|
|
|
|
frontend {
|
|
transitive = false
|
|
canBeConsumed = false
|
|
visible = false
|
|
canBeResolved = true
|
|
}
|
|
}
|
|
|
|
java {
|
|
modularity.inferModulePath = true
|
|
}
|
|
|
|
dependencies {
|
|
implementation project(':jpacrepo-impl')
|
|
|
|
implementation catalog.jwo
|
|
implementation catalog.slf4j.api
|
|
|
|
providedCompile catalog.jakarta.persistence.api
|
|
providedCompile catalog.jakarta.enterprise.cdi.api
|
|
providedCompile catalog.jakarta.servlet.api
|
|
providedCompile catalog.jakarta.ejb.api
|
|
providedCompile catalog.jakarta.ws.rs.api
|
|
providedCompile catalog.jakarta.xml.bind.api
|
|
providedCompile catalog.jakarta.enterprise.concurrent.api
|
|
|
|
implementation catalog.commons.compress
|
|
implementation catalog.jna
|
|
implementation catalog.liquibase.cdi.jakarta
|
|
|
|
testImplementation catalog.jackson.module.jakarta.xmlbind.annotations
|
|
testImplementation catalog.jboss.ejb.client
|
|
testImplementation catalog.weld.se.core
|
|
// testImplementation catalog.h2
|
|
testImplementation catalog.hibernate.core
|
|
testImplementation catalog.resteasy.client
|
|
testImplementation catalog.resteasy.jackson2.provider
|
|
testImplementation catalog.jackson.datatype.jsr310
|
|
|
|
|
|
testRuntimeOnly catalog.slf4j.simple
|
|
|
|
testImplementation catalog.junit.jupiter.api
|
|
testImplementation catalog.junit.jupiter.params
|
|
|
|
testRuntimeOnly catalog.jakartaee.api
|
|
testRuntimeOnly catalog.junit.jupiter.engine
|
|
testRuntimeOnly group: 'org.glassfish.main.extras', name: 'glassfish-embedded-all', version: '7.0.6'
|
|
|
|
deployableArchives project
|
|
deployableArchives project(':jpacrepo-impl')
|
|
deployableArchives project(':jpacrepo-api')
|
|
|
|
frontend project(path: ':jpacrepo-frontend', configuration: 'tar')
|
|
}
|
|
|
|
Provider<War> warTaskProvider = tasks.named('war', War) { War it ->
|
|
from(configurations.frontend)
|
|
}
|
|
|
|
tasks.named('deploy2Wildfly', Deploy2WildflyTask) { d2w ->
|
|
d2w.rpcPort = 9990
|
|
// d2w.rpcUsername = 'woggioni'
|
|
// d2w.rpcUsername = 'admin'
|
|
// d2w.rpcPassword = '123456'
|
|
d2w.deploymentName = 'jpacrepo.war'
|
|
}
|
|
|
|
|
|
tasks.named("test", Test) {
|
|
jvmArgs = [
|
|
'--add-opens', 'java.naming/javax.naming.spi=ALL-UNNAMED',
|
|
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
|
|
'--add-opens', 'java.base/java.io=ALL-UNNAMED',
|
|
]
|
|
inputs.files(configurations.deployableArchives)
|
|
systemProperty('jpacrepo.jar.path', configurations.deployableArchives.asPath)
|
|
}
|
|
|
|
publishing {
|
|
|
|
repositories {
|
|
maven {
|
|
name = "Gitea"
|
|
url = uri(getProperty('gitea.maven.url'))
|
|
|
|
credentials(HttpHeaderCredentials) {
|
|
name = "Authorization"
|
|
value = "token ${System.getenv()["PUBLISHER_TOKEN"]}"
|
|
}
|
|
|
|
authentication {
|
|
header(HttpHeaderAuthentication)
|
|
}
|
|
}
|
|
}
|
|
publications {
|
|
maven(MavenPublication) {
|
|
from(components["web"])
|
|
}
|
|
}
|
|
}
|