Erwin
Erwin

Reputation: 1772

Can't use dropwizard-core classes

I am using m2e plugin with Eclipse. I have created a Maven project and added the dropwizard-core dependency in the POM as stated in http://dropwizard.codahale.com/getting-started/.

However, I can't export specific dropwizard-core classes. For example, when I

import com.yammer.dropwizard.config.Configuration;

I get an error that the class cannot be resolved. However, just plain

import com.yammer.dropwizard.config.*;

works.

Additionally, when I try to inspect the dropwizard-core jar inside the "Maven dependencies", I can see the "Configuration" class there. I just can't extend it even when importing the above-mentioned package. And this unresolvable class happens for all the other classes that are inside the jar. Is there any step that I missed?

By the way, I'm using the following: 1. ADT (but I was able to replicate the issue using the standard Eclipse) 2. Java SDK 7 and JRE 7 3. Mac

Upvotes: 2

Views: 4151

Answers (2)

David Urry
David Urry

Reputation: 825

The answer is more likely that you need to add the dependency to your pom.xml file:

<dependency>
    <groupId>io.dropwizard</groupId>
    <artifactId>dropwizard-hibernate</artifactId>
    <version>${dropwizard.version}</version>
</dependency>

Upvotes: 3

Erwin
Erwin

Reputation: 1772

It turned out that the jar files in ~/.m2/repository have been corrupted. This issue has been solved by deleting everything in the repository and do a:

mvn clean install

All the classes can be resolved now.

Upvotes: 2

Related Questions