Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import Maven Project to Eclipse and Fix the errors

I made imported a project to eclipse and I have a lot of errors in every class name even classes like String ...

the error in the classes I made is Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor

and inside the methods <Class> cannot be resolved to a type even to IOException I am getting IOException cannot be resolved to a type

so what should I do ? I tried to build , clean again with no use

UPDATE : also I am getting Description

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources (execution: default-resources, phase: process-resources)   pom.xml /test line 6    Maven Project Build Lifecycle Mapping Problem
like image 480
Peril Avatar asked Oct 03 '11 17:10

Peril


People also ask

How do I force a Maven project to update in Eclipse?

You can right-click on your project then Maven > Update Project..., then select Force Update of Snapshots/Releases checkbox then click OK.


1 Answers

The project that you imported is a Maven project. What you should do is open the pom.xml file located in the root of the project and add the following plugin in the plugin management part of the file:

<build>
    <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-resources-plugin</artifactId>
                                    <versionRange>[2.0,)</versionRange>
                                    <goals>
                                        <goal>resources</goal>
                                        <goal>testResources</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

Then right click the project, go to Maven and Update project configuration.

This should fix it.

like image 155
Sinisha Mihajlovski Avatar answered Oct 12 '22 13:10

Sinisha Mihajlovski