File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven - dependencies of external .jar package Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "Maven - dependencies of external .jar package" Watch "Maven - dependencies of external .jar package" New topic
Author

Maven - dependencies of external .jar package

Michal Borek
Greenhorn

Joined: Aug 29, 2010
Posts: 2
Hello,
I've got a problem with dependencies of jar imported to local repository.

1. I have somefile.jar, in this .jar package I have another .jar files (dependencies of this jar)
2. I installed somefile.jar in local repository and included it in another project.

When I run project which uses class from somefile.jar, I've got ClassNotFound exception on all dependencies of somefile.jar.

When I use somefile.jar directly (from command line) everything's fine.

It looks like Maven is not able to read dependencies from Manifest file of somefile.jar

Could you please help to fix it?

What should I do to make Maven read .jar's manifest and load dependencies of somefile.jar ?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12612
I would have assumed that you'd need to manage that jar's dependencies just like any other Maven artifact--with a pom. Not entirely sure what you're doing, though--if you're compiling, I'd be almost certain that Maven controlled the compilation classpath.
Michal Borek
Greenhorn

Joined: Aug 29, 2010
Posts: 2
David Newton wrote:I would have assumed that you'd need to manage that jar's dependencies just like any other Maven artifact--with a pom. Not entirely sure what you're doing, though--if you're compiling, I'd be almost certain that Maven controlled the compilation classpath.


I have a tool which is packaged as .jar . This tool has its own dependencies included in this jar but it's not managed by maven.

I want to use this tool in my project which is managed by Maven.
I installed manually this .jar file into my local repository and added a dependency to project I'm developing.

It looks like maven changed classpath of this jar. I don'w know how to make this jar work just like if I run it by command line.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12612
By creating a pom with the local jar's dependencies?
 
 
subject: Maven - dependencies of external .jar package
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com