天天看點

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

配置maven-dependency-plugin插件提示錯誤信:

[color=red]Description Resource Path Location Type

maven-dependency-plugin (goals "copy-dependencies", "unpack") is not supported by m2e. pom.xml /demo line 159 Maven Project Build Lifecycle Mapping Problem

[/color]

maven-dependency-plugin配置如下:

<plugin>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-jars</id>
						<phase>package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/lib</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
           

解決方案:

在pom.xml中加入如下配置即可

<pluginManagement>
			<plugins>
				<!-- Ignore/Execute plugin execution -->
				<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>[1.0.0,)</versionRange>
										<goals>
											<goal>copy-dependencies</goal>
											<goal>unpack</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
           

[url=http://coffeesweet.iteye.com/blog/1830317]解決maven-dependency-plugin (goals “copy-dependencies”, “unpack”) is not supported[/url]