Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
This commit is contained in:
commit
1999b39808
296
VERSION.txt
296
VERSION.txt
|
@ -1,5 +1,301 @@
|
|||
jetty-12.0.0-SNAPSHOT
|
||||
|
||||
jetty-11.0.11 - 21 June 2022
|
||||
+ 8184 All suffix globs except first fail to match if path has `.` character
|
||||
in prefix section
|
||||
|
||||
jetty-11.0.10 - 16 June 2022
|
||||
+ 1771 Add module for SecuredRedirect support
|
||||
+ 4414 GZipHandler not excluding inflation for specified paths
|
||||
+ 7635 QPACK decoder should fail connection if the encoder blocks more than
|
||||
SETTINGS_QPACK_BLOCKED_STREAMS
|
||||
+ 7748 Allow overriding of url-pattern mapping in ServletContextHandler to
|
||||
allow for regex or uri-template matching
|
||||
+ 7754 jetty.sh ignores JAVA_OPTIONS environment variable
|
||||
+ 7801 Session cookie can be set twice after session id changed
|
||||
+ 7818 Modifying of HTTP headers in HttpChannel.Listener#onResponseBegin is no
|
||||
longer possible with Jetty 10
|
||||
+ 7855 Remove accidentally included package-info.class in all packages
|
||||
+ 7858 GZipHandler does not play nice with other handlers in HandlerCollection
|
||||
+ 7863 Default servlet drops first accept-encoding header if there is more
|
||||
than one.
|
||||
+ 7880 DefaultServlet should not overwrite programmatically configured
|
||||
precompressed formats with defaults
|
||||
+ 7891 Better Servlet PathMappings for Regex
|
||||
+ 7918 PathMappings.asPathSpec does not allow root ServletPathSpec
|
||||
+ 7935 Review HTTP/2 error handling
|
||||
+ 7975 `ForwardedRequestCustomizer` setters do not clear existing handlers
|
||||
+ 7977 UpgradeHttpServletRequest.setAttribute &
|
||||
UpgradeHttpServletRequest.removeAttribute can throw NullPointerException
|
||||
+ 7994 Ability to construct a detached client Request
|
||||
+ 8014 Review HttpRequest URI construction
|
||||
+ 8057 Support Http Response 103 (Early Hints)
|
||||
+ 8067 Wall time usage in DoSFilter RateTracker results in false positive
|
||||
alert
|
||||
+ 8088 Add option to configure exitVm on ShutdownMonitor from System
|
||||
properties
|
||||
+ 8161 Improve SSLConnection buffers handling
|
||||
|
||||
jetty-11.0.9 - 30 March 2022
|
||||
+ 5681 Unrecognized jetty-home/start.jar command line option not reported
|
||||
clearly
|
||||
+ 5965 Option --write-module-graph produces wrong .dot file
|
||||
+ 6879 Remove jminix (not maintained) module as hawtio provide same features
|
||||
+ 7182 jetty.sh start process should remove jetty_state whenever deleting the
|
||||
pid
|
||||
+ 7344 Incompatible with jacoco due to shutdown race condition
|
||||
+ 7414 QoSFilter.setMaxRequests throws NullPointerException
|
||||
+ 7513 Getter/setter type mismatch for mbean attribute file in class
|
||||
org.eclipse.jetty.deploy.PropertiesConfigurationManager
|
||||
+ 7517 Some ArrayTrie methods throw StackOverflowError when cointaining a very
|
||||
large entry
|
||||
+ 7518 ArrayTrie getBest fails to match the empty string entry in certain
|
||||
cases
|
||||
+ 7545 Named arguments do not work in jetty-openid.xml
|
||||
+ 7548 Interrupt flag is not always cleared in between requests
|
||||
+ 7567 Gzip compression not working for multipart/form-data when added to the
|
||||
allowed list using addIncludedMimeTypes.
|
||||
+ 7573 WebSockets - "Unsupported PathParam Type: java.lang.Integer"
|
||||
+ 7575 Misleading docs for `HttpClientTransportDynamic`
|
||||
+ 7613 Configurations.add(Configuration) results in
|
||||
UnsupportedOperationException
|
||||
+ 7615 HttpServletResponse.encodeURL not working for URLs starting with ../
|
||||
+ 7617 Logback-access RequestLog not working
|
||||
+ 7625 HTTP/3 error against www.google.com
|
||||
+ 7677 jetty-maven-plugin - maven internal dependencies included on webapp
|
||||
classloader
|
||||
+ 7683 GZIPContentDecoder ignores setUseInputDirectByteBuffers setting and
|
||||
always uses non-direct buffers (causing GC locking)
|
||||
+ 7688 Read data to native memory from HttpInput
|
||||
+ 7748 Allow overriding of url-pattern mapping in ServletContextHandler to
|
||||
allow for regex or uri-template matching
|
||||
|
||||
jetty-11.0.8 - 07 February 2022
|
||||
+ 2504 Expose more WebSocket details in JMX and Server Dump
|
||||
+ 4275 Path Normalization/Traversal - Context Matching
|
||||
+ 4317 EventSource does not work with GzipHandler
|
||||
+ 6017 Property overriding does not work
|
||||
+ 6282 SecuredRedirectHandler should probably redirect with 301
|
||||
+ 6497 Replace SameFileAliasChecker
|
||||
+ 6728 QUIC and HTTP/3
|
||||
+ 6730 HTTP3: update Quiche to 0.9.0
|
||||
+ 6965 Expose Spec `ServerContainer.upgrade()` API
|
||||
+ 6973 Jetty starts consuming CPU that remains high even without any traffic
|
||||
+ 6974 Major websocket memory change in 9.4.36
|
||||
+ 6980 ELContextCleaner failed because cannot access a member of class
|
||||
javax.el.BeanELResolver with modifiers "private static final"
|
||||
+ 6985 ELContextCleaner references javax class in jetty-11
|
||||
+ 6987 jetty-unixdomain-server is missing from jetty-bom
|
||||
+ 6990 UnixDomainServerConnector throws misleading exception on invalid socket
|
||||
path
|
||||
+ 7008 Problem with jetty.sh start regression 10.0.6 -> 10.0.7 when using
|
||||
JETTY_USER
|
||||
+ 7012 Remove all old geronimo spec jars from jetty-10
|
||||
+ 7031 ResponseWriter.println(char) does not print newline
|
||||
+ 7042 Simplify configuration to use different OpenIdConfiguration per webapp
|
||||
+ 7059 NPE in AllowedResourceAliasChecker.getPath()
|
||||
+ 7063 Simplify command line use of org.eclipse.jetty.util.Password
|
||||
+ 7064 Cleanup or clarify `(null)` in output of `--list-config`
|
||||
+ 7086 WebSocket: java.lang.IllegalStateException: already released
|
||||
RetainableByteBuffer
|
||||
+ 7103 Rework LaF of distro landing page
|
||||
+ 7107 Client timeout and async close exceptions when setting max duration on
|
||||
pool
|
||||
+ 7109 Deprecate UnixSocket JNR support
|
||||
+ 7111 Add support to deprecate jetty-home modules
|
||||
+ 7113 Improve Unix-Domain client documentation
|
||||
+ 7124 Add default methods on LifeCycle.Listener interface
|
||||
+ 7131 Use Charset instead of encoding string where possible
|
||||
+ 7157 Multiplexed connection pools retain CLOSED entries
|
||||
+ 7160 HttpURI considers %25 to be ambiguous, preventing access to static
|
||||
resources with % in their name
|
||||
+ 7240 Clarify and javadoc InvocationType
|
||||
+ 7243 Reset pooled ByteBuffer endianness
|
||||
+ 7262 Allow the SerlvetHandler.getFilterChain method to be overridden
|
||||
+ 7277 Allow override of `ServletRequest.getLocalName()` and `.getLocalPort()`
|
||||
in post-intermediary scenarios
|
||||
+ 7280 Interceptors don't get destroyed in HttpInput
|
||||
+ 7281 EOFs are not passed to interceptors any more - shouldn't they?
|
||||
+ 7284 HttpInput reopen/recycle cleanup
|
||||
+ 7297 Deprecate log4j 1.x support
|
||||
+ 7313 addBean(_attributes); only called in the Convenience constructor of
|
||||
org.eclipse.jetty.server.Server
|
||||
+ 7327 jetty-slf4j-impl missing from BOM
|
||||
+ 7348 Slow CONNECT request causes NPE
|
||||
+ 7351 Large WebSocket payloads with permessage-deflate hang on 10.0.7
|
||||
+ 7354 Demo jars should not be in jetty-home
|
||||
+ 7369 Document CustomRequestLog
|
||||
+ 7375 Some environments require Request scoping during session save
|
||||
+ 7435 Investigate Infinispan transitive dependencies
|
||||
+ 7494 Remove modules in Jetty 11 that are not supporting jakarta.servlet yet
|
||||
+ 7496 Transient 400: Bad Request responses in jetty-9.4.45.v20220128
|
||||
+ 7514 Adding InheritedListeners to already-started components can cause
|
||||
IllegalStateException
|
||||
+ 7523 Typo in AnnotationConfiguration
|
||||
+ 7524 Missing package in JmxConfiguration
|
||||
+ 7529 Upgrade quiche to version 0.11.0
|
||||
|
||||
jetty-10.0.11 - 21 June 2022
|
||||
+ 8184 All suffix globs except first fail to match if path has `.` character
|
||||
in prefix section
|
||||
|
||||
jetty-10.0.10 - 16 June 2022
|
||||
+ 1771 Add module for SecuredRedirect support
|
||||
+ 4414 GZipHandler not excluding inflation for specified paths
|
||||
+ 7635 QPACK decoder should fail connection if the encoder blocks more than
|
||||
SETTINGS_QPACK_BLOCKED_STREAMS
|
||||
+ 7748 Allow overriding of url-pattern mapping in ServletContextHandler to
|
||||
allow for regex or uri-template matching
|
||||
+ 7754 jetty.sh ignores JAVA_OPTIONS environment variable
|
||||
+ 7801 Session cookie can be set twice after session id changed
|
||||
+ 7818 Modifying of HTTP headers in HttpChannel.Listener#onResponseBegin is no
|
||||
longer possible with Jetty 10
|
||||
+ 7855 Remove accidentally included package-info.class in all packages
|
||||
+ 7858 GZipHandler does not play nice with other handlers in HandlerCollection
|
||||
+ 7863 Default servlet drops first accept-encoding header if there is more
|
||||
than one.
|
||||
+ 7880 DefaultServlet should not overwrite programmatically configured
|
||||
precompressed formats with defaults
|
||||
+ 7891 Better Servlet PathMappings for Regex
|
||||
+ 7918 PathMappings.asPathSpec does not allow root ServletPathSpec
|
||||
+ 7935 Review HTTP/2 error handling
|
||||
+ 7975 `ForwardedRequestCustomizer` setters do not clear existing handlers
|
||||
+ 7977 UpgradeHttpServletRequest.setAttribute &
|
||||
UpgradeHttpServletRequest.removeAttribute can throw NullPointerException
|
||||
+ 7994 Ability to construct a detached client Request
|
||||
+ 8014 Review HttpRequest URI construction
|
||||
+ 8057 Support Http Response 103 (Early Hints)
|
||||
+ 8067 Wall time usage in DoSFilter RateTracker results in false positive
|
||||
alert
|
||||
+ 8088 Add option to configure exitVm on ShutdownMonitor from System
|
||||
properties
|
||||
+ 8161 Improve SSLConnection buffers handling
|
||||
|
||||
jetty-10.0.9 - 30 March 2022
|
||||
+ 5681 Unrecognized jetty-home/start.jar command line option not reported
|
||||
clearly
|
||||
+ 5965 Option --write-module-graph produces wrong .dot file
|
||||
+ 6879 Remove jminix (not maintained) module as hawtio provide same features
|
||||
+ 7182 jetty.sh start process should remove jetty_state whenever deleting the
|
||||
pid
|
||||
+ 7344 Incompatible with jacoco due to shutdown race condition
|
||||
+ 7414 QoSFilter.setMaxRequests throws NullPointerException
|
||||
+ 7513 Getter/setter type mismatch for mbean attribute file in class
|
||||
org.eclipse.jetty.deploy.PropertiesConfigurationManager
|
||||
+ 7517 Some ArrayTrie methods throw StackOverflowError when cointaining a very
|
||||
large entry
|
||||
+ 7518 ArrayTrie getBest fails to match the empty string entry in certain
|
||||
cases
|
||||
+ 7545 Named arguments do not work in jetty-openid.xml
|
||||
+ 7548 Interrupt flag is not always cleared in between requests
|
||||
+ 7567 Gzip compression not working for multipart/form-data when added to the
|
||||
allowed list using addIncludedMimeTypes.
|
||||
+ 7573 WebSockets - "Unsupported PathParam Type: java.lang.Integer"
|
||||
+ 7575 Misleading docs for `HttpClientTransportDynamic`
|
||||
+ 7613 Configurations.add(Configuration) results in
|
||||
UnsupportedOperationException
|
||||
+ 7615 HttpServletResponse.encodeURL not working for URLs starting with ../
|
||||
+ 7617 Logback-access RequestLog not working
|
||||
+ 7625 HTTP/3 error against www.google.com
|
||||
+ 7677 jetty-maven-plugin - maven internal dependencies included on webapp
|
||||
classloader
|
||||
+ 7683 GZIPContentDecoder ignores setUseInputDirectByteBuffers setting and
|
||||
always uses non-direct buffers (causing GC locking)
|
||||
+ 7688 Read data to native memory from HttpInput
|
||||
+ 7748 Allow overriding of url-pattern mapping in ServletContextHandler to
|
||||
allow for regex or uri-template matching
|
||||
|
||||
jetty-10.0.8 - 07 February 2022
|
||||
+ 2504 Expose more WebSocket details in JMX and Server Dump
|
||||
+ 4275 Path Normalization/Traversal - Context Matching
|
||||
+ 4317 EventSource does not work with GzipHandler
|
||||
+ 6017 Property overriding does not work
|
||||
+ 6282 SecuredRedirectHandler should probably redirect with 301
|
||||
+ 6497 Replace SameFileAliasChecker
|
||||
+ 6728 QUIC and HTTP/3
|
||||
+ 6730 HTTP3: update Quiche to 0.9.0
|
||||
+ 6965 Expose Spec `ServerContainer.upgrade()` API
|
||||
+ 6973 Jetty starts consuming CPU that remains high even without any traffic
|
||||
+ 6974 Major websocket memory change in 9.4.36
|
||||
+ 6980 ELContextCleaner failed because cannot access a member of class
|
||||
javax.el.BeanELResolver with modifiers "private static final"
|
||||
+ 6987 jetty-unixdomain-server is missing from jetty-bom
|
||||
+ 6990 UnixDomainServerConnector throws misleading exception on invalid socket
|
||||
path
|
||||
+ 7008 Problem with jetty.sh start regression 10.0.6 -> 10.0.7 when using
|
||||
JETTY_USER
|
||||
+ 7012 Remove all old geronimo spec jars from jetty-10
|
||||
+ 7031 ResponseWriter.println(char) does not print newline
|
||||
+ 7042 Simplify configuration to use different OpenIdConfiguration per webapp
|
||||
+ 7059 NPE in AllowedResourceAliasChecker.getPath()
|
||||
+ 7063 Simplify command line use of org.eclipse.jetty.util.Password
|
||||
+ 7064 Cleanup or clarify `(null)` in output of `--list-config`
|
||||
+ 7086 WebSocket: java.lang.IllegalStateException: already released
|
||||
RetainableByteBuffer
|
||||
+ 7103 Rework LaF of distro landing page
|
||||
+ 7107 Client timeout and async close exceptions when setting max duration on
|
||||
pool
|
||||
+ 7109 Deprecate UnixSocket JNR support
|
||||
+ 7111 Add support to deprecate jetty-home modules
|
||||
+ 7113 Improve Unix-Domain client documentation
|
||||
+ 7124 Add default methods on LifeCycle.Listener interface
|
||||
+ 7131 Use Charset instead of encoding string where possible
|
||||
+ 7157 Multiplexed connection pools retain CLOSED entries
|
||||
+ 7160 HttpURI considers %25 to be ambiguous, preventing access to static
|
||||
resources with % in their name
|
||||
+ 7240 Clarify and javadoc InvocationType
|
||||
+ 7243 Reset pooled ByteBuffer endianness
|
||||
+ 7262 Allow the SerlvetHandler.getFilterChain method to be overridden
|
||||
+ 7277 Allow override of `ServletRequest.getLocalName()` and `.getLocalPort()`
|
||||
in post-intermediary scenarios
|
||||
+ 7280 Interceptors don't get destroyed in HttpInput
|
||||
+ 7281 EOFs are not passed to interceptors any more - shouldn't they?
|
||||
+ 7284 HttpInput reopen/recycle cleanup
|
||||
+ 7297 Deprecate log4j 1.x support
|
||||
+ 7313 addBean(_attributes); only called in the Convenience constructor of
|
||||
org.eclipse.jetty.server.Server
|
||||
+ 7327 jetty-slf4j-impl missing from BOM
|
||||
+ 7348 Slow CONNECT request causes NPE
|
||||
+ 7351 Large WebSocket payloads with permessage-deflate hang on 10.0.7
|
||||
+ 7354 Demo jars should not be in jetty-home
|
||||
+ 7369 Document CustomRequestLog
|
||||
+ 7375 Some environments require Request scoping during session save
|
||||
+ 7435 Investigate Infinispan transitive dependencies
|
||||
+ 7496 Transient 400: Bad Request responses in jetty-9.4.45.v20220128
|
||||
+ 7514 Adding InheritedListeners to already-started components can cause
|
||||
IllegalStateException
|
||||
+ 7523 Typo in AnnotationConfiguration
|
||||
+ 7524 Missing package in JmxConfiguration
|
||||
+ 7529 Upgrade quiche to version 0.11.0
|
||||
|
||||
jetty-9.4.45.v20220203 - 03 February 2022
|
||||
+ 4275 Path Normalization/Traversal - Context Matching
|
||||
+ 6497 Replace SameFileAliasChecker
|
||||
+ 6687 Upgrade Infinispan in all active Jetty branches
|
||||
+ 6965 Expose Spec `ServerContainer.upgrade()` API
|
||||
+ 6969 Getting 404 failures when trying to enable `logging-log4j` module
|
||||
+ 6974 Major websocket memory change in 9.4.36
|
||||
+ 7031 ResponseWriter.println(char) does not print newline
|
||||
+ 7059 NPE in AllowedResourceAliasChecker.getPath()
|
||||
+ 7073 Error in parse parameter in broken UTF-8 encoding
|
||||
+ 7078 CompressionPools are not shared between multiple contexts for 9.4
|
||||
WebSocket
|
||||
+ 7107 Client timeout and async close exceptions when setting max duration on
|
||||
pool
|
||||
+ 7124 Add default methods on LifeCycle.Listener interface
|
||||
+ 7157 Multiplexed connection pools retain CLOSED entries
|
||||
+ 7243 Reset pooled ByteBuffer endianness
|
||||
+ 7266 Wrong ALPN jars are selected for newer versions of JDK8
|
||||
+ 7271 It is necessary to set MAX_CAPACITY to ArrayTernaryTrie/ArrayTrie
|
||||
+ 7277 Allow override of `ServletRequest.getLocalName()` and `.getLocalPort()`
|
||||
in post-intermediary scenarios
|
||||
+ 7297 Deprecate log4j 1.x support
|
||||
+ 7348 Slow CONNECT request causes NPE
|
||||
+ 7375 Some environments require Request scoping during session save
|
||||
+ 7435 Investigate Infinispan transitive dependencies
|
||||
+ 7440 ContextHandler.getAliasChecks() breaks Spring Boot
|
||||
+ 7496 Transient 400: Bad Request responses in jetty-9.4.45.v20220128
|
||||
|
||||
jetty-11.0.7 - 06 October 2021
|
||||
+ 3514 Use interpolation of versions from pom in mod files
|
||||
+ 6043 Reimplement UnixSocket support based on Java 16
|
||||
|
|
|
@ -176,16 +176,15 @@ public class PathMappings<E> implements Iterable<MappedResource<E>>, Dumpable
|
|||
int i = path.length();
|
||||
while (i >= 0)
|
||||
{
|
||||
MappedResource<E> candidate = _exactMap.getBest(path, 0, i);
|
||||
MappedResource<E> candidate = _exactMap.getBest(path, 0, i--);
|
||||
if (candidate == null)
|
||||
break;
|
||||
continue;
|
||||
|
||||
matchedPath = candidate.getPathSpec().matched(path);
|
||||
if (matchedPath != null)
|
||||
{
|
||||
return new MatchedResource<>(candidate.getResource(), candidate.getPathSpec(), matchedPath);
|
||||
}
|
||||
i--;
|
||||
}
|
||||
// If we reached here, there's NO optimized EXACT Match possible, skip simple match below
|
||||
skipRestOfGroup = true;
|
||||
|
@ -200,14 +199,13 @@ public class PathMappings<E> implements Iterable<MappedResource<E>>, Dumpable
|
|||
int i = path.length();
|
||||
while (i >= 0)
|
||||
{
|
||||
MappedResource<E> candidate = _prefixMap.getBest(path, 0, i);
|
||||
MappedResource<E> candidate = _prefixMap.getBest(path, 0, i--);
|
||||
if (candidate == null)
|
||||
break;
|
||||
continue;
|
||||
|
||||
matchedPath = candidate.getPathSpec().matched(path);
|
||||
if (matchedPath != null)
|
||||
return new MatchedResource<>(candidate.getResource(), candidate.getPathSpec(), matchedPath);
|
||||
i--;
|
||||
}
|
||||
// If we reached here, there's NO optimized PREFIX Match possible, skip simple match below
|
||||
skipRestOfGroup = true;
|
||||
|
@ -220,11 +218,16 @@ public class PathMappings<E> implements Iterable<MappedResource<E>>, Dumpable
|
|||
if (_optimizedSuffix)
|
||||
{
|
||||
int i = 0;
|
||||
// Loop through each suffix mark
|
||||
// Input is "/a.b.c.foo"
|
||||
// Loop 1: "b.c.foo"
|
||||
// Loop 2: "c.foo"
|
||||
// Loop 3: "foo"
|
||||
while ((i = path.indexOf('.', i + 1)) > 0)
|
||||
{
|
||||
MappedResource<E> candidate = _suffixMap.get(path, i + 1, path.length() - i - 1);
|
||||
if (candidate == null)
|
||||
break;
|
||||
continue;
|
||||
|
||||
matchedPath = candidate.getPathSpec().matched(path);
|
||||
if (matchedPath != null)
|
||||
|
|
|
@ -319,6 +319,32 @@ public class PathMappingsTest
|
|||
assertThat(p.get(new RegexPathSpec("/a/b/c")), nullValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testServletMultipleSuffixMappings()
|
||||
{
|
||||
PathMappings<String> p = new PathMappings<>();
|
||||
p.put(new ServletPathSpec("*.foo"), "resourceFoo");
|
||||
p.put(new ServletPathSpec("*.bar"), "resourceBar");
|
||||
p.put(new ServletPathSpec("*.zed"), "resourceZed");
|
||||
|
||||
MatchedResource<String> matched;
|
||||
|
||||
matched = p.getMatched("/a.b.c.foo");
|
||||
assertThat(matched.getResource(), is("resourceFoo"));
|
||||
|
||||
matched = p.getMatched("/a.b.c.bar");
|
||||
assertThat(matched.getResource(), is("resourceBar"));
|
||||
|
||||
matched = p.getMatched("/a.b.c.pop");
|
||||
assertNull(matched);
|
||||
|
||||
matched = p.getMatched("/a.foo.c.pop");
|
||||
assertNull(matched);
|
||||
|
||||
matched = p.getMatched("/a%2Efoo");
|
||||
assertNull(matched);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRemoveUriTemplatePathSpec()
|
||||
{
|
||||
|
|
|
@ -45,7 +45,6 @@ import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
|||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.eclipse.jetty.ee9.maven.plugin.utils.MavenProjectHelper;
|
||||
import org.eclipse.jetty.ee9.security.LoginService;
|
||||
|
@ -357,7 +356,7 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
|
|||
*
|
||||
*/
|
||||
@Component
|
||||
private ArtifactResolver artifactResolver;
|
||||
private RepositorySystem repositorySystem;
|
||||
|
||||
/**
|
||||
* The current maven session
|
||||
|
@ -410,7 +409,7 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
|
|||
}
|
||||
|
||||
getLog().info("Configuring Jetty for project: " + getProjectName());
|
||||
mavenProjectHelper = new MavenProjectHelper(project, artifactResolver, remoteRepositories, session);
|
||||
mavenProjectHelper = new MavenProjectHelper(project, repositorySystem, remoteRepositories, session);
|
||||
mergedSystemProperties = mergeSystemProperties();
|
||||
configureSystemProperties();
|
||||
augmentPluginClasspath();
|
||||
|
|
|
@ -25,10 +25,10 @@ import java.util.Set;
|
|||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.maven.RepositoryUtils;
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.execution.MavenSession;
|
||||
import org.apache.maven.project.DefaultProjectBuildingRequest;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.apache.maven.project.ProjectBuildingRequest;
|
||||
import org.apache.maven.shared.transfer.artifact.DefaultArtifactCoordinate;
|
||||
|
@ -36,17 +36,23 @@ import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver;
|
|||
import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException;
|
||||
import org.eclipse.jetty.ee9.maven.plugin.OverlayManager;
|
||||
import org.eclipse.jetty.ee9.maven.plugin.WarPluginInfo;
|
||||
import org.eclipse.aether.RepositorySystem;
|
||||
import org.eclipse.aether.artifact.DefaultArtifact;
|
||||
import org.eclipse.aether.resolution.ArtifactRequest;
|
||||
import org.eclipse.aether.resolution.ArtifactResolutionException;
|
||||
import org.eclipse.aether.resolution.ArtifactResult;
|
||||
import org.eclipse.jetty.maven.plugin.OverlayManager;
|
||||
import org.eclipse.jetty.maven.plugin.WarPluginInfo;
|
||||
|
||||
/**
|
||||
* MavenProjectHelper
|
||||
*
|
||||
* A class to facilitate interacting with the build time maven environment.
|
||||
*
|
||||
* A class to facilitate interacting with the build time maven environment.
|
||||
*/
|
||||
public class MavenProjectHelper
|
||||
{
|
||||
private MavenProject project;
|
||||
private ArtifactResolver artifactResolver;
|
||||
private RepositorySystem repositorySystem;
|
||||
private List<ArtifactRepository> remoteRepositories;
|
||||
private MavenSession session;
|
||||
private final Map<String, MavenProject> artifactToReactorProjectMap;
|
||||
|
@ -54,22 +60,22 @@ public class MavenProjectHelper
|
|||
* maven-war-plugin reference
|
||||
*/
|
||||
private WarPluginInfo warPluginInfo;
|
||||
|
||||
|
||||
/**
|
||||
* Helper for wrangling war overlays
|
||||
*/
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
|
||||
/**
|
||||
* @param project the project being built
|
||||
* @param artifactResolver a resolve for artifacts
|
||||
* @param repositorySystem a resolve for artifacts
|
||||
* @param remoteRepositories repositories from which to resolve artifacts
|
||||
* @param session the current maven build session
|
||||
*/
|
||||
public MavenProjectHelper(MavenProject project, ArtifactResolver artifactResolver, List<ArtifactRepository> remoteRepositories, MavenSession session)
|
||||
public MavenProjectHelper(MavenProject project, RepositorySystem repositorySystem, List<ArtifactRepository> remoteRepositories, MavenSession session)
|
||||
{
|
||||
this.project = project;
|
||||
this.artifactResolver = artifactResolver;
|
||||
this.repositorySystem = repositorySystem;
|
||||
this.remoteRepositories = remoteRepositories;
|
||||
this.session = session;
|
||||
//work out which dependent projects are in the reactor
|
||||
|
@ -80,12 +86,12 @@ public class MavenProjectHelper
|
|||
warPluginInfo = new WarPluginInfo(project);
|
||||
overlayManager = new OverlayManager(warPluginInfo);
|
||||
}
|
||||
|
||||
|
||||
public MavenProject getProject()
|
||||
{
|
||||
return this.project;
|
||||
}
|
||||
|
||||
|
||||
public WarPluginInfo getWarPluginInfo()
|
||||
{
|
||||
return warPluginInfo;
|
||||
|
@ -95,7 +101,7 @@ public class MavenProjectHelper
|
|||
{
|
||||
return overlayManager;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the maven project represented by the artifact iff it is in
|
||||
* the reactor.
|
||||
|
@ -135,42 +141,33 @@ public class MavenProjectHelper
|
|||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Given the coordinates for an artifact, resolve the artifact from the
|
||||
* remote repositories.
|
||||
*
|
||||
*
|
||||
* @param groupId the groupId of the artifact to resolve
|
||||
* @param artifactId the artifactId of the artifact to resolve
|
||||
* @param version the version of the artifact to resolve
|
||||
* @param type the type of the artifact to resolve
|
||||
* @return a File representing the location of the artifact or null if not resolved
|
||||
* @throws ArtifactResolverException
|
||||
*/
|
||||
public File resolveArtifact(String groupId, String artifactId, String version, String type)
|
||||
throws ArtifactResolverException
|
||||
throws ArtifactResolutionException
|
||||
{
|
||||
DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
|
||||
coordinate.setGroupId(groupId);
|
||||
coordinate.setArtifactId(artifactId);
|
||||
coordinate.setVersion(version);
|
||||
coordinate.setExtension(type);
|
||||
ArtifactRequest request = new ArtifactRequest();
|
||||
request.setRepositories(RepositoryUtils.toRepos(remoteRepositories));
|
||||
request.setArtifact(new DefaultArtifact(groupId, artifactId, "", type, version));
|
||||
ArtifactResult result = repositorySystem.resolveArtifact(session.getRepositorySession(), request);
|
||||
|
||||
ProjectBuildingRequest buildingRequest =
|
||||
new DefaultProjectBuildingRequest(session.getProjectBuildingRequest());
|
||||
|
||||
buildingRequest.setRemoteRepositories(remoteRepositories);
|
||||
|
||||
Artifact a = artifactResolver.resolveArtifact(buildingRequest, coordinate).getArtifact();
|
||||
|
||||
if (a != null)
|
||||
return a.getFile();
|
||||
if (result.isResolved())
|
||||
return result.getArtifact().getFile();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Recursively find projects in the reactor for all dependencies of the given project.
|
||||
*
|
||||
*
|
||||
* @param project the project for which to find dependencies that are in the reactor
|
||||
* @param visitedProjects the set of projects already seen
|
||||
* @return unified set of all related projects in the reactor
|
||||
|
|
|
@ -434,7 +434,7 @@ case "`uname`" in
|
|||
CYGWIN*) JETTY_START="`cygpath -w $JETTY_START`";;
|
||||
esac
|
||||
|
||||
RUN_ARGS=$("$JAVA" -jar "$JETTY_START" --dry-run=opts,path,main,args ${JETTY_ARGS[*]})
|
||||
RUN_ARGS=$("$JAVA" -jar "$JETTY_START" --dry-run=opts,path,main,args ${JETTY_ARGS[*]} ${JAVA_OPTIONS[*]})
|
||||
RUN_CMD=("$JAVA" $JETTY_SYS_PROPS ${RUN_ARGS[@]})
|
||||
|
||||
#####################################################
|
||||
|
|
Loading…
Reference in New Issue