If I package a web application with the maven goal war:exploded, why won't pom.xml and pom.properties be included?

I'm pretty new to Maven and I've noticed an interesting thing in the Maven WAR Plugin.

When I package my Java web application with war:war, a zipped war is created. This war contains also the files pom.xml and pom.properties in the META-INF directory. But if I package my application with war:exploded and create an exploded war directory, those two files won't be included.

Now I'm curious, why the pom.xml and the pom.properties aren't packaged into the exploded war. Besides those two files the contents of the exploded and the zipped war are equal.

Is there a reason why the plugin omits pom.xml and pom.properties from the exploded war?

Answers


Is there a reason why the plugin omits pom.xml and pom.properties from the exploded war?

The "component" that adds the pom.properties and the pom.xml files to the generated archive during war:war is the Maven Archiver. You can configure it with the archive optional parameter.

Interestingly, war:exploded also has this parameter but, at the moment, war:exploded doesn't process <archive> (see this comment of MWAR-86) and the exploded war currently doesn't match exactly the final war.


But without the pom files I can't run the exploded war on my local JBoss. So I can't test and debug it either.

The pom file, located in the archive in META-INF/maven/${groupId}/${artifactId}/pom.xml and the pom.properties file, located in the archive in META-INF/maven/${groupId}/${artifactId}/pom.properties are optional "metadata" and I'm not aware of any plugin relying on their presence. So I don't see why you can't run the exploded war on your local JBoss. Can you elaborate?


mvn war:war is intended to create a deployable artifact which needs the information inside (pom, MANIFEST.MF as well)...but the war:exploded is only intended for testing (deploy into a particular folder) instead. Take a look at the explanation


Need Your Help

Django ORM: count related objects with a feature

python django aggregate django-queryset

Lets say we have House and Room models. Each house has several rooms and each room has a number of beds.

How return 304 status with FileResult in ASP.NET MVC RC1

asp.net-mvc caching http-status-codes

As you may know we have got a new ActionResult called FileResult in RC1 version of ASP.NET MVC.