Fetch the repository succeeded.
This action will force synchronization from WeBank/WeIdentity-Build-Tools, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
plugins {
id 'org.springframework.boot' version '2.4.1'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
id 'java'
}
def gradleVer = "4"
if (gradle.gradleVersion.startsWith("6")
|| gradle.gradleVersion.startsWith("5")
|| gradle.gradleVersion.startsWith("4.10")
|| gradle.gradleVersion.startsWith("4.9")
|| gradle.gradleVersion.startsWith("4.8")
|| gradle.gradleVersion.startsWith("4.7")) {
println "Gradle with version >= 4.7 detected"
gradleVer = "5"
} else {
println "Gradle with version < 4.7 detected"
}
apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'signing'
group = 'com.webank'
version = "0.0.0"
def versionFile = file("VERSION")
versionFile.eachLine { line ->
version = line
}
def repo ="${repoType}"
// Specify JDK version - may vary in different scenarios
sourceCompatibility = 1.8
targetCompatibility = 1.8
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
// In this section you declare where to find the dependencies of your project
repositories {
if (gradle.startParameter.isOffline()) {
maven {
url 'dependencies'
}
} else {
mavenLocal()
if ("cn" == repo) {
println "use cn repo"
maven {url "http://maven.aliyun.com/nexus/content/groups/public/"}
} else {
println "use default repo"
mavenCentral()
}
maven { url "https://dl.bintray.com/ethereum/maven/" }
maven { url "https://oss.sonatype.org/content/groups/public/" }
}
}
List lombok = [
"org.projectlombok:lombok:1.18.12"
]
List jcommander = [
"com.beust:jcommander:1.72"
]
List log4j = [
"org.apache.logging.log4j:log4j-api:2.15.0",
"org.apache.logging.log4j:log4j-web:2.15.0",
"org.apache.logging.log4j:log4j-core:2.15.0",
"org.apache.logging.log4j:log4j-jcl:2.15.0",
"org.apache.logging.log4j:log4j-slf4j-impl:2.15.0",
"org.slf4j:jul-to-slf4j:1.7.30",
"org.slf4j:slf4j-api:1.7.30"
]
List json = [
"com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.0",
"com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.0",
"com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.0",
"com.fasterxml.jackson.core:jackson-databind:2.11.0",
"com.fasterxml.jackson.core:jackson-annotations:2.11.0",
"com.fasterxml.jackson.core:jackson-core:2.11.0",
"com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.0"
]
List mysql_driver = [
"mysql:mysql-connector-java:8.0.20"
]
List http_proxy = [
"org.mitre.dsmiley.httpproxy:smiley-http-proxy-servlet:1.7"
]
List redis_driver = [
"org.redisson:redisson:3.15.0"
]
def spring_version = "5.3.2"
List spring = [
"org.springframework:spring-aop:$spring_version",
"org.springframework:spring-beans:$spring_version",
"org.springframework:spring-context:$spring_version",
"org.springframework:spring-core:$spring_version",
"org.springframework:spring-jcl:$spring_version",
"org.springframework:spring-jdbc:$spring_version",
"org.springframework:spring-test:$spring_version",
"org.springframework:spring-messaging:$spring_version",
"org.springframework:spring-tx:$spring_version"
]
def gson_version = "2.8.6"
List gson = [
"com.google.code.gson:gson:$gson_version"
]
configurations {
localDeps
all*.exclude group: "org.slf4j", module: "slf4j-log4j12"
all*.exclude group: "ch.qos.logback"
all*.exclude group: "org.apache.logging.log4j", module: "log4j-to-slf4j"
}
// In this section you declare the dependencies for your production and test code
dependencies {
localDeps lombok
compile('org.springframework.boot:spring-boot-starter-web')
compile("org.springframework.boot:spring-boot-starter-websocket")
if (gradleVer.startsWith("4")) {
if (!gradle.startParameter.isOffline()) {
compile lombok, jcommander, log4j, spring, gson, json, mysql_driver, redis_driver, http_proxy
compile("com.webank:weid-java-sdk:${weidSdkVersion}") {
exclude group: "org.springframework", module: "*"
exclude group: "javax.validation", module: "validation-api"
exclude group: "org.codehaus.jackson", module: "jackson-mapper-asl"
}
}
}
if (gradleVer.startsWith("5")) {
if (!gradle.startParameter.isOffline()) {
compileOnly 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
compile lombok, jcommander, log4j, spring, gson, json, mysql_driver, redis_driver, http_proxy
compile("com.webank:weid-java-sdk:${weidSdkVersion}") {
exclude group: "org.springframework", module: "*"
exclude group: "javax.validation", module: "validation-api"
exclude group: "org.codehaus.jackson", module: "jackson-mapper-asl"
}
} else {
compileOnly files('dist/lib/lombok-1.18.12.jar')
annotationProcessor files('dist/lib/lombok-1.18.12.jar')
}
}
compile fileTree(dir: 'common/ext', include: '*.jar')
}
sourceSets {
main {
java {
srcDirs = ['src/main/java']
}
resources {
srcDirs = ['src/main/resources']
excludes = ["*.xml", "*.properties", "*.crt", "*.key"]
}
}
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
bootRun {
systemProperty "jdk.tls.namedGroups", "${jdkTlsNamedGroups}"
}
eclipse {
classpath {
downloadSources = false
}
}
clean {
delete "dist"
delete "resources/fisco.properties"
delete "resources/weidentity.properties"
}
jar {
enabled = true
baseName = 'weid-build-tools'
destinationDir file('dist/app')
archiveName project.name + '-' + version + '.jar'
// 这句会改变maven包的包名,谨慎
// classifier = 'boot'
into('file/tools') {
from fileTree(file("tools/")){
excludes = ["test_data"]
}
}
into('file/common/script') {
from fileTree(file("common/script/")){
excludes = ["build_tools_ci.sh", "install_build_tool.sh", "**/*.properties", "install"]
}
}
into('file/resources') {
from 'src/main/resources/log4j2.xml'
}
into('file/dist/conf') {
from 'src/main/resources/application.properties'
}
into('file/dist/lib') {
from fileTree(file("./common/ext")){
//自定义过滤规则
includes = ["*.jar"]
}
}
into('file/dist/app') {
from 'resources/.gitkeep'
}
into('file') {
from fileTree(file("./")){
//自定义过滤规则
includes = ["*.sh", "VERSION"]
excludes = ["build.sh"]
}
from 'common/script/tpl/run.config.tpl'
rename('run.config.tpl', 'run.config')
}
doLast {
copy {
from file('src/main/resources/log4j2.xml')
into 'resources/'
}
copy {
from file('src/main/resources/application.properties')
into 'dist/conf'
}
if (!gradle.startParameter.isOffline()) {
copy {
from configurations.runtime
from configurations.localDeps
into 'dist/lib'
}
}
}
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
name 'weid-build-tools'
packaging 'jar'
description 'Java sdk for WeIdentity.'
url 'https://github.com/WeBankFinTech/weidentity-contract'
scm {
url 'scm:git@github.com:WeBankFinTech/weidentity-contract.git'
connection 'scm:git@github.com:WeBankFinTech/weidentity-contract.git'
developerConnection 'git@github.com:WeBankFinTech/weidentity-contract.git'
}
licenses {
license {
name 'GNU Lesser General Public License version 3'
url 'https://opensource.org/licenses/LGPL-3.0'
distribution 'repo'
}
}
developers {
developer {
id 'tonychen'
name 'tonychen'
}
}
}
}
}
}
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.allTasks.any { it.name == 'build' || it.name == 'assemble' }) {
tasks.findAll {
it.name == 'signArchives' || it.name == 'signDocsJar' || it.name == 'signTestJar'
}.each { task ->
task.enabled = false
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。