近日由于开始接触另一个项目A, 项目A在STS上基于maven搭建, 寤不想用STS, 遂将项目导入eclipse, 然后报以下错误:
maven-dependency-plugin (goals "copy-dependencies", "unpack") is not supported by m2e.
故障排查过程:
1、eclipse已经安装maven插件, 且之前项目无问题
2、遂怀疑, maven插件可能缺失, 但由于之前项目同样用到此功能, 所以排除
3、遂在怀疑插件板本问题, 事实正确, 寤eclipse所装m2e插件来自:http://download.eclipse.org/technology/m2e/releases/, 此版本来自maven社区, 过旧,
解决方案:
1.换装官网版本:http://m2eclipse.sonatype.org/sites/m2e
2.在pom文件的<
plugins>标签之前添加如下<
pluginManagement>标签,此2个标签平级.如下:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[2.0,)</versionRange>
<goals>
<goal>copy-dependencies</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<excludeTransitive>false</excludeTransitive>
<stripVersion>true</stripVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins></build>
分享到:
相关推荐
maven-dependency-plugin-2.8.jar
本文将聚焦于"Maven依赖插件"(maven-dependency-plugin)的版本2.8及其在开源项目中的应用,特别是结合Cobertura插件进行代码覆盖率检查。 Maven依赖插件(maven-dependency-plugin)是Maven生态系统中的一个重要...
maven-dependency-plugin-2.1.jar
maven-dependency-versions-check-plugin-2.0.2-sources.jar
本项目是基于Java的smart-doc-maven-plugin官方maven插件设计源码,包含43个文件,其中包括27个Java源文件、7个Markdown文档、2个JSON文件、1个gitignore文件、1个LICENSE...-documentation文件和1个licenses/LICENSE...
maven-dependencygraph-plugin-0.0.4.jar
maven-dependencygraph-plugin-0.0.3.jar
maven-dependencygraph-plugin-0.0.2.jar
maven-dependencygraph-plugin-0.0.1.jar
maven-dependencygraph-plugin-0.0.4-sources.jar
maven-dependencygraph-plugin-0.0.3-sources.jar
maven-dependencygraph-plugin-0.0.2-sources.jar
maven-dependencygraph-plugin-0.0.1-sources.jar
maven-dependency-plugin-2.1.jar maven-dependency-tree-1.0.jar maven-deploy-plugin-2.7.jar maven-deploy-plugin-2.8.1.jar maven-eclipse-plugin-2.9.jar maven-embedder-3.2.1-sources.jar maven-filtering-...
maven-dependency-plugin-2.0.jar
maven-dependency-versions-check-plugin-1.0.0.jar
标题提到的问题表明,可能在尝试使用maven-dependency-plugin的特定目标时遇到了不支持的情况。"copy-dependencies"目标通常用于将项目的所有依赖复制到指定的目录,这在创建可执行jar或者需要独立于Maven仓库运行...
maven-dependency-versions-check-plugin-2.0.1-sources.jar
maven-dependency-versions-check-plugin-2.0.0-sources.jar
Maven 插件 Spring Boot Maven Plugin Spring Boot Maven Plugin 是一个 Maven 插件,用于简化 Spring Boot 项目的构建和打包过程。该插件提供了许多有用的功能,例如重新打包可执行的存档、自定义层配置、继承 ...