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

2.0.1版本编译不通过 #719

Closed qiuxin closed 5 years ago

qiuxin commented 5 years ago

Please answer some questions before submitting your issue. Thanks!

Which version of XXL-JOB do you using?

2.0.1, 代码从https://github.com/xuxueli/xxl-job/releases 下载

Eclipse IDE for Java Developers版本如下: Version: 2018-12 (4.10.0) Build id: 20181214-0600

mvn -ver Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-25T02:41:47+08:00) Java version: 11.0.1, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home Default locale: en_CN, platform encoding: UTF-8 OS name: "mac os x", version: "10.13.6", arch: "x86_64", family: "mac"

Expected behavior

编译通过

Actual behavior

mvn编译失败

Steps to reproduce the behavior

在Eclipse上加载mvn工程编译,编译的过程如下: [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /usr/local/xxl-job-2.0.1/xxl-job-core/src/main/java/com/xxl/job/core/glue/impl/SpringGlueFactory.java:[11,24] package javax.annotation does not exist [ERROR] /usr/local/xxl-job-2.0.1/xxl-job-core/src/main/java/com/xxl/job/core/glue/impl/SpringGlueFactory.java:[45,54] cannot find symbol symbol: class Resource location: class com.xxl.job.core.glue.impl.SpringGlueFactory [ERROR] /usr/local/xxl-job-2.0.1/xxl-job-core/src/main/java/com/xxl/job/core/glue/impl/SpringGlueFactory.java:[47,21] cannot find symbol symbol: class Resource location: class com.xxl.job.core.glue.impl.SpringGlueFactory [ERROR] /usr/local/xxl-job-2.0.1/xxl-job-core/src/main/java/com/xxl/job/core/glue/impl/SpringGlueFactory.java:[47,78] cannot find symbol symbol: class Resource location: class com.xxl.job.core.glue.impl.SpringGlueFactory [INFO] 4 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] xxl-job 2.0.1 ...................................... SUCCESS [ 0.002 s] [INFO] xxl-job-core ....................................... FAILURE [ 1.182 s] [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] xxl-job-executor-sample-frameless 2.0.1 ............ SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.407 s [INFO] Finished at: 2019-01-12T10:33:22+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project xxl-job-core: Compilation failure: Compilation failure: [ERROR] /usr/local/xxl-job-2.0.1/xxl-job-core/src/main/java/com/xxl/job/core/glue/impl/SpringGlueFactory.java:[11,24] package javax.annotation does not exist [ERROR] /usr/local/xxl-job-2.0.1/xxl-job-core/src/main/java/com/xxl/job/core/glue/impl/SpringGlueFactory.java:[45,54] cannot find symbol [ERROR] symbol: class Resource [ERROR] location: class com.xxl.job.core.glue.impl.SpringGlueFactory [ERROR] /usr/local/xxl-job-2.0.1/xxl-job-core/src/main/java/com/xxl/job/core/glue/impl/SpringGlueFactory.java:[47,21] cannot find symbol [ERROR] symbol: class Resource [ERROR] location: class com.xxl.job.core.glue.impl.SpringGlueFactory [ERROR] /usr/local/xxl-job-2.0.1/xxl-job-core/src/main/java/com/xxl/job/core/glue/impl/SpringGlueFactory.java:[47,78] cannot find symbol [ERROR] symbol: class Resource [ERROR] location: class com.xxl.job.core.glue.impl.SpringGlueFactory [ERROR] -> [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/MojoFailureException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :xxl-job-core

Other information

qiuxin commented 5 years ago

做了2种尝试后,问题解决: 1)将JDK 11 降级为 JAva 1.8.0 $ java -version java version "1.8.0_191" Java(TM) SE Runtime Environment (build 1.8.0_191-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

2)放弃使用Eclipse里面的Maven编译,直接在文件目录(/usr/local/xxl-job-2.0.1)下执行sudo mvn clean install

估计后者是解决问题的原因

qiuxin commented 5 years ago

[INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for xxl-job 2.0.1: [INFO] [INFO] xxl-job ............................................ SUCCESS [ 20.865 s] [INFO] xxl-job-core ....................................... SUCCESS [01:28 min] [INFO] xxl-job-admin ...................................... SUCCESS [01:58 min] [INFO] xxl-job-executor-samples ........................... SUCCESS [ 0.005 s] [INFO] xxl-job-executor-sample-spring ..................... SUCCESS [ 18.324 s] [INFO] xxl-job-executor-sample-springboot ................. SUCCESS [ 0.335 s] [INFO] xxl-job-executor-sample-jfinal ..................... SUCCESS [ 8.935 s] [INFO] xxl-job-executor-sample-nutz ....................... SUCCESS [ 5.625 s] [INFO] xxl-job-executor-sample-frameless .................. SUCCESS [ 0.077 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 04:26 min [INFO] Finished at: 2019-01-13T08:53:50+08:00 [INFO] ------------------------------------------------------------------------