What should I do with the pom.xml file?

I just downloaded a project from github, it has pom.xml and it lacks a lot of dependencies.

I installed the m2e Maven integration in Eclipse plugin , but now what should I do? It is installed and seems to work, but how do I download dependencies now?

+4
source share
6 answers

Right click on your project, run it as -> maven install.

If you do not see them, you either installed m2e incorrectly, or you need to import the project as a maven project.

In this case, delete the project from the workspace ( do not check "delete contents on disk"). Right-click in the project explorer and click on import ... In this dialog box, you can select existing maven projects where you need to go to the highest directory containing the pom.xml file.

Alternatively, if maven is installed on your computer (and not m2e in eclipse), you can open the directory containing pom.xml and simply type mvn clean install . This will create your project. If you get the message "Build Success", you will find out that the dependencies are received correctly.

+3
source
  • You are checking git files in a different place than the Eclipse workspace.
  • Run Eclipse on a clean workspace and install m2e. (I usually install m2e-wtp to get web projects)
  • Use File -> Import -> Existing Maven Projects.
  • Point to the pom.xml that you want to use in the files mentioned above.
  • Wait for Eclipse to download half of the Internet.
  • Ready.
+5
source

In eclipse, you must convert your project to a maven project. right click on your project -> maven (or configure) -> convert to maven project (or enable dependency management).

This should automatically update your dependencies, if it is not, then right-click the project project → maven-> update (or update the dependencies, it depends on the version of m2e that you are using).

+2
source

This should be enough to create a project. Dependencies must be loaded at build time.

0
source

Pom.xml files are used for Maven projects.

Depending on your version of Eclipse, it may not be compatible with Maven out of the box. If not, you can install the Maven plugin (e.g. m2e ) so that the project can be viewed as a Maven project.

Maven will do dependency management (if the pom.xml file is configured correctly)

0
source

When you right-click on your project-> Run As-> Maven, it will load all the dependencies that it does not already have in your local repository.

0
source

Source: https://habr.com/ru/post/1494973/


All Articles