3

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.

1
  • 1
    Please explain how you run your app. Commented Jul 15, 2012 at 14:10

1 Answer 1

2

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>
Sign up to request clarification or add additional context in comments.

1 Comment

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"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.