问题:maven-dependency-plugin (goals "copy-dependencies", "unpack") is not supported by m2e。
错误:Eclipse自带的m2e插件报出来的错误,原因是maven-dependency-plugin配置缺少pluginManagement的配置。
解决:pom.xml中添加pluginManagement的配置,代码如下
<build>
<finalName>CarOwner</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-source</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>