当前位置: 代码迷 >> Eclipse >> eclipse plugin(三)maven-dependency-plugin
  详细解决方案

eclipse plugin(三)maven-dependency-plugin

热度:912   发布时间:2016-04-23 02:08:45.0
eclipse plugin(3)maven-dependency-plugin
eclipse plugin(3)maven-dependency-plugin

Recently, I import one maven project from my collegues. I got this error message when I import this in my eclipse:
error message:
maven-dependency-plugin(goals "copy-dependencies", "unpack") is not supported by m2e.

solution:
...snip...
<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-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>unpack</id>
<phase>compile</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.digby.graphite</groupId>
<artifactId>store-shared</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/${project.artifactId}</outputDirectory>
<destFileName>optional-new-name.jar</destFileName>
<includes>**/*.js,**/*.xml</includes>
<excludes>**/*test.class</excludes>
</artifactItem>
</artifactItems>
<includes>**/*.java</includes>
<excludes>**/*.properties</excludes>
<outputDirectory>${project.build.directory}/wars</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<stripVersion>true</stripVersion> 
<excludeTransitive>false</excludeTransitive> 
</configuration>
</execution>
</executions>
</plugin>
</plugins>
...snip...

It works fine now.

references:
http://jeekchen.iteye.com/blog/1153103
http://blog.csdn.net/smst1987/article/details/6871495
  相关解决方案