加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 2.29 KB
一键复制 编辑 原始数据 按行查看 历史
小流氓 提交于 2018-08-31 18:15 . 发布3.1.18版本
subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'findbugs'
apply plugin: 'maven-publish'
apply plugin: 'pmd'
ext {
p3c = "1.3.0"
}
pmd {
consoleOutput = true
reportsDir = file("build/reports/pmd")
ruleSets = [
"java-ali-comment",
"java-ali-concurrent",
"java-ali-constant",
"java-ali-exception",
"java-ali-flowcontrol",
"java-ali-naming",
"java-ali-oop",
"java-ali-orm",
"java-ali-other",
"java-ali-set"
]
}
group = 'xyz.noark'
version = '3.1.18.Final'
sourceCompatibility = 1.8
targetCompatibility = 1.8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
mavenCentral()
jcenter()
}
dependencies {
testImplementation 'junit:junit:4.12'
pmd "com.alibaba.p3c:p3c-pmd:${p3c}"
}
jar {
manifest.attributes provider: '小流氓'
manifest.attributes["Created-By"] = "${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
manifest.attributes["Implementation-Title"] = project.name
manifest.attributes["Implementation-Version"] = project.version
}
javadoc {
options{
encoding "UTF-8"
charSet 'UTF-8'
author true
version true
links "http://docs.oracle.com/javase/8/docs/api/"
}
}
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar {
classifier "sources"
}
}
}
repositories {
maven {
//默认发布到Maven Nexus私服的发行库
def nexusUrl ="http://192.168.51.234:8081/repository/maven-releases/"
//如果为快照版本发布到Maven Nexus私服的快照库
if(version.endsWith("-SNAPSHOT")) {
nexusUrl ="http://192.168.51.234:8081/repository/maven-snapshots/"
}
url nexusUrl
credentials {
username = "admin"
password = "admin123"
}
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化