Search code examples
eclipsemavenvaadin-spring-boot

Eclipse unaware of Maven Dependencies


I wanted to create a Vaadin Spring project. To this end I planned on following this tutorial:

http://vaadin.github.io/spring-tutorial/

However, already at the beginning the weirdest thing happened.

I used Spring Initializr to create the project:

enter image description here

Then I wanted to create a simple "Hello world"-UI. To this end, I created a class and wrote the following code (following the tutorial):

package com.example.app;

import com.vaadin.spring.annotation.SpringUI;

@SpringUI
public class MyUI extends UI {

}

The problem is: Eclipse is not giving me the option to import the UI class:

enter image description here

As you can see, Eclipse does not seem to know of any class that could be imported to get rid of the error message.

The crazy thing is that, if you look at the Maven-Dependencies folder within the project, everything is there! The following screenshot shows a part of all the Maven Dependencies:

enter image description here

Here are some more dependencies:

enter image description here

At first I thought Eclipse was broken .. so I deleted my installation and installed the newest version of Eclipse.

However, the problem is exactly the same as before.

I have no clue what the hell is going on here !!


Solution

  • Try doing maven update. Right click on your project in eclipse. Maven -> Update Project Click OK and rebuild the project. This should work.

    Edit : If it doesn't work after maven update then, If you are on windows do this. Go to Users->your user -> .m2 -> repository then delete com and org folders. Now do Maven update in eclipse and try. This should work