m2e는 maven-dependency-plugin ( "copy-dependencies", "unpack"목표)을 지원하지 않습니다
상당히 간단한 Maven 프로젝트가 있습니다.
<project>
<dependencies>
...
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/dependencies</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
그러나 m2eclipse에서 다음 오류가 발생합니다.
Description Resource Path Location Type
maven-dependency-plugin (goals "copy-dependencies", "unpack") is not supported by m2e. pom.xml /jasperreports-test line 60 Maven Project Build Lifecycle Mapping Problem
m2eclipse가이 작업을 "지원"하지 않는 이유는 무엇입니까? 메이븐은 그렇게하고, 그것이 제가 정말로 염려하는 전부입니다. 프로젝트에서이 오류를 어떻게 해결할 수 있습니까?
알려진 문제인 것 같습니다. 이를 무시하도록 m2e에 지시 할 수 있습니다.
옵션 1 : pom.xml
<build/>
태그 안에 다음을 추가하십시오 .
<pluginManagement>
<plugins>
<!-- Ignore/Execute plugin execution -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<!-- copy-dependency plugin -->
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>copy-dependencies</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins></pluginManagement>
이 후 프로젝트에서 Maven ...-> 프로젝트 구성 업데이트를 수행해야합니다.
더 읽기 : http://wiki.eclipse.org/M2E_plugin_execution_not_covered#m2e_maven_plugin_coverage_status
옵션 2 : 글로벌 이클립스 재정의
POM 파일 변경을 피하기 위해 Eclipse 설정을 통해 무시 무시를 전체 작업 공간에 적용 할 수 있습니다.
이 파일을 디스크 어딘가에 저장하십시오 : https://gist.github.com/maksimov/8906462
에서 Eclipse/Preferences/Maven/Lifecycle Mappings
확인을 클릭하고이 파일을 찾아보기 :
이것은 Eclipse M2E 플러그인 실행에 대한 M2E의 문제가 다루지 않습니다 .
이 문제를 해결하려면 인식하지 못하는 수명주기를 매핑하고 M2E가이를 실행하도록 지시하면됩니다.
이 안에을 추가해야 plugins
합니다 build
. 이것은 오류를 제거하고 M2E 가 POM 의 목표 copy-depencies
를 인식 maven-dependency-plugin
하고 POM이 예상대로 작동하게하여 Eclipse가 빌드 할 때마다 폴더에 종속성을 복사합니다. 오류를 무시하려면으로 변경 <execute />
하십시오 <ignore />
. 이전에 제안한 대로에 maven-dependency-plugin
넣을 필요가 없습니다 pluginManagement
.
<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>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
If copy-dependencies, unpack, pack, etc., are important for your project you shouldn't ignore it. You have to enclose your <plugins>
in <pluginManagement>
tested with Eclipse Indigo SR1, maven 2.2.1
To make it work, instead of ignoring it, you can install the m2e connector for the maven-dependency-plugin:
https://github.com/ianbrandt/m2e-maven-dependency-plugin
Here is how you would do it in Eclipse:
- go to Window/Preferences/Maven/Discovery/
- enter Catalog URL: http://download.eclipse.org/technology/m2e/discovery/directory-1.4.xml
- click Open Catalog
- choose the m2e-maven-dependency-plugin
- enjoy
Despite answer from CaioToOn above, I still had problems getting this to work initially.
After multiple attempts, finally got it working. Am pasting my final version here - hoping it will benefit somebody else.
<build>
<plugins>
<!--
Copy all Maven Dependencies (-MD) into libMD/ folder to use in classpath via shellscript
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/libMD</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<!--
Above maven-dependepcy-plugin gives a validation error in m2e.
To fix that, add the plugin management step below. Per: http://stackoverflow.com/a/12109018
-->
<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>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
I had the same problem when trying to load Hadoop project in eclipse. I tried the solutions above, and I believe it might have worked in Eclipse Kepler... not even sure anymore (tried too many things).
With all the problems I was having, I decided to move on to Eclipse Luna, and the solutions above did not work for me.
There was another post that recommended changing the ... tag to package. I started doing that, and it would "clear" the errors... However, I start to think that the changes would bite me later - I am not an expert on Maven.
Fortunately, I found out how to remove all the errors. Go to Window->Preferences->Maven-> Error/Warnings and change "Plugin execution not covered by lifecycle..." option to "Ignore". Hope it helps.
나는 이것이 오래된 게시물이라는 것을 알고 있지만 오늘도이 문제로 어려움을 겪었으며이 페이지의 템플릿을 사용했습니다 : http://maven.apache.org/plugins/maven-dependency-plugin/usage.html
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>[ groupId ]</groupId>
<artifactId>[ artifactId ]</artifactId>
<version>[ version ]</version>
<type>[ packaging ]</type>
<classifier> [classifier - optional] </classifier>
<overWrite>[ true or false ]</overWrite>
<outputDirectory>[ output directory ]</outputDirectory>
<destFileName>[ filename ]</destFileName>
</artifactItem>
</artifactItems>
<!-- other configurations here -->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
[...]
</project>
m2e
1.3.1 에서 모든 것이 잘 작동합니다 .
내가 사용하려고 할 때
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/dependencies</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
나는 또한 m2e
오류 가 발생했습니다.
다른 옵션은 문제 탭으로 이동하여 오류를 마우스 오른쪽 버튼으로 클릭하고 빠른 수정 적용을 클릭하는 것입니다. 무시 xml 코드를 생성하고 .pom 파일을 적용해야합니다.
'development' 카테고리의 다른 글
Visual Studio 2010에서 Ctrl + 스크롤 확대 / 축소를 비활성화하는 방법은 무엇입니까? (0) | 2020.06.07 |
---|---|
배열을 반복하여 인덱스와 값을 모두 인쇄 (0) | 2020.06.07 |
SQL Server의 LIMIT 10..20 (0) | 2020.06.07 |
클래스가 수퍼 클래스의 필수 멤버를 구현하지 않습니다 (0) | 2020.06.07 |
가용성을 위해 HTTP URL을 핑하는 기본 Java 방법 (0) | 2020.06.07 |