File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ClassNotFoundException build through maven

 
archit thakur
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic