You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Simone Gianni (JIRA)" <ji...@codehaus.org> on 2006/12/01 16:40:41 UTC
[jira] Created: (MWAR-86) Split the WAR file creation as a separate
goal
Split the WAR file creation as a separate goal
----------------------------------------------
Key: MWAR-86
URL: http://jira.codehaus.org/browse/MWAR-86
Project: Maven 2.x War Plugin
Issue Type: Improvement
Affects Versions: 2.0.1, 2.0, 2.0.2
Reporter: Simone Gianni
Priority: Minor
It would be nice to have a separate goal that zips the WAR file. This way it will be possible to write (and use) plugins that manipulates the WAR folder before the WAR file is built (like applying patches, reorganizing site structure and similar stuff).
Also, there are some plugins (like the cocoon deploy plugin) that actually extend the war plugin to operate "in the middle". This could be avoided (IIUC) adding these separate goal in the WAR plugin.
It should be quite trivial to do, I volunteer for trying.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MWAR-86) Split the WAR file creation as a
separate goal
Posted by "wargre (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MWAR-86?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_106370 ]
wargre commented on MWAR-86:
----------------------------
why not make the war:exploded goald linked with prepare-package phase?
> Split the WAR file creation as a separate goal
> ----------------------------------------------
>
> Key: MWAR-86
> URL: http://jira.codehaus.org/browse/MWAR-86
> Project: Maven 2.x War Plugin
> Issue Type: Improvement
> Affects Versions: 2.0, 2.0.1, 2.0.2
> Reporter: Simone Gianni
> Priority: Minor
> Attachments: maven-war-plugin1.diff
>
>
> It would be nice to have a separate goal that zips the WAR file. This way it will be possible to write (and use) plugins that manipulates the WAR folder before the WAR file is built (like applying patches, reorganizing site structure and similar stuff).
> Also, there are some plugins (like the cocoon deploy plugin) that actually extend the war plugin to operate "in the middle". This could be avoided (IIUC) adding these separate goal in the WAR plugin.
> It should be quite trivial to do, I volunteer for trying.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MWAR-86) Split the WAR file creation as a
separate goal
Posted by "Haikal Saadh (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MWAR-86?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=187546#action_187546 ]
Haikal Saadh commented on MWAR-86:
----------------------------------
Would implementing this mean that, war:exploded will actually generate a dir. that actually resembles the final war, extracted? atm, war:exploded does not process <archive><manifestFile/> (MWAR-167), and stuff that's in <packagingExcludes> is actually copied in to the staging directory.
It seems reasonable to expect that war:exploded willl give you an exploded directory with contents that should match the final war's. At the moment, this is not the case. (Should I log a separate issue for this?)
> Split the WAR file creation as a separate goal
> ----------------------------------------------
>
> Key: MWAR-86
> URL: http://jira.codehaus.org/browse/MWAR-86
> Project: Maven 2.x WAR Plugin
> Issue Type: Improvement
> Affects Versions: 2.0, 2.0.1, 2.0.2
> Reporter: Simone Gianni
> Priority: Minor
> Attachments: maven-war-plugin1.diff
>
>
> It would be nice to have a separate goal that zips the WAR file. This way it will be possible to write (and use) plugins that manipulates the WAR folder before the WAR file is built (like applying patches, reorganizing site structure and similar stuff).
> Also, there are some plugins (like the cocoon deploy plugin) that actually extend the war plugin to operate "in the middle". This could be avoided (IIUC) adding these separate goal in the WAR plugin.
> It should be quite trivial to do, I volunteer for trying.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (MWAR-86) Split the WAR file creation as a separate
goal
Posted by "Simone Gianni (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MWAR-86?page=all ]
Simone Gianni updated MWAR-86:
------------------------------
Attachment: maven-war-plugin1.diff
I parametrized the WarMojo with two booleans, one to create the folder structure, the other one to create the war file.
Then I created a new mojo, WarOnlyMojo, goal war-package, that subclasses WarMojo setting only the boolean needed to produce the war file.
This way, it's possible to act this way in a project pom.xml :
<!-- Default execution of war plugin, without war file generation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0.2-SNAPSHOT</version>
<configuration>
<doCreateWarFile>false</doCreateWarFile>
</configuration>
</plugin>
<!-- Execute any other plugin, binding it to the package phase -->
<plugin>
<groupId>xpatch</groupId>
<artifactId>xpatch-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>xpatch</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Execute the war-package goal and create the war file -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0.2-SNAPSHOT</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>war-package</goal>
</goals>
</execution>
</executions>
</plugin>
Unfortunately I found no way to "merge" the two war plugin declarations in a single one, since :
- Declaring two executions makes the plugin execute 3 time, once with the default way, and the other two with the customized configuration.
- Declaring the configuration together with the executions, makes the plugin ignore the default configuration and execute once as normal, and then with the war-package goal.
Anyway with this it's already possible to change the cocoon-deployer-plugin so that it does not extend the war mojo, does not suffer from the NPE caused more or less from what's described here http://www.mail-archive.com/dev@maven.apache.org/msg60770.html, and makes it possible to stack multiple plugins to work on a war before it's compressed to a single file.
> Split the WAR file creation as a separate goal
> ----------------------------------------------
>
> Key: MWAR-86
> URL: http://jira.codehaus.org/browse/MWAR-86
> Project: Maven 2.x War Plugin
> Issue Type: Improvement
> Affects Versions: 2.0, 2.0.1, 2.0.2
> Reporter: Simone Gianni
> Priority: Minor
> Attachments: maven-war-plugin1.diff
>
>
> It would be nice to have a separate goal that zips the WAR file. This way it will be possible to write (and use) plugins that manipulates the WAR folder before the WAR file is built (like applying patches, reorganizing site structure and similar stuff).
> Also, there are some plugins (like the cocoon deploy plugin) that actually extend the war plugin to operate "in the middle". This could be avoided (IIUC) adding these separate goal in the WAR plugin.
> It should be quite trivial to do, I volunteer for trying.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Issue Comment Edited: (MWAR-86) Split the WAR file creation
as a separate goal
Posted by "wargre (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MWAR-86?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=106370#action_106370 ]
wargre edited comment on MWAR-86 at 3/25/09 8:37 AM:
-----------------------------------------------------
why not make the war:exploded goal binded with prepare-package phase?
Edit : 2009-03-25
With maven 2.1 we've got a workaround
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<id>Prepare WAR</id>
<phase>prepare-package</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
<configuration>
<warSourceDirectory>src/webapp</warSourceDirectory>
</configuration>
</plugin>
<plugin>
<phase>prepare-package</phase>
... do everything you want, precompile, change jsp, ...
</plugin>
was (Author: wargre):
why not make the war:exploded goald linked with prepare-package phase?
> Split the WAR file creation as a separate goal
> ----------------------------------------------
>
> Key: MWAR-86
> URL: http://jira.codehaus.org/browse/MWAR-86
> Project: Maven 2.x WAR Plugin
> Issue Type: Improvement
> Affects Versions: 2.0, 2.0.1, 2.0.2
> Reporter: Simone Gianni
> Priority: Minor
> Attachments: maven-war-plugin1.diff
>
>
> It would be nice to have a separate goal that zips the WAR file. This way it will be possible to write (and use) plugins that manipulates the WAR folder before the WAR file is built (like applying patches, reorganizing site structure and similar stuff).
> Also, there are some plugins (like the cocoon deploy plugin) that actually extend the war plugin to operate "in the middle". This could be avoided (IIUC) adding these separate goal in the WAR plugin.
> It should be quite trivial to do, I volunteer for trying.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira