2
votes

I'm using the Spring Boot framework and Maven to develop an application in Eclipse IDE Mars. It was fine for a while and just happened today that some classes cannot be resolved by Eclipse. The project still builds and works as expected but it is just quite annoying to see all the "errors" everywhere that aren't any.

And yes, I've tried updating the project and restarted my IDE ;-)

I'd be happy about any advice.

Edit: Sorry, I know it's not really detailed, but it happens on every other class that I import from another project (no official import or anything). This dependency is set in the pom file with correct groupID, artefactID and version. I'm using Java 1.8. Here's an extract of my pom.xml:

...
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.2.6.RELEASE</version>
    <relativePath/> 
</parent>

 <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>com.groupid</groupId>
        <artifactId>utilities</artifactId>
        <version>0.0.2-SNAPSHOT</version>
    </dependency> 
...

I get the same problem when I checkout another project and add the dependency in the pom. Update meant right clicking in Eclipse on the project, select Maven and select "Update project". I've tried Maven clean install as well. As I said, the project builds fine and everything is working as desired. It just keeps displaying the errors. Or is that an Eclipse bug?

1
As it stand, this question is impossible to answer. "Somes classes cannot be resolved" is just a too broad statement. Please add some details (which classes, what your POM is, Java version...) so that we can help.Tunaki
update = refresh / clean ? Did you create a new workspace ?Marged
If your app depends on any other your artifacts (I see com.groupid.utilities above), make sure you do the usual Refresh / Clean / Update Project / mvn clean install on that one as well.Jiri Tousek
@Jiri Tousek: that fixed it indeed. Thanks!Lyn

1 Answers

2
votes

As @Jiri Tousek said, you have to update (Maven Project Update or Maven clean install) all your projects that have dependencies to your own project.

It's just a pity that Eclipse isn't doing it or indicates the correct error...