私信发送成功
Watch Star Fork

Nutz / nutzJavaApache-2.0GVP

Nutz -- Web Framework(Mvc/Ioc/Aop/Dao/Json) for ALL Java developer https://nutz.cn
克隆/下载
一键复制 编辑 原始数据 按行查看 历史
_build.gradle 6.32 KB wendal chen 提交于 2017-04-15 20:27 . update: 继续完善发行注记
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
group = 'org.nutz'
version = '1.r.60'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
description = "Nutz"
sourceCompatibility = 1.6
targetCompatibility = 1.6
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version:'4.8.2'
testCompile group: 'com.h2database', name: 'h2', version:'1.4.181'
testCompile group: 'org.eclipse.jetty', name: 'jetty-server', version:'7.6.18.v20150929'
testCompile group: 'org.eclipse.jetty', name: 'jetty-jsp', version:'7.6.18.v20150929'
testCompile group: 'org.postgresql', name: 'postgresql', version:'9.4-1206-jdbc41'
testCompile group: 'mysql', name: 'mysql-connector-java', version:'5.1.40'
testCompile group: 'org.xerial', name: 'sqlite-jdbc', version:'3.8.11.2'
testCompile(group: 'com.alibaba', name: 'druid', version:'1.0.26') {
exclude(module: 'jconsole')
exclude(module: 'tools')
}
testCompile group: 'org.eclipse.jetty.aggregate', name: 'jetty-all', version:'9.2.20.v20161216'
testCompile group: 'org.eclipse.jetty', name: 'jetty-jsp', version:'9.2.19.v20160908'
compile(group: 'log4j', name: 'log4j', version:'1.2.17')
compile(group: 'javax.servlet', name: 'java.servlet-api', version:'3.1.0')
}
sourceSets {
main{
java.srcDir "$projectDir/src"
}
test {
java.srcDirs "$projectDir/test"
resources.srcDir "$projectDir/test-prop"
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.compilerArgs = ["-parameters"]
}
javadoc.options.encoding = "UTF-8"
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task androidJar(type: Jar, dependsOn: classes) {
classifier = 'android'
from sourceSets.main.output
exclude('org/nutz/repo/org/**')
exclude('org/nutz/dao/**')
exclude('org/nutz/trans/**')
exclude('org/nutz/service/**')
exclude('org/nutz/img/**')
}
task jsonJar(type: Jar, dependsOn: classes) {
classifier = 'json'
from sourceSets.main.output
exclude('org/nutz/repo/org/**')
exclude('org/nutz/dao/**')
exclude('org/nutz/trans/**')
exclude('org/nutz/service/**')
exclude('org/nutz/img/**')
exclude('org/nutz/ioc/**')
exclude('org/nutz/mvc/**')
exclude('org/nutz/aop/**')
exclude('org/nutz/http/**')
exclude('org/nutz/net/**')
exclude('org/nutz/el/**')
exclude('org/nutz/repo/**')
exclude('org/nutz/filepool/**')
exclude('org/nutz/runner/**')
exclude('org/nutz/resource/**')
exclude('org/nutz/conf/**')
exclude('*.xsd')
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
archives androidJar
// archives jsonJar
}
processResources {
from ('src'){
exclude '**/*.java';
}
}
processTestResources {
from ('test'){
exclude '**/*.java';
}
}
test {
include "org/nutz/TestAll"
jvmArgs "-Dfile.encoding=utf-8"
//showStackTraces = true
testLogging {
debug {
events "started", "skipped", "failed"
exceptionFormat "full"
}
}
}
def Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
//if (isReleaseVersion) {
ext."signing.keyId"=properties["signing.keyId"]
ext."signing.password"=properties["signing.password"]
ext."signing.secretKeyRingFile"=properties["signing.secretKeyRingFile"]
ext."ossrhUsername"=properties["ossrhUsername"]
ext."ossrhPassword"=properties["ossrhPassword"]
//}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'Nutz'
packaging 'jar'
description 'Nutz, which is a collections of lightweight frameworks, each of them can be used independently'
url 'https://nutz.cn'
scm {
connection 'scm:git:git://github.com/nutzam/nutz.git'
developerConnection 'scm:git:git://github.com/nutzam/nutz.git'
url 'git://github.com/nutzam/nutz.git'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'zozoh'
name 'zozoh'
email 'zozohtnt@gmail.com'
}
developer {
id 'wendal'
name 'Wendal Chen'
email 'wendal1985@gmail.com'
url "http://wendal.net"
}
}
}
}
}
}
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
def installer = install.repositories.mavenInstaller
def deployer = uploadArchives.repositories.mavenDeployer
//[installer, deployer]*.pom*.whenConfigured {pom ->
// pom.dependencies.find {dep -> dep.groupId != '' }.provided = true
//}
deployer.pom.whenConfigured {pom ->
pom.dependencies.find {dep -> dep.scope == "compile" || dep.version == "2.5" }.each {dep -> dep.scope = "provided"}
pom.dependencies.find {dep -> dep.scope == "compile"}.each{dep-> println dep.scope }
pom.dependencies.find {dep -> dep.scope == "compile"}.each {dep -> dep.scope = "provided"}
pom.dependencies.find {dep -> dep.scope == "compile"}.each{dep-> println dep.scope }
}
installer.pom.whenConfigured {pom ->
pom.dependencies.find {dep -> dep.scope != "test" }.each {dep -> dep.scope = "provided"}
pom.dependencies.each{dep-> println dep.scope }
}

评论 (0)

你可以在登录后,对此项目发表评论