xuxueli / xxl-job

A distributed task scheduling framework.(分布式任务调度平台XXL-JOB)
http://www.xuxueli.com/xxl-job/
GNU General Public License v3.0
27.39k stars 10.84k forks source link

linux部署,使用maven打包失败 #285

Closed lilinghai closed 6 years ago

lilinghai commented 6 years ago

Please answer some questions before submitting your issue. Thanks!

Which version of XXL-JOB do you using?

1.9.0

Expected behavior

在centos7系统上使用maven打包

Actual behavior

mvn package

Steps to reproduce the behavior

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-cli) on project xxl-job: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]

Other information

[INFO] Building war: /a8root/lilh/workspace/dt/xxl-job/target/xxl-job-1.9.0.war [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] xxl-job ............................................ FAILURE [ 0.479 s] [INFO] xxl-job-core ....................................... SKIPPED [INFO] xxl-job-admin ...................................... SKIPPED [INFO] xxl-job-executor-samples ........................... SKIPPED [INFO] xxl-job-executor-sample-spring ..................... SKIPPED [INFO] xxl-job-executor-sample-springboot ................. SKIPPED [INFO] xxl-job-executor-sample-jfinal ..................... SKIPPED [INFO] xxl-job-executor-sample-nutz ....................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.852 s [INFO] Finished at: 2018-02-05T13:22:50+08:00 [INFO] Final Memory: 10M/303M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-cli) on project xxl-job: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

pengcao commented 6 years ago

我这边可以提供gradle(亲测可行) 【xxl-job-core】 group = 'xxl-job-core' version = "1.0"

apply plugin: 'java'

sourceCompatibility = 1.8

repositories { jcenter() }

dependencies { compile group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.0' compile group: 'javax.servlet.jsp', name: 'jsp-api', version: '2.2' compile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.6.v20170531' compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' compile group: 'com.caucho', name: 'hessian', version: '4.0.38' compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.0' compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.2' compile group: 'org.springframework', name: 'spring-context', version: '4.3.10.RELEASE' compile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.5.0-beta-1' compile group: 'org.apache.commons', name: 'commons-exec', version: '1.3' testCompile ( "junit:junit:4.12" ) }

pengcao commented 6 years ago

我这边可以提供gradle(亲测可行) 【xxl-job-admin.war】build.gradle

import org.apache.tools.ant.filters.ReplaceTokens

apply plugin: 'war' apply plugin: 'eclipse-wtp' apply plugin: 'idea' group = 'xxl-job-admin.war' version = "1.0"

// 构建脚本对SSH的依赖 buildscript { repositories { jcenter() } dependencies { classpath 'org.hidetake:gradle-ssh-plugin:2.3.0' } }

// 自定义属性 def appName = 'admin' def warName = appName + '.war' def indexUri = 'login/login.action'

// 引用打包工具中定义的属性 // 2017-12-11 //apply from: "../$deployProject/deploy.gradle" // webAppDirName = 'WebContent' sourceSets.main.java.srcDir 'src/main/java' sourceSets.main.resources.srcDir 'src/main/resources' eclipse.wtp.component.contextPath = "${appName}"

// 当前工程及所有子工程的依赖 allprojects {

apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
repositories {
    jcenter()
}
// 设置依赖外部第三方的jar
dependencies {
    // 定义一些依赖的第三方jar
    compile group: 'org.springframework', name: 'spring-webmvc', version: '4.3.13.RELEASE'
    compile group: 'org.springframework', name: 'spring-context-support', version: '4.3.13.RELEASE'
    compile group: 'org.springframework', name: 'spring-orm', version: '4.3.13.RELEASE'
    testCompile group: 'org.springframework', name: 'spring-test', version: '4.3.13.RELEASE'
    compile group: 'org.aspectj', name: 'aspectjweaver', version: '1.8.13'
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.0'
    compile group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.0'
    compile group: 'javax.servlet.jsp', name: 'jsp-api', version: '2.2'
    compile group: 'org.freemarker', name: 'freemarker', version: '2.3.23'
    testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25'
    compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.1'
    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.6'
    compile group: 'org.apache.commons', name: 'commons-email', version: '1.4'
    compile group: 'com.mchange', name: 'c3p0', version: '0.9.5.2'
    compile group: 'mysql', name: 'mysql-connector-java', version: '6.0.6'
    compile group: 'org.mybatis', name: 'mybatis-spring', version: '1.3.1'
    compile group: 'org.mybatis', name: 'mybatis', version: '3.4.4'
    compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.2'
    compile group: 'org.quartz-scheduler', name: 'quartz', version: '2.3.0'
    //
    compile group: 'commons-codec', name: 'commons-codec', version: '1.11'

    testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25'
    // compile group: 'javax.servlet', name: 'jstl', version: '1.2'
    // 测试
    testCompile(
            "junit:junit:4.12"
    )
}

}

configurations { //编译期排除commons模块:: all*.exclude group: 'org.apache.httpcomponents', module: 'httpclient' }

subprojects {

// 各子工程依赖的第三方类库
dependencies {
}

}

// 定义当前工程对其他工程的依赖 dependencies { // 定义依赖其他的工程 compile project(':xxl-job-core') }

processResources {

}

war { archiveName "${warName}" from(fileTree(dir: 'WebContent', exclude: 'script/config.js')) // 页面及资源文件,排除script/config.js }

// 定义各任务依赖关系 processResources.dependsOn clean //copyWar.dependsOn war

pengcao commented 6 years ago

我这边可以提供gradle(亲测可行) 【xxl-job-admin.war】 【settings.gradle】 includeFlat 'xxl-job-core'

xuxueli commented 6 years ago

你好,问题无法复现。可以加入文档中交流群进一步沟通。