Recently I face an strange issue while using Maven in Eclipse via M2Eclipse plugin. I have created a Maven Java project in Eclipse and subsequently tried to add Spring framework as dependency, to my surprise, nothing was happening. Eclipse was not able to search dependency in Maven central repository. I was surprised because I have never faced this issue while I was using M2Eclipse plugin from long time. After some trial and error, I realized that this is my brand new workspace and I am running with Eclipse Luna, newest version of Eclipse which I had just downloaded couple days of back. Maven Repository NexusWhen I want to update indices from the central Maven repository, I always get an error: java.lang.RuntimeException: java.io.IOException: Authorization exception. Arta de a.com unica. Every time I open my eclipse it takes forever to update the Maven repo indexes. Stopping Maven index update eclipse. Download repository index updates on startup. To browse Maven repositories and to manipulate repository indexes open the Maven Repositories view by selecting Windows, Show View, Other. As shown in Figure 6.7, “Opening a View in Eclipse”. My first hunch was that, and to verify that I tried connecting Eclipse market place, and boom it was working fine. Then I quickly checked Maven settings in Eclipse and found that the option which is required to download and build the index was not turned on. The check box was unchecked there. To give you some background about how Eclipse search dependency on Maven remote repository, be it default Maven central or internal Nexus repository. Eclipse search artifact dependency on repository's index file. If that file is not download or not exist due to any reason, Maven's dependency search will not work in Eclipse. That's why you need to check the option 'Download repository Index updates on startup'. If this option is enabled then Eclipse will download repository index from configured location e.g. Maven central or Nexus and every time Eclipse will start it will just do update. You should also check the option 'Do not automatically update dependencies from remote repositories', because that will download latest build every time they were pushed into Maven central repository. By the way, this error has nothing to do with Eclipse Luna. I received emails from my readers that some of them not able to add dependency in Maven project even in older versions of Eclipse e.g. Kepler and Indigo version. It is totally due to absent of artifact index file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2018
Categories |