Intellij Maven build Glassfish exploded ear deployment and war/ejb folder naming


I am having an annoying issue with the deployment of my ear web application into glassfish with IDEA.  I have a Maven project that builds a ear out of a war and ejb.  Things are working very well and I am happy with the setup except for one issue.  When I refresh/reimport the maven project it names the exploded version of the ear as follows:

     blah.war/ <-- folder
     blah.jar/ <--- folder

The exploded directories are named with the .war and .jar extensions of the compressed counterparts.  This throws a wrench at Glassfish, which in turn gives me the following exception during startup: <omitted>\ear\target\ear\blah.jar (Access is denied)
    at Method)
    at java.util.jar.JarFile.<init>(
    at java.util.jar.JarFile.<init>(
    at org.apache.catalina.startup.TldConfig.tldScanJar(
    at org.apache.catalina.startup.TldConfig.execute(
    at org.apache.catalina.core.StandardContext.start(
    at com.sun.enterprise.web.WebModule.start(
    at org.apache.catalina.core.ContainerBase.addChildInternal(
    at org.apache.catalina.core.ContainerBase.addChild(
    at org.apache.catalina.core.StandardHost.addChild(
    at com.sun.enterprise.web.WebContainer.loadWebModule(
    at com.sun.enterprise.web.WebContainer.loadWebModule(

So, it looks like Glassfish thinks the exploded blah.jar directories is a compressed .jar files.  I can then rename the exploded directories to 'blahWar' and 'blahEjb' and redeploy (without refreshing Maven inbetween) in the artifacts settings under project structure, fix the ear's application.xml and Glassfish starts up my application properly.

Is there a way to set the war/jar explosion to not use the original compressed artifact's full name?  Maybe replacing the '.war' with an '_war' .  Is this a bug that can or is being resolved with Intellij IDEA?

Thanks for your response.

1 comment
Comment actions Permalink

Hi John,

if MAVEN do the build, use the <unpackTypes> tag of the Maven EAR plugin in the POM.


Further on, the <bundleFileName> tag should be renamed from to foo_bar.

If IntelliJ do the build and deployment, look at the project stettings -> Artifacts -> ear exploded,
check the "show content of elements" checkbox at the bottom and rename the war and ejb folders from -> foo_bar.


Please sign in to leave a comment.