Feb 28, 2014

Interesting Maven - Repository setting

Today I met a maven problem that adding dependency always return a

The senario is like this:
I want to add a package called storm-kafka, and I can find one in the list

But after I clicked OK, I saw the progress bar was refreshing but very quickly it popped up an error dialog:

But interestingly another project which I download from github and was using the same library looks OK, as you can see below.

You see with the same library entry in pom.xml, this one is successful but my previous one  is not.

I spent much time on this and tried many ways like proxy setting, install an individual maven rather than using the one embedded in eclipse. But none of it works. Finally with a different eye's help, the problem was found:

in the project which successfully imported the library, in the pom.xml it has a setting like below:


Adding this in the first project's pom.xml makes it happy too.
 demo Maven Webapp
  
 http://maven.apache.org
  
   
   
    clojars.org
    http://clojars.org/repo
   
  
  
  
    
......


So this let us me learn that maven repository repository setting is an important part that you need to look at when adding dependency has some problems.

If you find this blog is useful, please kindly click the ads on this page to help. Thank you very much.