Showing posts with label maven. Show all posts
Showing posts with label maven. Show all posts

Jun 23, 2014

Strange maven-compiler-plugin Error when importing project

This problem cost me about 3 hours and finally I found a solution.

Let me describe the background. I have got a new laptop and want to set up a development environment: for eclipse I copied from my old machine and when I wanted to import a maven project, a strange problem happened:

Now it is fixed so the screenshot below looks good, but at that time, it was saying: maven-compiler-plugin 2.5.1 missing ...

I continue with the errors, but the project crashed no matter how I add dependencies.


I have tried to re-install eclipse, install maven, use different java version, use other versions of maven-compiler-plugin... None of them worked.

Here is the ultimate solution:
Delete the local repository settings by deleting the repository folder in .m2 (C:\Users\yourid\.m2\repository)


After restart eclipse and re-import the maven project, it is all solved.

Happy using new computer!

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

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.