今天使用maven的时候,遇到两个问题,第一个的错误如下:
Downloading: https://maven-repository.dev.java.net/nonav/repository/javax.jms/poms/jms-1.1.pom
347b downloaded (jms-1.1.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'c8f2a9fb3984c36fc4f4b6a53383b40b52cfec2c'; remote = '<!DOCTYPE' - RETRYING
Downloading: https://maven-repository.dev.java.net/nonav/repository/javax.jms/poms/jms-1.1.pom
347b downloaded (jms-1.1.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'c8f2a9fb3984c36fc4f4b6a53383b40b52cfec2c'; remote = '<!DOCTYPE' - IGNORING
[WARNING] POM for 'javax.jms:jms:pom:1.1:compile' is invalid.
Its dependencies (if any) will NOT be available to the current build.
Downloading: https://maven-repository.dev.java.net/nonav/repository/com.sun.jdmk/poms/jmxtools-1.2.1.pom
357b downloaded (jmxtools-1.2.1.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'b662aa01d49d8a571aa79f67a1d4a92a7d9c6359'; remote = '<!DOCTYPE' - RETRYING
Downloading: https://maven-repository.dev.java.net/nonav/repository/com.sun.jdmk/poms/jmxtools-1.2.1.pom
357b downloaded (jmxtools-1.2.1.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'b662aa01d49d8a571aa79f67a1d4a92a7d9c6359'; remote = '<!DOCTYPE' - IGNORING
[WARNING] POM for 'com.sun.jdmk:jmxtools:pom:1.2.1:compile' is invalid.
Its dependencies (if any) will NOT be available to the current build.
Downloading: https://maven-repository.dev.java.net/nonav/repository/com.sun.jmx/poms/jmxri-1.2.1.pom
353b downloaded (jmxri-1.2.1.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'de02d09af9d9fd6ebe64712281899f4765ff4bd7'; remote = '<!DOCTYPE' - RETRYING
Downloading: https://maven-repository.dev.java.net/nonav/repository/com.sun.jmx/poms/jmxri-1.2.1.pom
353b downloaded (jmxri-1.2.1.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'de02d09af9d9fd6ebe64712281899f4765ff4bd7'; remote = '<!DOCTYPE' - IGNORING
[WARNING] POM for 'com.sun.jmx:jmxri:pom:1.2.1:compile' is invalid.
Its dependencies (if any) will NOT be available to the current build.
Downloading: https://maven-repository.dev.java.net/nonav/repository/javax.jms/jars/jms-1.1.jar
Downloading: https://maven-repository.dev.java.net/nonav/repository/com.sun.jdmk/jars/jmxtools-1.2.1.jar
Downloading: https://maven-repository.dev.java.net/nonav/repository/com.sun.jmx/jars/jmxri-1.2.1.jar
347b downloaded (jms-1.1.jar)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'd0b7ce08d257e8fefdc6ad0f0f0368635bbeb3d0'; remote = '<!DOCTYPE' - RETRYING
Downloading: https://maven-repository.dev.java.net/nonav/repository/javax.jms/jars/jms-1.1.jar
357b downloaded (jmxtools-1.2.1.jar)
347b downloaded (jms-1.1.jar)
353b downloaded (jmxri-1.2.1.jar)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '9e1dae7682d2b60d5b17b7d47e20d99d70ba65cf'; remote = '<!DOCTYPE' - RETRYING
Downloading: https://maven-repository.dev.java.net/nonav/repository/com.sun.jdmk/jars/jmxtools-1.2.1.jar
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'd0b7ce08d257e8fefdc6ad0f0f0368635bbeb3d0'; remote = '<!DOCTYPE' - IGNORING
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'a55ce8e95c9bb027e78557acc9e2b973fe3c611e'; remote = '<!DOCTYPE' - RETRYING
Downloading: https://maven-repository.dev.java.net/nonav/repository/com.sun.jmx/jars/jmxri-1.2.1.jar
357b downloaded (jmxtools-1.2.1.jar)
353b downloaded (jmxri-1.2.1.jar)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '9e1dae7682d2b60d5b17b7d47e20d99d70ba65cf'; remote = '<!DOCTYPE' - IGNORING
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = 'a55ce8e95c9bb027e78557acc9e2b973fe3c611e'; remote = '<!DOCTYPE' - IGNORING
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 4 source files to /home/eric/workspace/Whale/target/classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
error: error reading /home/eric/.m2/repository/javax/jms/jms/1.1/jms-1.1.jar; error in opening zip file
error: error reading /home/eric/.m2/repository/com/sun/jdmk/jmxtools/1.2.1/jmxtools-1.2.1.jar; error in opening zip file
error: error reading /home/eric/.m2/repository/com/sun/jmx/jmxri/1.2.1/jmxri-1.2.1.jar; error in opening zip file
进入本地repository中,这三个包也打不开。 远程请教了以前的牛人同事,他说校验错误,说明这个这三个文件出问题了。可以把这三个包下回来install到本地repository中去。后来在下载这三个包的时候,从网上发现有人也遇到了同样得问题。问题的原因是:log4j1.2.15依赖jms-1.1.jar,jmxtools-1.2.1.jar和jmxri-1.2.1.jar这三个包 。
解决方法1.更换log4j的版本,据说只有1.2.15依赖这三个包,我更换成了1.2.16,没有问题。
解决方法2.在配置pom的时候把这三个包exclude掉。(未验证)
第二个问题比较菜鸟。
generics are not supported in -source 1.3
annotations are not supported in -source 1.3
牛人同事告诉我:配置compile plugin为1.6。后来在官网上找到了下面得配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>