plugins {
|
id 'java'
|
id 'maven-publish' // or 'maven'
|
id 'org.springframework.boot' version '2.7.18'
|
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
|
}
|
repositories {
|
maven {
|
url 'http://1.95.69.137:9081/repository/maven-public/'
|
allowInsecureProtocol = true
|
}
|
mavenLocal()
|
maven { url 'https://maven.aliyun.com/repository/public' }
|
maven { url 'https://maven.aliyun.com/repository/center' }
|
mavenCentral()
|
}
|
|
bootJar.enabled = true
|
jar.enabled = true
|
|
group = 'com.eternal'
|
version = '1.0.0'
|
|
java {
|
sourceCompatibility = '1.8'
|
targetCompatibility = '1.8'
|
}
|
|
dependencies {
|
implementation fileTree(dir: '/lib', include: ['*.jar'])
|
|
implementation 'com.eternal:com.eternal.rfid.Common:2.1.20'
|
implementation 'com.eternal:app-params-config:1.1.16'
|
|
implementation 'org.springframework.boot:spring-boot-starter-web'
|
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
|
implementation 'com.alibaba.fastjson2:fastjson2:2.0.46'
|
|
compileOnly 'org.projectlombok:lombok'
|
annotationProcessor 'org.projectlombok:lombok'
|
testCompileOnly('org.projectlombok:lombok')
|
testAnnotationProcessor('org.projectlombok:lombok')
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
}
|
|
// 编译相关参数
|
compileJava {
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_1_8
|
options.encoding = 'UTF-8'
|
options.compilerArgs = [
|
'-Xlint:all', '-Xlint:-processing'
|
]
|
}
|
// 定义 sourcesJar 任务
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
archiveClassifier.set('sources')
|
from sourceSets.main.allSource
|
}
|
publishing {
|
publications {
|
mavenJava(MavenPublication) {
|
from components.java
|
// 如果需要发布源码 JAR 文件
|
artifact sourcesJar
|
}
|
}
|
repositories {
|
maven {
|
name = 'localRepo'
|
url = "file://${buildDir}/repo"
|
}
|
maven {
|
name = 'releases'
|
allowInsecureProtocol = true // 显式允许不安全的 HTTP 协议
|
url = 'http://1.95.69.137:9081/repository/maven-releases/'
|
credentials {
|
username = "admin"
|
password = "admin123"
|
}
|
}
|
}
|
}
|
|
tasks.named('test') {
|
useJUnitPlatform()
|
}
|