`
shihuan830619
  • 浏览: 582135 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

maven-dependency-plugin (goals "copy-dependencies", "unpack") is not supported b

阅读更多
maven-dependency-plugin (goals "copy-dependencies", "unpack") is not supported by m2e.

以上错误是MyEclipse2014自带的m2e插件报出来的错误,原因是maven-dependency-plugin配置缺少pluginManagement的配置,代码配置如下:
<properties>
		<project.build.directory>.</project.build.directory>
	</properties>

	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
				<excludes>
					<exclude>**/*.*</exclude>
				</excludes>
			</resource>
		</resources>




		<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>  
                                            <goal>unpack</goal>  
                                        </goals>  
                                    </pluginExecutionFilter>  
                                    <action>  
                                        <ignore />  
                                    </action>  
                                </pluginExecution>  
                            </pluginExecutions>  
                        </lifecycleMappingMetadata>  
                    </configuration>  
                </plugin>  
            </plugins>  
        </pluginManagement>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.4</version>
			</plugin>
			<!-- 解决资源文件的编码问题 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.6</version>
				<configuration>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<!-- 拷贝依赖的jar包到lib目录 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy</id>
						<phase>package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>
								${project.build.directory}/lib
							</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
			
		</plugins>

	</build>


上述错误在m2eclipse插件中是没有的,在m2eclipse插件中编译好的项目移植到m2e中就出了这个问题。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics