177 lines
5.1 KiB
Groovy
177 lines
5.1 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
id 'maven-publish'
|
|
id 'eclipse-wtp'
|
|
id 'idea'
|
|
id 'com.diffplug.eclipse.apt' version '3.41.1'
|
|
id 'net.researchgate.release' version '3.0.2'
|
|
}
|
|
|
|
def springVersion = "5.3.27"
|
|
//def quartzVersion = "2.2.1"
|
|
def queryDslVersion = "5.0.0"
|
|
def hibernateVersion = "5.6.15.Final"
|
|
|
|
def nexusUrl = "https://nexus.eactive.synology.me:8090"
|
|
def generatedJavaDir = "$buildDir/generated/java"
|
|
def generatedTestJavaDir = "$buildDir/generated-test/java"
|
|
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(8)
|
|
}
|
|
}
|
|
|
|
compileJava {
|
|
options.encoding = 'UTF-8'
|
|
options.compilerArgs += [
|
|
'-Amapstruct.verbose=false'
|
|
]
|
|
sourceSets.main.java { srcDir generatedJavaDir }
|
|
sourceSets.test.java { srcDir generatedTestJavaDir }
|
|
options.generatedSourceOutputDirectory = project.file(generatedJavaDir)
|
|
|
|
aptOptions {
|
|
processorArgs = [ 'querydsl.generatedAnnotationClass' : 'com.querydsl.core.annotations.Generated' ]
|
|
}
|
|
}
|
|
|
|
jar {
|
|
exclude '**/persistence.xml'
|
|
}
|
|
|
|
tasks.withType(JavaCompile) {
|
|
options.encoding = 'UTF-8'
|
|
}
|
|
|
|
dependencies {
|
|
|
|
api "com.querydsl:querydsl-jpa:${queryDslVersion}"
|
|
api "com.querydsl:querydsl-apt:${queryDslVersion}"
|
|
api "org.mapstruct:mapstruct:1.5.5.Final", "org.projectlombok:lombok:1.18.28"
|
|
|
|
// project > properties > Java Compiler > Annoation Processing
|
|
annotationProcessor "org.projectlombok:lombok:1.18.28", "org.projectlombok:lombok-mapstruct-binding:0.2.0", "org.mapstruct:mapstruct-processor:1.5.5.Final"
|
|
annotationProcessor "com.querydsl:querydsl-apt:${queryDslVersion}:jpa", "jakarta.persistence:jakarta.persistence-api:2.2.3", "jakarta.annotation:jakarta.annotation-api:1.3.5"
|
|
|
|
//api 'com.eactive.elink.common:elink-common-data:4.5.4'
|
|
api 'com.eactive.elink.common:elink-common-data:4.5.5'
|
|
api 'org.slf4j:slf4j-api:1.7.35'
|
|
api 'com.google.code.findbugs:jsr305:3.0.2'
|
|
|
|
api 'org.springframework.data:spring-data-jpa:2.7.12'
|
|
|
|
api "org.hibernate:hibernate-core:${hibernateVersion}"
|
|
api "org.hibernate:hibernate-entitymanager:${hibernateVersion}"
|
|
api "org.hibernate:hibernate-ehcache:${hibernateVersion}"
|
|
api "org.hibernate:hibernate-validator:5.4.3.Final"
|
|
api "org.hibernate:hibernate-envers:${hibernateVersion}"
|
|
|
|
api 'org.springframework.data:spring-data-envers:2.7.12'
|
|
|
|
api "org.springframework:spring-aspects:${springVersion}"
|
|
|
|
api group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
|
|
|
|
testRuntimeOnly 'com.h2database:h2:2.1.214'
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
|
|
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
|
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.8.2'
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.6.15'
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
|
archiveClassifier = 'sources'
|
|
from sourceSets.main.allSource
|
|
}
|
|
|
|
publishing {
|
|
repositories {
|
|
maven {
|
|
name = 'eactiveRepository'
|
|
def releasesRepoUrl = "${nexusUrl}/repository/maven-releases/"
|
|
def snapshotsRepoUrl = "${nexusUrl}/repository/maven-snapshots/"
|
|
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
|
credentials(PasswordCredentials)
|
|
}
|
|
}
|
|
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
from components.java
|
|
// artifact(sourcesJar) {
|
|
// classifier 'sources'
|
|
// }
|
|
pom {
|
|
description = "eLink Core JPA module"
|
|
licenses {
|
|
license {
|
|
name = "Commercial License"
|
|
url = "http://eactive.co.kr"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
task settingEclipseEncoding {
|
|
if (project.file('.settings').exists()) {
|
|
File f = file('.settings/org.eclipse.core.resources.prefs')
|
|
f.write('eclipse.preferences.version=1\n')
|
|
f.append('encoding/<project>=utf-8')
|
|
}
|
|
}
|
|
|
|
task initDirs() {
|
|
if (!project.file(generatedJavaDir).exists()) {
|
|
file(generatedJavaDir).mkdirs()
|
|
}
|
|
|
|
if (!project.file(generatedTestJavaDir).exists()) {
|
|
file(generatedTestJavaDir).mkdirs()
|
|
}
|
|
}
|
|
|
|
eclipse {
|
|
synchronizationTasks settingEclipseEncoding, initDirs
|
|
jdt {
|
|
apt {
|
|
genSrcDir = file(generatedJavaDir)
|
|
genTestSrcDir = file(generatedTestJavaDir)
|
|
}
|
|
}
|
|
wtp {
|
|
facet {
|
|
//you can add some extra wtp facets or update existing ones; mandatory keys: 'name', 'version':
|
|
facet name: 'jpt.jpa', version: '2.2'
|
|
}
|
|
}
|
|
project {
|
|
natures = ['org.eclipse.buildship.core.gradleprojectnature',
|
|
'org.eclipse.jdt.core.javanature',
|
|
'org.eclipse.wst.common.project.facet.core.nature',
|
|
'org.eclipse.wst.common.modulecore.ModuleCoreNature',
|
|
'org.eclipse.jem.workbench.JavaEMFNature']
|
|
buildCommand 'org.eclipse.buildship.core.gradleprojectbuilder'
|
|
buildCommand 'org.eclipse.wst.validation.validationbuilder'
|
|
buildCommand 'org.eclipse.wst.common.project.facet.core.builder'
|
|
buildCommand 'org.eclipse.jdt.core.javabuilder'
|
|
}
|
|
}
|
|
|
|
task printSourceSets {
|
|
doLast {
|
|
sourceSets.each { srcSet ->
|
|
println "SourceSet: ${srcSet.name}"
|
|
println " Java srcDirs : ${srcSet.allJava.srcDirs}"
|
|
println " Resources : ${srcSet.resources.srcDirs}"
|
|
println " Output dir : ${srcSet.output.classesDirs.asPath}"
|
|
}
|
|
}
|
|
} |