Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

m2e: copy-dependencies is not supported by m2e

Tags:

eclipse

maven

m2e

I get this error in my pom.xml, and I can't understand what I need to change in order to get eclipse to run the project (run as -> maven build)

<build>
    <plugins>
        <plugin>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                        <classpathPrefix>lib/</classpathPrefix>
                            <mainClass>com.cc.adapter.mock.InsertAccountStarter</mainClass>
                    </manifest>
                </archive>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
       <!-- Line below is the error -->
                <execution>
                    <phase>install</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.build.directory}/lib</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-codegen-plugin</artifactId>
            <version>${cxf.version}</version>
            <dependencies>
                <dependency>
                    <groupId>org.apache.cxf</groupId>
                    <artifactId>cxf-rt-bindings-soap</artifactId>
                    <version>${cxf.version}</version>
                </dependency>
            </dependencies>
            <executions>
                <execution>
                    <id>generate-sources</id>
                    <configuration>
                        <sourceRoot>src/main/generated</sourceRoot>

                        <wsdlOptions>
                            <wsdlOption>
                                <wsdl>src/main/wsdl/CrmService.wsdl</wsdl>
                                <autoNameResolution>true</autoNameResolution>
                                <extendedSoapHeaders>true</extendedSoapHeaders>
                            </wsdlOption>
                        </wsdlOptions>
                    </configuration>
                    <goals>
                        <goal>wsdl2java</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

The error when trying to build it from within eclipse is

[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean, post-clean. -> [Help 1]

I would really appreciate any help!

like image 660
Oskar Ferm Avatar asked Nov 25 '11 15:11

Oskar Ferm


2 Answers

This worked for me:

To resolve this error all you need to do is copy following code just before your closing tag of build.

       <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <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>unpack</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
like image 54
Kieveli Avatar answered Sep 20 '22 16:09

Kieveli


I have the same problem as yours

When you want to compile your Maven project using m2eclipse plugin, try

Run as -> Maven Build

then type compile in Goals

like image 37
ardhiesta Avatar answered Sep 22 '22 16:09

ardhiesta