[
http://jira.codehaus.org/browse/MWAR-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_119715
]
nicolas de loof commented on MWAR-124:
--------------------------------------
First, the classloader issue cannot be resolved to pass code from a plugin to
another. The only solution I've found is to use reflection to invoke the passed
code instead of casting it to a PackagingTask.
Second, for a strange reason, data passed by a plugin to the war plugin using
the plugin context is not visible. I didn't investigate more, but I supose a
new context is created for each phase.
Based on those two facts, I can't find an easy way for a pre-packaging plugin
to declare/register callback code for packaging.
Set as a plugin dependency, some custom code could help enhance the war
packaging as you suggested. How would the war plugin detect such tasks to get
executed ? using some META-INF/maven/warPackagingTasks ? Or using some plexus
components declared in the MATA-INF/plexus/component.xml ? In such case,
should'nt the war plugin come with a maven-war-plugin-extension-api.jar ?
> accept packaging task passed by other plugin via the plugin context
> -------------------------------------------------------------------
>
> Key: MWAR-124
> URL: http://jira.codehaus.org/browse/MWAR-124
> Project: Maven 2.x War Plugin
> Issue Type: Improvement
> Reporter: nicolas de loof
> Assignee: Stephane Nicoll
> Priority: Trivial
> Attachments: war-plugin-external-packaging-tasks.patch,
> war-plugin-external-packaging-tasks.patch
>
>
> In maven 2.0.x there is no phase beetween creating the exploded artifact to
> be packaged and packaging as an archive. my javascript plugins needs to
> assemble source files into the webapp root /scripts directory. The only way
> today is to run during the test phase, to ensure runing prior the war plugin.
> The WarPackagingTask is an abstration that could allow other plugins to
> register some tasks to perform during the exploded webapp creation. As the
> pluginContext is desinged to help plugins share datas, it can be used to pass
> custom packaginTask (and postPackagin ones) to the war plugin from another
> plugin.
> The attached patch adds two constants to define suchentries in the context
> and teh required code to get them and add the to the packaging and
> post-packaging tasks lists.
--
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