Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have added following dependency into maven's pom.xml file

<dependency>
    <groupId>postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>9.0-801.jdbc4</version>
</dependency>

But it has not found the driver for the postgres database ?

Please describe me where is the problem.

share|improve this question
1  
Please explain how you run your app. –  nico_ekito Jul 15 '12 at 14:10

1 Answer 1

It looks like your repo don't have the requested jar. If so, add a repo tag to the pom.xml pointing to the jboss or maven repo.

<project ...>
<repositories>
    <repository>
        <id>JBoss repository</id>
        <url>http://repository.jboss.org/nexus/content/groups/public/</url>
    </repository>
</repositories>
</project>

or

<project ...>
<repositories>
    <repository>
      <id>java.net</id>
      <url>http://download.java.net/maven/2</url>
    </repository>
 </repositories>
</project>
share|improve this answer
    
Thankyou for answering but I got it solved as I was executing the Main class using "java -cp jarfile classfile" but the solution is to execute it with maven itself using "mvn exec:java -Dexec.mainClass="com.mycompany.app.Main" –  toyeca Jul 16 '12 at 6:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.