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

War overlay with io.freefair.war-overlay plugin is not served by gretty plugin #241

Open
zd-dalibor opened this issue Oct 25, 2021 · 3 comments

Comments

@zd-dalibor
Copy link

Hi,
I am using this war overlay plugin https://docs.freefair.io/gradle-plugins/6.2.0/reference/#_io_freefair_war_overlay in my project.
When I try to run my project with gretty content from war overlay is not deployed in servlet container (content from referenced war should be merged with project content and deployed in servlet container, I am getting only project content without content from referenced war).

When I build final war it contains content from the project and from referenced war.
I really do not want to deploy war with gretty because I am losing hot deployment and fast reload features in that way.

@boris-petrov
Copy link
Member

@zd-dalibor - thanks for the issue report. Which version of Gretty are you using? Also, can you provide a test project that reproduces the issue? That's gonna greatly help us figuring out what the issue might be.

@zd-dalibor
Copy link
Author

zd-dalibor commented Dec 15, 2021

I am using Gretty 4.0.0.
And this is my overlay configuration (io.freefair.war-overlay):

plugins {
    id 'io.freefair.war' version "6.3.0"
}
dependencies {
    implementation("info.magnolia:magnolia-empty-webapp:6.2.13@pom") {
        exclude group: 'info.magnolia.lang'
        transitive = true
    }
}
overlays {
    magnolia {
        from "info.magnolia:magnolia-empty-webapp:6.2.13@war"
        enableCompilation = false
        excludes = ["**/.emptydir-placeholder", "WEB-INF/lib/*.jar"]
    }
}

When gradle builds war package it contains files form "info.magnolia:magnolia-empty-webapp:6.2.13@war".
But when I want to start servlet container with gretty, gretty does not include files from magnolia overlay.

I know that gretty supports overlays, bat only from project moduls, not from dependencies like "info.magnolia:magnolia-empty-webapp:6.2.13@war".

@f4lco
Copy link
Collaborator

f4lco commented Jan 7, 2022

It's hard to tell what would help you the most for your particular setup without seeing what you tried / having a reproducer.
I can see multiple alternative routes going forward:

  • Using both: Try to replicate the overlay configuration from the Freefair plugin in Gretty using our (sparse) docs: https://gretty-gradle-plugin.github.io/gretty-doc/Web-app-overlays.html While I'm not familiar with the Freefair plugin, these seem to be competing features, because both plugins seem to implement the overlay feature. If you want to use both, the project needs configuration for both, at the risk that they may not work in the very same way.
  • Make Gretty work with the Freefair WAR: though I'm not sure how the interaction with Gretty's other features looks like, we might be able to make Gretty deploy the WAR produced by the Freefair plugin. So the Freefair plugin would give you the packaging story with the overlay, and Gretty would consume that WAR and do the deployment during development. This would likely require setting the inplace toggle to false. Admittedly, this toggle is missing from https://gretty-gradle-plugin.github.io/gretty-doc/Gretty-configuration.html.
  • Settle on Gretty: I'm not that sure, but Gretty might support producing the final WAR with overlays using the 'build product' feature. That would make the application of the Freefair plugin redundant maybe? Perhaps that's already ruled out because you mentioned you don't want to deploy with Gretty.

@zd-dalibor what have you tried? Can you imagine that one of the options is applicable?
@boris-petrov is the big picture correct here? It's been a while since I used Gretty extensively.

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

3 participants