[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] How to trigger a plugin to run outside the expected workflow?

If you use the awesomeÂm2e-wtp plugin (included in the latest Java EE Kepler distribution), you can overlay a jar project (in the workspace) inside your war, deploy on tomcat, and have jar resources published automatically on save.

Attached is a sample project demonstrating the configuration. Unzip and import everything as maven project, deploy on tomcat, change index.html inside jar, refresh your browser, pick up your jaw on the floor.

And it works without a custom maven plugin :-)

HIH.

Fred
PS: I honestly didn't thing m2e-wtp would manage to support that configuration OOTB :-)




2013/7/2 Noremac <cameroncan+m2e-users@xxxxxxxxx>
I have two projects A and B,

A:
A is a web app (artifact type WAR)
depends on B andÂ
A relies on both java code and web resources (js, images, etc.) that are supplied by B

B:
artifact type JAR
resolved as a workspace project.
B includes web resources (js, images, etc.)
B includes java files
Packaged with both web and java files to provide the web services and an interface to them (through js)

Basically, I have a plugin that transfers the web resources to a specified location in project A so that the files from B can be part of the web app A. The end goal is to allow for changes in project B (i.e. in the js files) to be put into project A with as little effort possible from the developer.

Currently the user must build project B (to get the js into the target directory, where the workspace resolution looks for it), then do a clean build on project A (since an incremental build wouldn't pick up the changes in project B), which would then require a restart of the server (not really needed for static js files).

I had hoped I could customize the custom plugin to transfer all the web resources on an incremental build if they had changed. However, since the change happens outside of project A, the plugin is not run. Is there a way to force the plugin to run on every incremental build of A? Or even better to synchronize the build context with files outside of the current project?

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users




--
"Have you tried turning it off and on again" - The IT Crowd

Attachment: m2e-wtp-dynamic-overlay.zip
Description: Zip archive