aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes maven war package corrupts jar import Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "maven war package corrupts jar import" Watch "maven war package corrupts jar import" New topic

maven war package corrupts jar import

Brian Babbage

Joined: Aug 24, 2011
Posts: 8
This is a crazy problem and I'm tearing my hair out over it...

My POM is building an applet.jar and placing it in a resource folder, then packaging the entire project into a war [including the folder with the applet.jar (and 2 other jars)].
The application will deploy (on jboss) but fails to run. The java console reports "can not find required MainApplet.class" [which is in the applet.jar].

If I manually copy the applet.jar into the war and deploy it the application functions normally. The applet.jar is an archive in the output folder but is not an archive in the war(7-zip reports).
Somehow the maven war packaging is corrupting this freshly built jar (and only this one jar).
Does anyone have any ideas why this is happening?!

jar assembly

war plugin

For all things there is a first time
Peter Johnson

Joined: May 14, 2008
Posts: 5779

I'd like to help you but there is an important administrative matter you need to deal with first. I'm sure you received some private messages about it.

JBoss In Action
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15665

Peter's not kidding. I've been ignoring your question for days because you're violating one of the very few rules that we're absolutely insistent about at the Ranch.

Customer surveys are for companies who didn't pay proper attention to begin with.
Brian Babbage

Joined: Aug 24, 2011
Posts: 8
note to self. when searching for "corrupt jar files" remember that a jar file is also a binary file. Maven has this covered but it's under corrupt binary file corruption...

the fix

I feel like such a bone head over this

Thanks for the help and advice guys.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: maven war package corrupts jar import
Similar Threads
jars in the custom ear not getting referenced at compile time
Sonar - Native Plugin
Error assembling WAR: webxml attribute is required
Using Own Directory Structure in Maven
Ear Building in Maven