1、maven package 打包失败,报错一些包不存在。
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ selenium ---
[INFO] Deleting D:\Program Files (x86)\java\eclipse\workspace\webauto\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.247 s
[INFO] Finished at: 2017-03-29T13:41:24+08:00
[INFO] Final Memory: 8M/309M
[INFO] ------------------------------------------------------------------------
[WARNING]
[WARNING] Some problems were encountered while building the effective settings
[WARNING] Unrecognised tag: 'id' (position: START_TAG seen ...<profiles>\r\n <i
d>... @194:7) @ D:\Program Files (x86)\java\apache-maven\bin\..\conf\settings.x
ml, line 194, column 7
[WARNING]
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for
com.nd.qa:selenium:jar:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be
unique: com.alibaba:fastjson:jar -> version 1.2.15 vs 1.1.37 @ line 74, column
15
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be
unique: org.apache.httpcomponents:httpclient:jar -> version 4.5.2 vs 4.3.4 @ li
ne 100, column 15
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be
unique: log4j:log4j:jar -> version 1.2.12 vs 1.2.17 @ line 127, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten t
he stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support buildin
g such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building selenium 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact jexcelapi:jxl:jar:2.6 has been relocated to net.sourcefor
ge.jexcelapi:jxl:jar:2.6
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ selenium -
--
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Program Files (x86)\java\eclipse\w
orkspace\webauto\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ selenium ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 50 source files to D:\Program Files (x86)\java\eclipse\workspac
e\webauto\target\classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] /D:/Program Files (x86)/java/eclipse/workspace/webauto/src/main/java/c
om/nd/qa/selenium/jenkins/PreemptiveAuth.java: 某些输入文件使用或覆盖了已过时的
API。
[ERROR] /D:/Program Files (x86)/java/eclipse/workspace/webauto/src/main/java/co
/nd/qa/selenium/Eye_Compatibility.java:[12,23] 程序包junit.framework不存在
[ERROR] /D:/Program Files (x86)/java/eclipse/workspace/webauto/src/main/java/co
/nd/qa/selenium/Eye_Compatibility.java:[14,40] 找不到符号
符号: 类 TestCase
[ERROR] /D:/Program Files (x86)/java/eclipse/workspace/webauto/src/main/java/co
/nd/qa/selenium/Nose_Compatibility.java:[12,23] 程序包junit.framework不存在
[ERROR] /D:/Program Files (x86)/java/eclipse/workspace/webauto/src/main/java/co
/nd/qa/selenium/Nose_Compatibility.java:[14,41] 找不到符号
符号: 类 TestCase
[ERROR] /D:/Program Files (x86)/java/eclipse/workspace/webauto/src/main/java/co
/nd/qa/selenium/Mouth_Compatibility.java:[12,23] 程序包junit.framework不存在
[ERROR] /D:/Program Files (x86)/java/eclipse/workspace/webauto/src/main/java/co
/nd/qa/selenium/Mouth_Compatibility.java:[14,42] 找不到符号
2、但是如果先使用eclipse clean之后, 在打包却可以成功。
结果原因: pom文件中,该包的<scope>test</scope>错误,修改或去掉即可