m2eclipse error

前端 未结 17 1106
忘掉有多难
忘掉有多难 2020-12-07 09:58

I am developing a web application with Eclipse and I generate the project with a maven archetype.

When I enable maven dependency management, Eclipse mark some errors

相关标签:
17条回答
  • 2020-12-07 10:27

    The following steps worked for me:

    1. Close Eclipse.
    2. Navigate to user home directory. (For example: "C:\Users\YourUserName.m2")
    3. Delete the "repository" folder.
    4. Re-open Eclipse.
    5. Click on the Maven project that has an issue and go to "Project" --> "Clean".
    6. Right-click on the project and go to "Maven" --> "Update Project...".
    7. Close Eclipse.
    8. Open Eclipse.
    9. Click on the project folder in the "Project Explorer" window (usually on the left).
    10. Hit the "F5" key a few times to Refresh your project.
    11. Done! These steps worked for me in Eclipse Luna. Please let me know if I can help further.
    0 讨论(0)
  • 2020-12-07 10:31

    I had same problem with Eclipse 3.7.2 (Indigo) and maven 3.0.4.

    In my case, the problem was caused by missing maven-resources-plugin-2.4.3.jar in {user.home}\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.4.3 folder. (no idea why maven didn't update it)

    Solution:

    1.) add dependency to pom.xml

    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.4.3</version>
    </dependency>
    

    2.) run mvn install from Eclipse or from command line

    3.) refresh the project in eclipse (F5)

    4.) run Maven > Update Project Configuration... on project (right click)

    JAR file is downloaded to local repository and there are no errors in WS.

    0 讨论(0)
  • 2020-12-07 10:31

    This what helped me:

    1. Delete the project from eclipse (but don't delete from disk)
    2. Close eclipse
    3. In your user folder there is .m folder. Delete repository folder underneath it (.m/repository).
    4. Open eclipse
    5. Import project as existing maven project (from disk).

    Good luck.

    0 讨论(0)
  • 2020-12-07 10:34

    It must be a configuration problem. Your pom is fine.

    Here's what I did. New folder, put your pom inside. Then in eclipse: import -> maven -> existing maven project. Dependencies got included in the project.

    I did this using eclipse helios. I think the plugin version I am using is 0.12

    You should check the maven properties in eclipse.

    0 讨论(0)
  • 2020-12-07 10:38

    My issue was that eclipse could not find the mvn.bat file within the installation directory. The solution is to create a mvn.bat file with the following code:

    "%~dp0\mvn.cmd" %*
    

    Save that file. Place it inside the [Maven Installation Folder]\bin directory.

    0 讨论(0)
提交回复
热议问题