55 Star 101 Fork 1

花花 / url-shortener

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.gradle 3.24 KB
一键复制 编辑 Web IDE 原始数据 按行查看 历史
hua.huang 提交于 2015-03-12 09:39 . add maven pom.xml
group = 'com.hh'
version = "1.0.1.SNAPSHOT"
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'war'
apply plugin: 'eclipse'
apply plugin: 'eclipse-wtp'
apply plugin: 'jetty'
apply plugin: 'maven'
// Fills out all dependencies which are necessary to start the embedded jetty into our war file
configurations {
embeddedJetty
}
dependencies {
compile 'org.springframework:spring-webmvc:4.1.1.RELEASE'
compile 'org.springframework:spring-context-support:4.1.1.RELEASE'
compile 'commons-io:commons-io:2.4'
compile 'org.apache.commons:commons-lang3:3.3.2'
compile 'commons-beanutils:commons-beanutils:1.9.2'
compile 'com.google.guava:guava:18.0'
compile 'commons-validator:commons-validator:1.4.0'
// mongo
compile 'org.mongodb:mongo-java-driver:2.12.1'
compile 'com.github.jmkgreen.morphia:morphia:1.2.3'
compile 'com.github.jmkgreen.morphia:morphia-validation:1.2.3'
compile 'org.hibernate:hibernate-validator-annotation-processor:4.1.0.Final'
compile 'joda-time:joda-time:2.4'
// log
compile 'org.slf4j:slf4j-log4j12:1.7.7'
//providedCompile 'org.eclipse.jetty:jetty-webapp:9.2.3.v20140905'
providedCompile 'servletapi:servlet-api:2.4'
testCompile 'junit:junit:4.11'
// jetty
embeddedJetty 'org.eclipse.jetty:jetty-servlet:9.2.3.v20140905'
embeddedJetty 'org.eclipse.jetty:jetty-webapp:9.2.3.v20140905'
embeddedJetty 'org.eclipse.jetty:jetty-server:9.2.3.v20140905'
embeddedJetty 'org.eclipse.jetty:jetty-jsp:9.2.3.v20140905'
//embeddedJetty 'org.eclipse.jetty:jetty-annotations:9.2.3.v20140905'
}
repositories {
maven { url "http://maven.oschina.net/content/groups/public" }
mavenCentral()
}
//////////////jetty start////////////////
//war.baseName = 'MyExecutableWar'
war {
// unzip and add all jetty dependencies into the root of our war file
from {configurations.embeddedJetty.collect {
project.zipTree(it)
}
}
// remove signature and unnecessary files
exclude "META-INF/*.SF", "META-INF/*.RSA", "about.html", "about_files/**", "readme.txt", "plugin.properties", "jetty-dir.css"
// include in the root of the war only the classes which will be used to start the embedded Jetty
from ("$buildDir/classes/main/com/hh/us/jetty") {
into "com/hh/us/jetty"
}
//exclude "com/myapp/"
// sets the main class to run when the generate war be executed using 'java -jar'
manifest {
attributes (
'Main-Class': 'com.hh.us.jetty.JettyStarter',
"Implementation-Title": project.name,
"Implementation-Version": project.version,
"Built-JDK": System.getProperty('java.version'),
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
)
}
}
// Once you will need some basic api (servlet api, for example) for compilation, you need to add embeddedJetty dependencies for compilation
sourceSets.main.compileClasspath += configurations.embeddedJetty
// you need to do the same for eclipse classpath, so you can use it to edit your java files
eclipse {
classpath {
plusConfigurations += [configurations.embeddedJetty]
downloadSources=true
}
}
//////////////jetty end////////////////
tasks.withType(JavaCompile) {
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
task wrapper(type: Wrapper) { gradleVersion = '2.2.1' }
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
Java
1
https://gitee.com/crystony/url-shortener.git
git@gitee.com:crystony/url-shortener.git
crystony
url-shortener
url-shortener
master

搜索帮助

14c37bed 8189591 565d56ea 8189591