Issue Details (XML | Word | Printable)

Key: MWAR-121
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Stephane Nicoll
Reporter: Dave Rathnow
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Maven 2.x WAR Plugin

Maven-war-plugin not installing war. Installs ".jar" and renames it to ".war"

Created: 25/Sep/07 02:57 PM   Updated: 02/Feb/10 11:49 AM   Resolved: 06/Oct/07 01:09 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive war.zip (10 kB)

Environment:
Windows XP
Maven 2.0.7
JDK 1.5.0_10


 Description  « Hide

I'm trying to use the maven-war-plugin to install a war into my local repository. "mvn clean install" runs fine and completes succesfully. If I look under the target" directory in the project folder, there is, amoung other things, a .jar and .war file. Both have been built properly. However, if I look in my local repository, there is a .war file but when I open it, it is actually the .jar file renamed to .war.

The attached zip file contains the pom for the project, the parent pom and the output from the command "mvn clean install -X > output.log"



Stephane Nicoll added a comment - 06/Oct/07 01:09 AM

Not an issue. The definition of the jar plugin in the parent pom conflicts with war


Eric Smalling added a comment - 16/Dec/09 10:39 AM

FYI: We've found that if you add a classifier to the jar that causes the filename to differ from the .war file, the install:install step will grab both and not exhibt the issue described here.

i.e.

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>my-web-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>something</classifier>
</configuration>
</execution>
</executions>
</plugin>

(Although a better solution is to refactor your jar content into a "common" module though)


rich zaleski added a comment - 02/Feb/10 11:27 AM

It would be great if this would be fixed. It seems the maven-source-plugin works properly, but the maven-war-plugin does not. I would like to generate primary and secondary artifacts using a single pom file. It seems overly complex to have to make modules out of everything.

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warName>cds_commons</warName>
</configuration>
<executions>
<execution>
<id>attach-war</id>
<phase>package</phase>
<goals>
<goal>war</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
< /plugins>
</build>


Wendy Smoak added a comment - 02/Feb/10 11:49 AM

Rich, this issue is already closed as "Won't Fix" indicating that the developers don't consider it a valid bug. You might want to bring it up on the mailing list if you feel it should be re-opened. Otherwise, nothing is likely to happen with it.