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>