简体   繁体   中英

How to find and missing artifacts in a maven project using eclipse as editor?

I am working on a Maven project and I am using eclipse as an editor. I clone a project from GIT and then create a git repository in eclipse , import it and then create a maven project. After i finished the project of setup i got a lot of errors and this is due to pom.xml file and I am missing about 300 artifacts.I know want to know how can i find and add those artifacts in my project. I have seen different answers for that and one of the answers is to upload maven project. I did it but still not working , I am still missing the artifacts.

I really need some help here since i want to start working on this project as soon as possible.

Maven pulls all the dependencies either from maven repository or from local repository automatically (typically C:/Users/user1/.m2 on windows). if there are lot of dependencies, eclipse takes a while to download them all.

check if you see building workspace at the right bottom corner of eclipse. you can press Alt+F5 to refresh the project and then try command mvn clean install from your root folder (where your pom.xml is placed)

Sometimes, jars are not available on maven repository such as sqljdbc. in that case you will have to manually install them to your local repo using below command if you have the .jar file

mvn install:install-file -Dfile=<path-to-file>/stax-1.0.jar         
-DgroupId=stax -DartifactId=stax -Dversion=1.0 -Dpackaging=jar

or a quick and dirty approach would be copy the .m2/repository folder from previous machine if project was working good on that machine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM