File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 5772

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
subject: ClassNotFoundException build through maven
Similar Threads
Maven dependencies
Continuous integration - Bamboo, Maven
maven descriptor for any IDE
how do i send a email test report from maven
Maven web project dependencies