group 'pro.ticktock.base'
version currentVersion
ext.moduleName = 'pro.ticktock.base.javatree'
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'
sourceCompatibility = 10.0
repositories {
jcenter()
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '4.+')
}
}
jar {
manifest {
attributes(
"Implementation-Title": "Gradle",
"Implementation-Version": version,
// "Automatic-Module-Name": moduleName
)
}
}
dependencies {
compile 'org.apache.commons:commons-collections4:4.2'
testCompile 'junit:junit:4.12'
}
compileJava {
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
]
classpath = files()
}
}
compileTestJava {
inputs.property("moduleName", moduleName)
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
'--add-modules', 'junit',
'--add-reads', "$moduleName=junit",
'--patch-module', "$moduleName=" + files(sourceSets.test.java.srcDirs).asPath,
]
classpath = files()
}
}
test {
inputs.property("moduleName", moduleName)
doFirst {
jvmArgs = [
'--module-path', classpath.asPath,
'--add-modules', 'ALL-MODULE-PATH',
'--add-reads', "$moduleName=junit",
'--patch-module', "$moduleName=" + files(sourceSets.test.java.outputDir).asPath,
]
classpath = files()
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
artifactory {
contextUrl = 'http://njmavencenter:5801/artifactory'
publish {
repository {
repoKey = 'syncer' // The Artifactory repository key to publish to
username = "${artifactory_user}" // The publisher user name
password = "${artifactory_password}" // The publisher password
}
defaults {
// Reference to Gradle publications defined in the build script.
// This is how we tell the Artifactory Plugin which artifacts should be
// published to Artifactory.
publications('mavenJava')
publishArtifacts = true
// Properties to be attached to the published artifacts.
properties = ['qa.level': 'basic', 'dev.team' : 'core']
// Publish generated POM files to Artifactory (true by default)
publishPom = true
}
}
resolve {
repoKey = 'jcenter'
}
}
一键复制
编辑
Web IDE
原始数据
按行查看
历史