cowtowncoder / java-uuid-generator

Java Uuid Generator (JUG) is a Java library for generating all standard UUID versions (v1 - v7)
Apache License 2.0
751 stars 103 forks source link

Generators class not found #17

Closed nagamanikandank closed 8 years ago

nagamanikandank commented 8 years ago

I used the following dependency in my project

<dependency>
            <groupId>com.fasterxml.uuid</groupId>
            <artifactId>java-uuid-generator</artifactId>
            <version>3.1.3</version>
</dependency>

After compiling the project , I could find the jar also in following location

.m2\repository\com\fasterxml\uuid\java-uuid-generator\3.1.3

But, When I try to use the command, I get "Generators cannot be resolved"

UUID uuiD= Generators.timeBasedGenerator().generate(); Am I missing Something?

cowtowncoder commented 8 years ago

@nagamanikandank So are you trying to use the jar as command-line tool or... ?

nagamanikandank commented 8 years ago

@cowtowncoder . I am trying to use in Web App

cowtowncoder commented 8 years ago

@nagamanikandank That does not help much. How does the thing fail? If it's in web app, what does "when I try to use the command" even mean in this context. Do you get an exception when code is run? If so, what does exception say?

nagamanikandank commented 8 years ago

@cowtowncoder , I am using a SpringBootApplication ( a basic app like in https://spring.io/guides/gs/spring-boot/ ). I added your project dependency in Maven and did mvn clean install. Your Jar got downloaded in .m2 folder. But, when I try to import com.fasterxml.uuid.* , my project is unable to find your jar, but your jar is available in my .m2 directory.

cowtowncoder commented 8 years ago

@nagamanikandank Unfortunately I don't know what could cause your problem: jar seems to have the classes, OSGi exports are defined (if you have osgi classloading). I am not aware of any issues that would cause problems described.

nagamanikandank commented 8 years ago

@cowtowncoder , I recreated the project and the problem got solved. Thanks