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 ClassNotFoundException build through maven Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ClassNotFoundException build through maven" Watch "ClassNotFoundException build through maven" New topic
Author

ClassNotFoundException build through maven

archit thakur
Greenhorn

Joined: Jul 10, 2010
Posts: 24
I am using maven to build my project. I wanted to create assembly jar including some of the dependencies, so I wrote my custom assembly descriptor.
POM.XML


DESCRIPTOR:


The problem is, It is creating jar having classes at directory structure like "Exporter-atlas2.1/<package name>/<class name>". For example, "Exporter-atlas2.1/ch/qos/logback/classic/util/EnvUtil.class". Thats why, it throws, ClassNotFoundException at the runtime. I was expecting classes to be present at "/<package name>/<class name>/",For eg. "ch/qos/logback/classic/util/EnvUtil.class".
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5850
    
    7

You need to add "<appendAssemblyId>false</appendAssemblyId>" to the assembly plugin configuration. The description of that is very poorly worded, but setting it to false should do the trick.


JBoss In Action
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ClassNotFoundException build through maven