Maven: Command to update repository after adding dependency to POM

后端 未结 5 688
生来不讨喜
生来不讨喜 2020-11-28 00:41

I\'ve added a new dependency to my POM.

Is there a simple command I can run to download this dependency to my repository?

5条回答
  •  独厮守ぢ
    2020-11-28 00:53

    I know it is an old question now, but for users who are using Maven plugin with Eclipse under Windows, you have two options:

    1. If you got Maven installed as a standalone application:

      You can use the following command in the CMD under your project path:

      mvn eclipse:eclipse
      

      It will update your repository with all the missing jars, according to your dependencies in your pom.xml file.

    2. If you haven't got Maven installed as a standalone application you can follow these steps on your eclipse:

      Right click on the project ->Run As -- >Run configurations.

      Then select mavenBuild.

      Then click new button to create a configuration of the selected type .Click on Browse workspace then select your project and in goals specify eclipse:eclipse

    You can refer to how to run the command mvn eclipse:eclipse for further details.

提交回复
热议问题