Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't support war overlays #2

Open
denu opened this issue Jun 28, 2012 · 4 comments
Open

Doesn't support war overlays #2

denu opened this issue Jun 28, 2012 · 4 comments

Comments

@denu
Copy link

denu commented Jun 28, 2012

Hello,

I've got maven project with 17 overlayed war dependencies.
I've added wro4j plugin to main project, also wro.xml is in there, and no matter if I use static path or classpath...

Neither of this works:
/core/js/.js
classpath:__.js
classpath:/core/js/
.js

As a workaround I have to use this (but there comes SVN issue, as each developer in team uses different dirs for sources):
file:d:\stsworkspace\xariswebcore\src\main\webapp\core\js**.js

@fbricon
Copy link
Member

fbricon commented Jun 28, 2012

Can you setup a test project (on github) reproducing the issue?

Please note that m2e-wro4j won't process resources from other projects than the one having the maven-wro4j-plugin config.
So if you have a projet p1 having an overlay dependency on p2, and want minified p2 .js files deployed in p1, you'll need to explicitely use maven-wro4j-plugin on p2

@denu
Copy link
Author

denu commented Jun 29, 2012

Thanks for replying.

I thought that is possible, as a matter of order in which are maven plugins launched. Eg. use m2e-wro4j to fire wro4j plugin at the end of the build process, after the maven war plugin is finished.

So war ovelay do this:
main: proj1/src/webapp/js/foo.js
+
overlay: proj2/src/webapp/js/bar.js

gives:

proj1/src/webapp/js/foo.js
proj1/src/webapp/js/bar.js

and then fire wro4j with path: /**.js and expect:

proj1/src/webapp/js/all.js (which includes minified foo.js and bar.js)

I think I presented it clearer now, but i can later provide test-case project.

greetz!

@fbricon
Copy link
Member

fbricon commented Jun 29, 2012

The maven war plugin is not invoked in Eclipse, since m2e-wtp delegates all the packaging / deployment to WTP. The actual build lifecycle is different :

  • user modifies a resource
  • eclipse (incremental) builders kick in
  • the eclipse maven (m2e) builder calls m2e-wro which in turn invokes maven-wro4j-plugin:run on the modified project
  • if the project is deployed on a WTP server, the gen'd resources are automatically published.
  • during deployment, if overlay dependencies changed, they're redeployed

So, given the current m2e-wtp / m2e-wro4j implementations, there's no way to produce what you expect. I'm not saying it's impossible, but really don't see a solution right now.

There might be a hack involving maven profiles and resource filtering to workaround the absolute path problems in your current solution, but again I'd need a sample project to try. And I'm not sure it'd work anyway.

@denu
Copy link
Author

denu commented Jul 16, 2012

Hello there,

As you said I've created test-case project and commited it over github to make it easier to work it out.
Hope you will find a way!

https://github.com/denu/denu/tree/master/parent

greetz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants