gpt4 book ai didi

java - 强制执行gradle的部署顺序

转载 作者:行者123 更新时间:2023-12-03 06:06:13 24 4
gpt4 key购买 nike

这是我的build.gradle文件

buildscript {
repositories {

maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.moowork.gradle:gradle-grunt-plugin:0.13'
classpath "gradle.plugin.com.github.scobal.eslint:gradle-eslint-plugin:1.0.1"

}
}
plugins{
id "com.moowork.grunt" version "0.13"
id "com.moowork.node" version "0.13"
}

// apply all plug-ins

apply plugin: 'com.moowork.grunt'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'war'
apply plugin: "com.github.scobal.eslint"


sourceCompatibility = 1.8
//version = '24.1.1.0'

war.doFirst{
deleteFiles()
grunt_build()
grunt_compile()
}
task deleteFiles(type: Delete){
delete fileTree("${System.properties['TOMCAT_HOME']}/webapps"){
include '**/*.war'
}
}

task deployToTomcat(type: Copy) {

from war.archivePath
into "${System.properties['TOMCAT_HOME']}/webapps"

}

deployToTomcat.doFirst{
war()
}
clean.doFirst{
deleteFiles
}

eslint {
inputs = ["./src/**/*.js"]
}

// exclude the files we don't want to deliver
// TODO - is there an easier way to exclude all directories under js??? We don't want any of them.
war {
exclude('src/js/main.js')
exclude('src/js/actions')
exclude('src/js/api')
exclude('src/js/components')
exclude('src/js/constants')
exclude('src/js/dispatcher')
exclude('src/js/stores')
}

jar {
manifest {
attributes 'Implementation-Title': 'Gradle Quickstart' //,
//'Implementation-Version': version
}
}

repositories {
mavenCentral()
}

dependencies {
compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
compile("org.springframework:spring-webmvc:4.0.3.RELEASE")
compile("com.fasterxml.jackson.core:jackson-core:2.7.4")
compile("com.fasterxml.jackson.core:jackson-annotations:2.7.4")
compile("com.fasterxml.jackson.core:jackson-databind:2.7.4")
compile("org.darkphoenixs:log4j:1.2.17")
compile files('libs/opla230.jar')

testCompile group: 'junit', name: 'junit', version: '4.+'
}

test {
systemProperties 'property': 'value'
}

uploadArchives {
repositories {
flatDir {
dirs 'repos'
}
}
}

发生的问题是deployToTomcat首先运行,并且在 Tomcat 上部署了旧的 war 。之后,war插件的war任务将运行并生成一个新的war,并且永远不会部署。有人可以帮助我执行这些操作的顺序吗?

最佳答案

您需要在deployToTomcat任务中添加“dependsOn war”。

关于java - 强制执行gradle的部署顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38729572/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com