How to add “Maven Managed Dependencies” library in build path eclipse?

后端 未结 15 1611
心在旅途
心在旅途 2020-12-04 11:04

I have created a Maven project and I want to add all Maven dependencies in build path of the project in Eclipse. When I go to Java Bui

相关标签:
15条回答
  • 2020-12-04 11:34

    If you have m2e installed and the project already is a maven project but the maven dependencies are still missing, the easiest way that worked for me was

    • right click the project,
    • Maven,
    • Update Project...

    Eclipse screenshot

    0 讨论(0)
  • 2020-12-04 11:37

    Make sure your packaging strategy defined in your pom.xml is not "pom". It should be "jar" or anything else. Once you do that, update your project right clicking on it and go to Maven -> Update Project...

    0 讨论(0)
  • 2020-12-04 11:39

    from the command line type:

    mvn eclipse:eclipse
    

    this will add all the dependencies you have in your pom.xml into eclipse...

    however, if you haven't done any of this before you may need to do one other, one time only step.

    Close eclipse, then run the following command from the shell:

    mvn -Declipse.workspace=<eclipse workspace> eclipse:add-maven-repo
    

    sample:

    mvn -Declipse.workspace=/home/ft/workspaces/wksp1/ eclipse:add-maven-repo
    
    0 讨论(0)
  • 2020-12-04 11:39

    Try:Right Click your project->Maven->Disable Dependency Management. And re-enable dependency management.

    0 讨论(0)
  • 2020-12-04 11:39

    Follow these steps

    1) Go in projects class path

    2) Go in library tab

    3) click on Add Library

    4) In opened dialogue select Maven Managed Dependencies

    5) Click on Next

    6) In the new dialogue click on Manage Project Settings

    7) In opened dialogue select the check box Resolve dependencies from workspace

    8) Click on Restore defaults

    9) It will do some process and you will have all your dependencies in your library now.

    0 讨论(0)
  • 2020-12-04 11:44
    • Install M2E plugin.
    • Right click your project and select Configure -> Convert to Maven project.

    enter image description here

    • Then a pom.xml file will show up in your project. Double click the pom.xml, select Dependency tab to add the jars your project depends on.
    0 讨论(0)
提交回复
热议问题