maven使用時出現了不少錯誤,記錄一下。apache
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-jar-plugin:2.4 or one of its dependencies could not be resolved: Failure to transfer org.apache.maven.plugins:maven-jar-plugin:jar:2.4 from http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced. Original error....
上面這類錯誤是由於本地庫下載的相關文件出錯了(因此只能從新下載)。
解決辦法:eclipse
在pom.xml中添加依賴時,添加失敗,找不到相應的jar。
解決方法:把本地庫相應文件刪掉,從新在pom.xml中添加依賴(一次不行就試多幾回)。maven
在maven安裝目錄下,修改setting文件的jdk默認版本配置信息(在profiles中添加),可是沒有效果.
解決方法:放在profile標籤裏面,修改爲功。ui
<!-- 沒有添加profile標籤,配置失效 --> <profile> <!-- 修改默認jdk版本 --> <id>jdk-1.8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> </properties> </profile>