views:

184

answers:

2

Hi,

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?

A: 

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

khmarbaise
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.Or I've got the wrong sense of testing ...
Bernhard V
+1  A: 

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?

Pascal Thivent
The application, to which I've been attached to, gets information from the pom.properties. Why, I actually don't know, but without them, it won't run. Nevertheless, I've written an Ant script that copies the pom.properties to the JBoss from a zipped war, created with war:war. Since they don't change very often, I don't have to do it all the time.
Bernhard V