-1

I just started working with maven and I am really new to this concept. I am using m2Eclipse plugin to work in maven. I use dependency to include the quartz library.

    <dependency>
        <groupId>org.quartz-scheduler</groupId>
        <artifactId>quartz</artifactId>
    <version>2.0.2</version> 
</dependency>

and inside the guest/.m2/repository I can see the the corresponding library files. But in code I cant import the quartz library. Its showing errors.

I can see that the maven repository is included in class path.

What is the reaon for this? Also when I use Debug As > Maven Install

Its shows some log and in the end it says build successful

Whats Happening?

Error : import org.quartz cannot be resolved

Thanks

Zach
  • 9,989
  • 19
  • 70
  • 107
  • What is the specific error you are getting? – Beau Grantham Dec 03 '11 at 21:07
  • 1
    To narrow down the problem, look at what the "Maven Dependencies" classpath container contains. Is the quartz library there? Does it contain the class you are trying to import? – meriton Dec 03 '11 at 21:08
  • @BeauGrantham edited with error details – Zach Dec 03 '11 at 21:10
  • @meriton its not just quartz I am also using another library called slf4j its also showing the same – Zach Dec 03 '11 at 21:12
  • That doesn't answer my questions, does it? – meriton Dec 03 '11 at 21:15
  • Maybe try Maven -> enable depedency management from the context menu if it's not enabled already – DPM Dec 03 '11 at 21:15
  • 1
    @Zach Just a hunch, but sometimes if you have an error in your POM XML's syntax, imports aren't resolved properly until you fix it. Also try to update your dependencies: right click on the project, Maven, update project configuration. My last advice is that you should probably check out the [Maven documentation](http://maven.apache.org) and start with CLI instead of m2eclipse to get a good understanding on _what's going on_. – Kohányi Róbert Dec 03 '11 at 21:16
  • @meriton yes the librarie are there quartz library is inside Repository>org>quartz-scheduler>quartz> – Zach Dec 03 '11 at 21:21
  • @KohányiRóbert thanks a lot. It worked when I udated project configuration :) – Zach Dec 03 '11 at 21:26
  • can you run `mvn help:effective-pom` and share all of the output? – melihcelik Dec 03 '11 at 21:34

1 Answers1

1

Just a hunch, but sometimes if you have an error in your pom.xml's syntax, imports aren't resolved properly until you fix it.

Also try to update your dependencies: right click on the project, Maven, update project configuration.

My last advice is that you should probably check out the Maven documentation and start with CLI instead of m2eclipse to get a good understanding on what's going on.

(I've extracted my comment as answer—if that's okay—so that the OP could accept it as answer, maintaining a good accept rate, creating a win-win situation! :)

Kohányi Róbert
  • 9,791
  • 4
  • 52
  • 81