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

PAYARA-1165 allow setting of context root on Payara Micro deployments #3682

Merged
merged 2 commits into from Feb 25, 2019

Conversation

Projects
None yet
5 participants
@smillidge
Copy link
Contributor

smillidge commented Feb 2, 2019

This PR allows to set the context path in two ways:

  1. use --contextroot
java -jar payara-micro.jar --deploy myapp.war --contextroot mycontext
  1. use --deploy with :root after the file name
java -jar payara-micro.jar --deploy myapp.war:mycontext

Both examples configure a effective root context of /mycontext/

When both are specified the root given with --deploy takes precedence. The --contextroot applies to the first given --deploy that does not specify its context path directly.

java -jar payara-micro.jar --deploy app1.war:foo --deploy app2.war --contextroot bar

This will deploy app1 in /foo/ and app2 in /bar/.

Note: --deploy app.war:/ is the same as --deploy app.war: which all deploy in the root /.
That means a leading / is not necessary but can be given. In contrast a tailing / should not be given and seems to not work. While the configuration keeps it as "Context Root": "/foo/" browsing to /foo or /foo/ forwards to /foo// which fails to resolve to the expected page.

@smillidge smillidge added this to the 5.191 milestone Feb 2, 2019

@lprimak

lprimak approved these changes Feb 3, 2019

@lprimak

This comment has been minimized.

Copy link
Contributor

lprimak commented Feb 3, 2019

jenkins test

@Pandrex247
Copy link
Member

Pandrex247 left a comment

Windows?

@rdebusscher

This comment has been minimized.

Copy link
Contributor

rdebusscher commented Feb 15, 2019

@smillidge --contextroot is ignored when using --deployFromGAV.

Changing the contextroot logic in fish.payara.micro.impl.PayaraMicroImpl#getGAVURLs to the following statements fixes this.

                String contextRoot = artefactMapEntry.getKey();
                if (this.contextRoot == null) {
                    if ("ROOT".equals(contextRoot)) {
                        contextRoot = "/";
                    }
                } else {
                    contextRoot = this.contextRoot;
                }

@smillidge

This comment has been minimized.

Copy link
Contributor Author

smillidge commented Feb 21, 2019

@rdebusscher good catch I will fix that

@smillidge smillidge force-pushed the smillidge:PAYARA-1165 branch from ead9d58 to e82ef2e Feb 21, 2019

@smillidge

This comment has been minimized.

Copy link
Contributor Author

smillidge commented Feb 21, 2019

Now works with deploy from Gav and uses File.pathseparator so will work on windows

@smillidge

This comment has been minimized.

Copy link
Contributor Author

smillidge commented Feb 21, 2019

jenkins test please

@Pandrex247 Pandrex247 merged commit 53963f2 into payara:master Feb 25, 2019

35 of 39 checks passed

security/snyk - appserver/registration/pom.xml (payara-ci) Test in progress
security/snyk - appserver/security/pom.xml (payara-ci) Test in progress
security/snyk - appserver/webservices/pom.xml (payara-ci) Test in progress
security/snyk - nucleus/flashlight/pom.xml (payara-ci) Test in progress
Payara Quick Build and Test Quick build and test passed!
Details
security/snyk - api/payara-api/pom.xml (payara-ci) No new issues
Details
security/snyk - api/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/ant-tasks/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/appclient/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/batch/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/common/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/connectors/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/distributions/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/featuresets/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/flashlight/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/grizzly/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/ha/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/installer/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/javaee-api/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/jdbc/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/jms/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/osgi-platforms/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/packager/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/payara-appserver-modules/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/persistence/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/resources/pom.xml (payara-ci) No new issues
Details
security/snyk - appserver/web/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/cluster/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/common/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/deployment/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/distributions/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/hk2/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/osgi-platforms/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/payara-modules/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/resources-l10n/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/security/pom.xml (payara-ci) No new issues
Details
security/snyk - nucleus/tests/pom.xml (payara-ci) No new issues
Details
security/snyk - pom.xml (payara-ci) No new issues
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.