在myeclipse中执行maven install的时候,默认下载maven-jar-plugin-2.4.jar的jar包(不能成功下载),但是本地仓库中已经有了maven-jar-plugin的jar包,但是版本是2.3.1,还有许多其他jar包都有这种版本不对应的情况
我知道这个可以在pom中配置插件版本,但我不能一个个去配置啊
额,之前更换了maven和jdk的版本,我想是不是哪里配置不对了?菜鸟求好心人搭救,感谢!
另外补充一点,maven从3.3.3到3.2.1,我直接copy3.3.3的setting到3.2.1目录下,maven的jar版本是和setting有关吗???
首先setting是可以的,
另外,版本的问题确实需要一个一个配置,你可以用property的方式去统一配置版本,
给你个参考:
统一定义版本:
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<testversion>1.7</testversion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
在引入的地方,使用如下:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${testversion}</version>
</dependency>
</dependencies>
properties块的顺序,记得按照下面这个来:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- The Basics -->
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>...</version>
<packaging>...</packaging>
<dependencies>...</dependencies>
<parent>...</parent>
<dependencyManagement>...</dependencyManagement>
<modules>...</modules>
<properties>...</properties>
<!-- Build Settings -->
<build>...</build>
<reporting>...</reporting>
<!-- More Project Information -->
<name>...</name>
<description>...</description>
<url>...</url>
<inceptionYear>...</inceptionYear>
<licenses>...</licenses>
<organization>...</organization>
<developers>...</developers>
<contributors>...</contributors>
<!-- Environment Settings -->
<issueManagement>...</issueManagement>
<ciManagement>...</ciManagement>
<mailingLists>...</mailingLists>
<scm>...</scm>
<prerequisites>...</prerequisites>
<repositories>...</repositories>
<pluginRepositories>...</pluginRepositories>
<distributionManagement>...</distributionManagement>
<profiles>...</profiles>
</project>