jQuery in Action, 3rd edition
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

ClassNotFoundException build through maven

archit thakur

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.


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

Joined: May 14, 2008
Posts: 5852

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
I agree. Here's the link: http://aspose.com/file-tools
subject: ClassNotFoundException build through maven
It's not a secret anymore!