Wednesday, March 29, 2017

How to deal with transitive maven dependencies?


my app uses a separate jar library, which in turn uses another jar file, e. g. a postgresql driver:

Maven project "mylib", pom.xml:


Maven project "myapp", pom.xml:


When I build mylib with mvn package install, the PostgreSQL jar file is not included or downloaded.
Also when I build myapp with mvn package, the PostgreSQL jar is not fetched.
So I end up with a missing jar file.

I think (and also strongly hope) that it's one of the strengths of Maven that I do not have to repeat the dependency in the myapp project?

Maybe this has something to do with the fact, that no class of the PostgreSQL jar file is referenced directly, and therefore not seen by the compiler. When the PostgreSQL driver is needed, it's loaded by a String:

Class.forName ("org.postgresql.Driver");

How can you include all dependent libraries in the final app package?


You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment