-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Issue #12990 - Introduce static-deploy
module
#12998
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
base: jetty-12.1.x
Are you sure you want to change the base?
Conversation
+ And distribution tests
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.
We've gone wrong somewhere with "foo.d" directories. These should never EVER be deployed by the deployer. They should be invisible to the scanner/deployer and are used to hold files for a app at "/foo/" or "/foo.war".
I think the issue here is that a "/foo/" directory should be deployed to deploy static resources if:
- The default env is an EEn env and then it is just a servlet application with no servlets and just a default servlet.
- If the default env is "core" then a resource handler should be created.
- If there is a foo.properties file that sets the env to core, then it should be deployed with a resource handler.
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/CoreContextHandler.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/CoreContextHandler.java
Outdated
Show resolved
Hide resolved
...est-distribution-common/src/test/java/org/eclipse/jetty/tests/distribution/DeployerTest.java
Show resolved
Hide resolved
static-deploy
module
...y-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StaticContextHandler.java
Outdated
Show resolved
Hide resolved
...y-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StaticContextHandler.java
Outdated
Show resolved
Hide resolved
...y-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StaticContextHandler.java
Outdated
Show resolved
Hide resolved
...y-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StaticContextHandler.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/CoreContextHandler.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/CoreContextHandler.java
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/config/modules/static-deploy.mod
Outdated
Show resolved
Hide resolved
* ContextHandler now handles the TEMP_DIR and CONTEXT_PATH attributes.
…redeploy-static-directory
…he same way as ee#
jetty-core/jetty-server/src/main/config/modules/static-deploy.mod
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/CoreContextHandler.java
Outdated
Show resolved
Hide resolved
…hat logic at deployment is more sane
…before attempting to configure it
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/CoreContextHandler.java
Outdated
Show resolved
Hide resolved
...y-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StaticContextHandler.java
Outdated
Show resolved
Hide resolved
...y-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StaticContextHandler.java
Outdated
Show resolved
Hide resolved
...y-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StaticContextHandler.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-util/src/main/java/org/eclipse/jetty/util/IO.java
Outdated
Show resolved
Hide resolved
...-maven-plugin/src/main/java/org/eclipse/jetty/ee10/maven/plugin/WebAppPropertyConverter.java
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java
Outdated
Show resolved
Hide resolved
This reverts commit 0329896.
...y-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StaticContextHandler.java
Outdated
Show resolved
Hide resolved
...y-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StaticContextHandler.java
Outdated
Show resolved
Hide resolved
@gregw made the changes you requested. We can disregard the offline ECA service check for now. |
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/CoreContextHandler.java
Outdated
Show resolved
Hide resolved
...y-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/StaticContextHandler.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java
Show resolved
Hide resolved
@gregw @joakime so current status is that environment
A static deployment would therefore always require a
Perhaps the right solution is to not have any environment setup by default -- they are only enabled if there is the correspondent module. Thoughts? |
The |
…redeploy-static-directory
@gregw a rereview on this one please. |
@@ -127,12 +130,40 @@ public class DeploymentScanner extends ContainerLifeCycle implements Scanner.Bul | |||
// old attributes prefix, now stripped. | |||
private static final String ATTRIBUTE_PREFIX = "jetty.deploy.attribute."; | |||
|
|||
private static final Pattern EE_ENVIRONMENT_NAME_PATTERN = Pattern.compile("ee(\\d+)"); |
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.
I know we use "ee", but just in case, perhaps this should be
private static final Pattern EE_ENVIRONMENT_NAME_PATTERN = Pattern.compile("ee(\\d+)"); | |
private static final Pattern EE_ENVIRONMENT_NAME_PATTERN = Pattern.compile("ee(\\d+)", Pattern.CASE_INSENSITIVE); |
* EE names are compared by EE number, otherwise simple name comparison is used. | ||
*/ | ||
protected static final Comparator<String> ENVIRONMENT_COMPARATOR = (e1, e2) -> | ||
{ |
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.
This comparator will generate a lot of matchers, so perhaps take the returns where you can:
{ | |
{ | |
if (Objects.equals(e1, e2)) | |
return 0; |
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.
Better yet, why not just create an Index that is case insensitive and maps all the known environment names to an integer.
Index<Integer> environmentOrdinals = new Index.Builder<Integer>()
.caseSensitive(false)
.with("static", 1)
.with("core", 2)
.with("ee9", 9)
.with("ee10", 10)
.with("ee11", 11)
.build();
+ `baseResource` to `jetty.deploy.baseResource` + `jetty.static.dirAllowed` to `jetty.deploy.baseResource.dirAllowed`
Fixes #12990