I am setting up a project in eclipse . This projects builds successfully through command line(all mvn
commands like mvn package
, mvn compile
, mvn clean install
) work perfectly fine. While setting up this project on STS or Eclipse . I see some of the dependencies are not getting downloaded even though they are present in pom.xml
. However, searching them in the maven repository and downloading the jar to my local computer and then adding them to build path makes it work on Eclipse.
Is there anything that we need to do to eclipse to make sure it downloads all the dependencies from the repository.
My POM:
<dependency> <groupId>org.apache.bookkeeper</groupId> <artifactId>bookkeeper-server-compat410</artifactId> <version>4.1.0</version> <scope>test</scope> <exclusions> <exclusion> <groupId>org.apache.bookkeeper</groupId> <artifactId>bookkeeper-server</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.bookkeeper</groupId> <artifactId>bookkeeper-server-compat420</artifactId> <version>4.2.0</version> <scope>test</scope> <exclusions> <exclusion> <groupId>org.apache.bookkeeper</groupId> <artifactId>bookkeeper-server</artifactId> </exclusion> </exclusions> </dependency>
Both these artifacts were not downloaded for eclipse and there jars found http://mvnrepository.com/artifact/org.apache.bookkeeper/bookkeeper-server-compat410/4.1.0 and http://mvnrepository.com/artifact/org.apache.bookkeeper/bookkeeper-server-compat420/4.2.0 were not present in the folder for MavenDependencies and were subsequently giving errors in Eclipse.
However manually adding them to the build path created a new folder (Reference Library) and resolved the Eclipse Errors . Why did Eclipse not download and import these dependencies by themselves from the maven repository ?? Is it a bug in Eclipse or some problem from my side . Please help.
Maven uses HTTP to download its dependencies along with the dependencies of the Maven project (such as Camel). If you run Maven and it fails to download your required dependencies it's likely to be caused by your local firewall & HTTP proxy configurations.
Via the Maven index, you can search for dependencies, select them and add them to your pom file. To download the index, select Windows > Preferences > Maven and enable the Download repository index updates on startup option. After changing this setting, restart Eclipse. This triggers the download of the Maven index.
I got the same problem and this is how i solved. :
Solution 1:
Set correct proxy:
<proxy> <id>optional</id> <active>false</active> <protocol>http</protocol> <username></username> <password></password> <host>172.27.171.91</host> <port>8080</port> </proxy>
Solution2 :
just delete
lastupdated extension files from folder
and try updating maven.
[Most of the times this solution will work]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With