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

Add Servlet Context if deployed as named WAR file #559

Merged
merged 2 commits into from
Aug 30, 2023
Merged

Conversation

timyates
Copy link
Contributor

If we are deploying as a named WAR file (ie: myproject-0.1.war) then this will be the context path for the application. This change detects this, and sets the context path for the application accordingly. Any context-path config in the application context will be ignored in this case.

If the deployed WAR file is added to the ROOT context (ie: by deploying ROOT.war), then any context-path from application properties will be used.

If we are deploying as a named WAR file (ie: `myproject-0.1.war`) then this will be the context path for the application.
This change detects this, and sets the context path for the application accordingly.
Any context-path config in the application context will be ignored in this case.

If the deployed WAR file is added to the ROOT context (ie: by deploying `ROOT.war`), then any context-path from application properties will be used.
@timyates timyates added the type: improvement A minor improvement to an existing feature label Aug 29, 2023
@timyates timyates self-assigned this Aug 29, 2023
@timyates timyates linked an issue Aug 29, 2023 that may be closed by this pull request
@timyates
Copy link
Contributor Author

I manually tested this with Tomcat and Jetty, but I cannot think of a nice way of automatically testing it without non-insignificant effort. If we agree the effort is worth it, I can work on it

@timyates timyates added this to the 4.0.5 milestone Aug 29, 2023
@timyates timyates requested a review from sdelamo August 29, 2023 15:45
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement A minor improvement to an existing feature
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

micronaut war deployment on external Jetty server is not working
3 participants