-
Notifications
You must be signed in to change notification settings - Fork 306
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
[PAYARA-3662] fixing glassfish-web.xml contextroot overwrite #3831
Conversation
@@ -14,7 +14,6 @@ | |||
* limitations under the License. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes to this file can be ignored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cubastanley With reproducer, context root from glassfish-web.xml is still ignored.
if (war.getName().startsWith("ROOT.")) { | ||
deployer.deploy(war, "--availabilityenabled=true", "--force=true", "--contextroot=/", "--loadOnly", "true"); | ||
} else { | ||
deployer.deploy(war, "--availabilityenabled=true", "--force=true", "--loadOnly", "true", "--contextroot", deployContext); | ||
if(deployContext == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deployContext is never null since it is set earlier from the war name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smillidge regarding this, what's the purpose of the deployContext variable? It seems in these cases it would be more beneficial to just use contextRoot directly?
Difficult to find out what exactly changed due to the many code reformats |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting quibbles
@@ -1587,7 +1595,11 @@ private void deployAll() throws GlassFishException { | |||
if (entry.getName().startsWith("ROOT.")) { | |||
deployer.deploy(entry, "--availabilityenabled=true", "--force=true", "--contextroot=/", "--loadOnly", "true"); | |||
} else { | |||
deployer.deploy(entry, "--availabilityenabled=true", "--force=true", "--loadOnly", "true", "--contextroot",deployContext); | |||
if(deployContext == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a space between if
and (
if (war.getName().startsWith("ROOT.")) { | ||
deployer.deploy(war, "--availabilityenabled=true", "--force=true", "--contextroot=/", "--loadOnly", "true"); | ||
} else { | ||
deployer.deploy(war, "--availabilityenabled=true", "--force=true", "--loadOnly", "true", "--contextroot", deployContext); | ||
if(deployContext == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a space between if
and (
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a small improvement for me required.
for (File entry : deploymentDirEntries) { | ||
|
||
boolean hasDefinedContextRoot = (contextRoot != null && contextRoot.isEmpty() == false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contextRoot.isEmpty() == false -> !contextRoot.isEmpty()
if (war.exists() && war.canRead()) { | ||
for (File war : deployments) { | ||
|
||
boolean hasDefinedContextRoot = (contextRoot != null && contextRoot.isEmpty() == false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contextRoot.isEmpty() == false -> !contextRoot.isEmpty()
Jenkins test please |
Signed-off-by: Maxim Nesen <[email protected]>
[PAYARA-3662] fixing glassfish-web.xml contextroot overwrite
Unfortunately git has tracked the changes in formatting that ended up coming into existence, the only physical changes I've made to the code are I the deployAll() method from line 1530 onwards