- 浏览: 270827 次
- 性别:
- 来自: 天津
文章分类
- 全部博客 (183)
- oracle (4)
- informix (1)
- web开发 (6)
- java (49)
- hibernate (1)
- hadoop (1)
- spring (23)
- 非技术 (8)
- ibatis2 (5)
- Linux (6)
- tomcat (14)
- nginx (7)
- dubbo (3)
- myibatis (7)
- webservice 开发 (2)
- mysql (2)
- svn (2)
- redis (7)
- 分布式技术 (17)
- zookeeper (2)
- kafka (2)
- velocity (1)
- maven (7)
- js (1)
- freemarker (1)
- Thymeleaf (3)
- 代码审计 (1)
- ibatis3 (1)
- rabbitmq (1)
最新评论
group 'com.cloudboce'
apply plugin: 'java'
apply plugin: 'war'
//apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.hidetake.ssh'
sourceCompatibility = 1.7
targetCompatibility = 1.7
version = '1.0'
jar {
manifest {
attributes 'Implementation-Title': 'Gradle Quickstart',
'Implementation-Version': version
}
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.springframework') {
details.useVersion '4.2.4.RELEASE'
}
}
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'commons-logging') {
details.useVersion '1.2'
}
}
}
buildscript{
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'org.hidetake:gradle-ssh-plugin:2.6.0'
}
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
def springVersion = "4.2.4.RELEASE";
compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
testCompile group: 'junit', name: 'junit', version: '4.+'
//core spring
compile "org.springframework:spring-context:$springVersion"
compile "org.springframework:spring-core:$springVersion"
compile "org.springframework:spring-webmvc:$springVersion"
compile "org.springframework:spring-aop:$springVersion"
compile "org.springframework:spring-expression:$springVersion"
compile "org.springframework:spring-beans:$springVersion"
compile "org.springframework:spring-aspects:$springVersion"
compile group: 'org.aopalliance', name: 'com.springsource.org.aopalliance', version: '1.0.0'
compile group: 'org.aspectj', name: 'com.springsource.org.aspectj.weaver', version: '1.6.8.RELEASE'
//db access
compile "org.springframework:spring-jdbc:$springVersion"
compile "org.springframework:spring-orm:$springVersion"
//log4j2
def log4j_version = "2.2";
compile "org.apache.logging.log4j:log4j-api:$log4j_version"
compile "org.apache.logging.log4j:log4j-core:$log4j_version"
compile "org.apache.logging.log4j:log4j-web:$log4j_version"
compile "org.apache.logging.log4j:log4j-slf4j-impl:$log4j_version"
//mybatis
compile "org.mybatis:mybatis:3.2.8"
compile "org.mybatis:mybatis-spring:1.2.2"
// jackson
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.1'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.1'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.8.1'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0'
//c3p0
compile "c3p0:c3p0:0.9.1.2"
//proxool
compile group: 'com.cloudhopper.proxool', name: 'proxool', version: '0.9.1'
compile group: 'com.cloudhopper.proxool', name: 'proxool-cglib', version: '0.9.1'
compile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.+'
compile group: 'xerces', name: 'xerces', version: '2.4.0'
compile group: 'org.codehaus.castor', name: 'castor-xml', version: '1.4.1'
compile group: 'org.aspectj', name: 'aspectjrt', version: '1.+'
compile group: 'org.aspectj', name: 'aspectjweaver', version: '1.+'
compile group: 'cglib', name: 'cglib-nodep', version: '2.+'
testCompile group: 'org.springframework', name: 'spring-test', version: springVersion
testCompile group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: log4j_version
compile files('src/main/webapp/WEB-INF/lib/ojdbc6.jar')
compile files('src/main/webapp/WEB-INF/lib/BoceSMS.jar')
compile group: 'dom4j', name: 'dom4j', version: '1.6.1'
compile group: 'jaxen', name: 'jaxen', version: '1.1.1'
/* Redis */
compile group: 'org.springframework.data', name: 'spring-data-redis', version: '1.7.2.RELEASE'
compile group: 'redis.clients', name: 'jedis', version: '2.8.1'
//httpclient
compile group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'
compile group: 'commons-codec', name: 'commons-codec', version: '1.2'
compile group: 'commons-logging', name: 'commons-logging', version: '1.0.4'
compile group: 'org.jasypt', name: 'jasypt', version: '1.9.2'
compile group: 'org.jasypt', name: 'jasypt-spring31', version: '1.9.0'
compile group: 'commons-fileupload', name: 'commons-fileupload', version: '1.3.1'
compile group: 'commons-io', name: 'commons-io', version: '2.5'
compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.3.6'
compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.6'
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.2'
}
test {
systemProperties 'property': 'value'
}
uploadArchives {
repositories {
flatDir {
dirs 'repos'
}
}
}
task copyJars(type: Copy) {
from configurations.runtime
into '/src/main/webapp/WEB-INF/lib'
}
ssh.settings {
knownHosts = allowAnyHosts
}
remotes {
deployServer {
host = '192.168.6.24'
user = 'root'
password = 'bocetest123'
}
}
war {
archiveName 'cloud_server.war'
}
task shutdownTomcat() << {
ssh.run {
session(remotes.deployServer) {
println 'shut down tomcat...'
executeScript '''#!/bin/sh
cd /opt/app/apache-tomcat-7.0.67/bin
./shutdown.sh
'''
}
}
}
task del(dependsOn:shutdownTomcat) << {
ssh.run {
session(remotes.deployServer) {
println 'start deleting...'
executeScript '''#!/bin/sh
rm -rf /opt/app/apache-tomcat-7.0.67/webapps/cloud_server
rm -f /opt/app/apache-tomcat-7.0.67/webapps/cloud_server.war
'''
}
}
}
task copy(dependsOn:del) << {
ssh.run {
session(remotes.deployServer) {
println 'start copying war...'
put from: buildDir.toString() + '/libs/cloud_server.war', into: '/opt/app/apache-tomcat-7.0.67/webapps'
}
}
}
task deploy(dependsOn:copy) << {
ssh.run {
session(remotes.deployServer) {
println 'start tomcat...'
execute '/opt/app/apache-tomcat-7.0.67/bin/startup.sh'
}
}
}
/*group 'com'
version '1.0-SNAPSHOT'
apply plugin: 'war'
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
}*/
apply plugin: 'java'
apply plugin: 'war'
//apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.hidetake.ssh'
sourceCompatibility = 1.7
targetCompatibility = 1.7
version = '1.0'
jar {
manifest {
attributes 'Implementation-Title': 'Gradle Quickstart',
'Implementation-Version': version
}
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.springframework') {
details.useVersion '4.2.4.RELEASE'
}
}
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'commons-logging') {
details.useVersion '1.2'
}
}
}
buildscript{
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'org.hidetake:gradle-ssh-plugin:2.6.0'
}
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
def springVersion = "4.2.4.RELEASE";
compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
testCompile group: 'junit', name: 'junit', version: '4.+'
//core spring
compile "org.springframework:spring-context:$springVersion"
compile "org.springframework:spring-core:$springVersion"
compile "org.springframework:spring-webmvc:$springVersion"
compile "org.springframework:spring-aop:$springVersion"
compile "org.springframework:spring-expression:$springVersion"
compile "org.springframework:spring-beans:$springVersion"
compile "org.springframework:spring-aspects:$springVersion"
compile group: 'org.aopalliance', name: 'com.springsource.org.aopalliance', version: '1.0.0'
compile group: 'org.aspectj', name: 'com.springsource.org.aspectj.weaver', version: '1.6.8.RELEASE'
//db access
compile "org.springframework:spring-jdbc:$springVersion"
compile "org.springframework:spring-orm:$springVersion"
//log4j2
def log4j_version = "2.2";
compile "org.apache.logging.log4j:log4j-api:$log4j_version"
compile "org.apache.logging.log4j:log4j-core:$log4j_version"
compile "org.apache.logging.log4j:log4j-web:$log4j_version"
compile "org.apache.logging.log4j:log4j-slf4j-impl:$log4j_version"
//mybatis
compile "org.mybatis:mybatis:3.2.8"
compile "org.mybatis:mybatis-spring:1.2.2"
// jackson
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.1'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.1'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.8.1'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0'
//c3p0
compile "c3p0:c3p0:0.9.1.2"
//proxool
compile group: 'com.cloudhopper.proxool', name: 'proxool', version: '0.9.1'
compile group: 'com.cloudhopper.proxool', name: 'proxool-cglib', version: '0.9.1'
compile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.+'
compile group: 'xerces', name: 'xerces', version: '2.4.0'
compile group: 'org.codehaus.castor', name: 'castor-xml', version: '1.4.1'
compile group: 'org.aspectj', name: 'aspectjrt', version: '1.+'
compile group: 'org.aspectj', name: 'aspectjweaver', version: '1.+'
compile group: 'cglib', name: 'cglib-nodep', version: '2.+'
testCompile group: 'org.springframework', name: 'spring-test', version: springVersion
testCompile group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: log4j_version
compile files('src/main/webapp/WEB-INF/lib/ojdbc6.jar')
compile files('src/main/webapp/WEB-INF/lib/BoceSMS.jar')
compile group: 'dom4j', name: 'dom4j', version: '1.6.1'
compile group: 'jaxen', name: 'jaxen', version: '1.1.1'
/* Redis */
compile group: 'org.springframework.data', name: 'spring-data-redis', version: '1.7.2.RELEASE'
compile group: 'redis.clients', name: 'jedis', version: '2.8.1'
//httpclient
compile group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'
compile group: 'commons-codec', name: 'commons-codec', version: '1.2'
compile group: 'commons-logging', name: 'commons-logging', version: '1.0.4'
compile group: 'org.jasypt', name: 'jasypt', version: '1.9.2'
compile group: 'org.jasypt', name: 'jasypt-spring31', version: '1.9.0'
compile group: 'commons-fileupload', name: 'commons-fileupload', version: '1.3.1'
compile group: 'commons-io', name: 'commons-io', version: '2.5'
compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.3.6'
compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.6'
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.2'
}
test {
systemProperties 'property': 'value'
}
uploadArchives {
repositories {
flatDir {
dirs 'repos'
}
}
}
task copyJars(type: Copy) {
from configurations.runtime
into '/src/main/webapp/WEB-INF/lib'
}
ssh.settings {
knownHosts = allowAnyHosts
}
remotes {
deployServer {
host = '192.168.6.24'
user = 'root'
password = 'bocetest123'
}
}
war {
archiveName 'cloud_server.war'
}
task shutdownTomcat() << {
ssh.run {
session(remotes.deployServer) {
println 'shut down tomcat...'
executeScript '''#!/bin/sh
cd /opt/app/apache-tomcat-7.0.67/bin
./shutdown.sh
'''
}
}
}
task del(dependsOn:shutdownTomcat) << {
ssh.run {
session(remotes.deployServer) {
println 'start deleting...'
executeScript '''#!/bin/sh
rm -rf /opt/app/apache-tomcat-7.0.67/webapps/cloud_server
rm -f /opt/app/apache-tomcat-7.0.67/webapps/cloud_server.war
'''
}
}
}
task copy(dependsOn:del) << {
ssh.run {
session(remotes.deployServer) {
println 'start copying war...'
put from: buildDir.toString() + '/libs/cloud_server.war', into: '/opt/app/apache-tomcat-7.0.67/webapps'
}
}
}
task deploy(dependsOn:copy) << {
ssh.run {
session(remotes.deployServer) {
println 'start tomcat...'
execute '/opt/app/apache-tomcat-7.0.67/bin/startup.sh'
}
}
}
/*group 'com'
version '1.0-SNAPSHOT'
apply plugin: 'war'
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
}*/
发表评论
-
maven根据不同环境打不同的war
2018-06-27 18:47 963<project xmlns="http:// ... -
maven 内置变量
2017-11-03 14:42 695Maven共有6类属性: 内置属性(Maven预定义,用户可以 ... -
maven 常用插件
2017-11-03 09:39 574<?xml version="1.0" ... -
wagon-maven-plugin 实现远程部署
2017-10-31 15:53 14831.添加wagon-maven-plugin ... -
maven 远程发布系统到tomcat7
2017-08-24 16:37 5951. 修改Tomcat7的tomcat-users.xml ... -
eclipse 中maven 加入本地jar文件
2017-05-16 15:02 14091.在项目上单击右键-》新建文件夹(如:lib) 2.在pom ...
相关推荐
- `defaultConfig`:定义应用的基本配置,包括版本号、最小SDK版本、目标SDK版本、应用图标等。 - `buildTypes`:定义不同的构建类型,如debug和release,它们有不同的签名、调试标志和混淆设置。 - `productFlavors...
以下是一个基本的`build.gradle`配置示例: ```groovy plugins { id 'java' } group 'com.example' // 项目组名 version '1.0-SNAPSHOT' // 项目版本 repositories { mavenCentral() // 添加Maven中央仓库 } ...
首先,让我们了解Gradle的基本概念。Gradle基于Groovy和Domain-Specific Language (DSL),允许开发者以简洁、易于理解的方式定义构建过程。与Maven相比,Gradle提供了更大的灵活性,支持增量构建,可以更好地处理...
2. **创建项目**:通过`gradle init`命令,可以快速生成一个基本的Gradle项目结构,包括构建脚本`build.gradle`。 3. **编写构建脚本**:在`build.gradle`中定义项目属性、依赖和任务,如`apply plugin: 'java'`...
总结来说,将`ojdbc6.jar`通过Gradle导入本地项目并使用`JDBCDemo`进行数据库连接,涉及了Gradle的依赖管理、JDBC的基本操作以及Oracle驱动的使用。理解这些知识点对于任何需要与Oracle数据库打交道的Java开发者都是...
本文将详细讲解如何在Android Studio中,特别是在不同的Gradle版本下配置dex分包。 标题提到的"Android Studio Gradle配置dex分包"主要是指在构建过程中启用MultiDex支持,确保所有必要的类都被正确打包并能在运行...
本文将详细介绍如何在Android Studio中使用新的Gradle构建工具配置NDK环境,以便进行原生代码(C/C++)的开发。 首先,NDK是Android Native Development Kit的缩写,它允许开发者使用C和C++编写性能关键部分的代码...
了解了Gradle 2.12的基本配置后,你就可以开始编写构建脚本并执行任务了。一个简单的`build.gradle`文件可能如下所示: ```groovy apply plugin: 'java' sourceSets { main { java { srcDirs 'src/main/java' }...
Gradle 是Java 软件开发中的自动化..., 因为Groovy 用于编写Gradle 构建配置的DSL,所以为了帮助读者更好地理解Gradle,《实战Gradle》还讲解了Groovy 的基本知识,虽然不是全方位地讲解Groovy,但是理解Gradle 足矣。
1. **Gradle基础**:包括Gradle的基本概念,如项目、任务和依赖管理。Gradle的项目结构由一系列相互关联的模块构成,每个模块可以定义自己的任务,这些任务用于执行特定的构建操作,如编译、测试和打包。依赖管理则...
2. **精简版(bin)**: `gradle-8.2-bin.zip` 只包含了运行Gradle的基本组件,如可执行文件和必要的库。使用这个版本时,当你需要使用某些插件时,Gradle会自动从网络上下载所需的依赖,因此需要保持良好的网络连接...
- **Gradle入门**:学习如何创建Gradle项目,配置build.gradle文件,以及执行基本的构建任务。 - **Gradle插件**:了解常用的Gradle插件,如Java插件,学会如何自定义和应用插件。 - **依赖管理**:熟悉Gradle的依赖...
在Gradle中,Task是最基本的工作单元。Task可以理解为一个动作或者命令,它们有明确的执行顺序。`doFirst`和`doLast`方法分别定义了Task执行前和执行后要进行的动作。例如: ```groovy task myTask { doFirst { ...
本文将对Android Studio (AS) 中Gradle配置进行深入解析,并结合给定文件中的相关信息,探讨Gradle的基本概念、依赖管理和配置文件等内容。Gradle是一款功能强大的构建工具,它采用Groovy语言编写,适用于Java应用的...
除了基本的构建和测试,Gradle还有许多强大的特性: - **依赖管理**: Gradle的中央仓库包含了大量的库,可以通过简单的配置引入依赖。 - **插件系统**: Gradle的插件生态系统广泛,可以扩展其功能,如Android插件、...
1. 初始化项目:首先,使用Spring Initializr生成一个基本的SpringBoot项目结构,可以选择Gradle作为构建工具。 2. 配置build.gradle:这是Gradle项目的主配置文件,用于定义项目依赖、插件和其他构建规则。例如,...
Git 和 Gradle 入门学习笔记 Git 是一个分布式版本控制系统,Gradle 是一个基于 Apache Ant 和 Maven 的...本笔记涵盖了 Git 和 Gradle 的基本使用,包括安装、基本命令、项目编译、项目打包和常用命令等方面的内容。
1. Gradle基础概念:介绍Gradle的基本概念和工作原理,包括其构建脚本的组成、项目结构、任务(task)的概念及其依赖关系。此外,也会涉及Gradle的生命周期,即初始化、配置和执行三个阶段。 2. Android项目结构:...
1. **Gradle基础**:首先,书中会介绍Gradle的基本架构和工作原理,包括构建脚本、任务和插件系统。Gradle使用Groovy或Kotlin DSL编写构建脚本,这使得脚本具有高度的可读性和可扩展性。理解任务和依赖关系是掌握...