Cleaning up state of branch to match the original jetty-9.4.x
+ Does not include changes to /jetty-cdi/ + Does not include changes to /jetty-websocket/ for javax.websocket-1.1
This commit is contained in:
parent
585f126b48
commit
1311052b15
|
@ -53,7 +53,7 @@ node {
|
|||
withEnv(mvnEnv) {
|
||||
timeout(time: 90, unit: 'MINUTES') {
|
||||
// Run test phase / ignore test failures
|
||||
sh "mvn -B install -Dmaven.test.failure.ignore=true"
|
||||
sh "mvn -B install -Dmaven.test.failure.ignore=true -Prun-its"
|
||||
// Report failures in the jenkins UI
|
||||
step([$class: 'JUnitResultArchiver',
|
||||
testResults: '**/target/surefire-reports/TEST-*.xml'])
|
||||
|
|
524
VERSION.txt
524
VERSION.txt
|
@ -1,25 +1,4 @@
|
|||
jetty-9.3.22-SNAPSHOT
|
||||
|
||||
jetty-9.3.21.M0 - 01 August 2017
|
||||
+ 1357 RolloverFileOutputStream: No rollout performed at midnight
|
||||
+ 1469 RolloverFileOutputStream: IllegalStateException Task already scheduled
|
||||
+ 1507 RolloverFileOutputStream: Negative delay Timer.schedule exception
|
||||
+ 1513 RolloverFileOutputStream: can't handle multiple instances
|
||||
+ 1655 Improve extensibility of ServerConnector
|
||||
+ 1661 AbstractProxyServlet onProxyResponseFailure Error
|
||||
+ 1664 IPAccessHandler CIDR IP range check is incorrect
|
||||
+ 1685 Update ALPN support for Java 8u141
|
||||
+ 1687 HTTP2: Correcting missing callback notification when channel not found
|
||||
+ 1702 Update ALPN support for Java 8u144
|
||||
+ 1703 Improve HttpInput failure logging
|
||||
|
||||
jetty-9.3.20.v20170531 - 31 May 2017
|
||||
+ 523 TLS close behaviour breaking session resumption
|
||||
+ 1108 Please improve logging in SslContextFactory when there are no approved
|
||||
cipher suites
|
||||
+ 1527 Jetty BOM should not depend on jetty-parent
|
||||
+ 1556 A timing channel in Password.java
|
||||
+ 1567 XmlConfiguration will start the same object multiple times
|
||||
jetty-9.4.7-SNAPSHOT
|
||||
|
||||
jetty-9.2.22.v20170606 - 06 June 2017
|
||||
+ 920 no main manifest attribute, in jetty-runner-9.2.19.v20160908.jar
|
||||
|
@ -33,10 +12,9 @@ jetty-9.2.22.v20170606 - 06 June 2017
|
|||
+ 1523 Update ALPN support for Java 8u131
|
||||
+ 1556 A timing channel in Password.java
|
||||
+ 1590 RolloverFileOutputStream not functioning in Jetty 9.2.21+
|
||||
jetty-9.2.23-SNAPSHOT
|
||||
|
||||
jetty-9.2.22.v20170606 - 06 June 2017
|
||||
+ 920 no main manifest attribute, in jetty-runner-9.2.19.v20160908.jar
|
||||
jetty-9.4.6.v20170531 - 31 May 2017
|
||||
+ 523 TLS close behaviour breaking session resumption
|
||||
+ 1108 Please improve logging in SslContextFactory when there are no approved
|
||||
cipher suites
|
||||
+ 1505 Adding jetty.base.uri and jetty.home.uri
|
||||
|
@ -63,6 +41,14 @@ jetty-9.2.22.v20170606 - 06 June 2017
|
|||
+ 1569 Allow setting of maxBinaryMessageSize to 0 in WebSocketPolicy
|
||||
+ 1579 NPE in Quoted Quality CSV
|
||||
|
||||
jetty-9.3.20.v20170531 - 31 May 2017
|
||||
+ 523 TLS close behaviour breaking session resumption
|
||||
+ 1108 Please improve logging in SslContextFactory when there are no approved
|
||||
cipher suites
|
||||
+ 1527 Jetty BOM should not depend on jetty-parent
|
||||
+ 1556 A timing channel in Password.java
|
||||
+ 1567 XmlConfiguration will start the same object multiple times
|
||||
|
||||
jetty-9.4.5.v20170502 - 02 May 2017
|
||||
+ 304 Review dead code - StringUtil.sidBytesToString
|
||||
+ 1235 DNS lookup in newSSLEngine(InetSocketAddress address)
|
||||
|
@ -95,6 +81,20 @@ jetty-9.4.5.v20170502 - 02 May 2017
|
|||
+ 1521 Prevent copy of jetty jars to lib/gcloud
|
||||
+ 1523 Update ALPN support for Java 8u131
|
||||
|
||||
jetty-9.3.19.v20170502 - 02 May 2017
|
||||
+ 877 Programmatic servlet mappings cannot override mappings from
|
||||
webdefault.xml using quickstart
|
||||
+ 1348 Add a BOM artifact
|
||||
+ 1390 HashLoginService and "this.web-inf.url" property are incompatible
|
||||
+ 1463 SSL Renegotiate limit
|
||||
+ 1469 IllegalStateException in RolloverFileOutputStream
|
||||
+ 1486 redirect to welcome file broken for sub directory
|
||||
+ 1487 add decoded paths
|
||||
+ 1507 Negative delay Timer.schedule exception due to mismatched local and
|
||||
_logTimeZone values
|
||||
+ 1513 RolloverFileOutputStream can't handle multiple instances
|
||||
+ 1523 Update ALPN support for Java 8u131
|
||||
|
||||
jetty-9.4.4.v20170414 - 14 April 2017
|
||||
+ 612 Support HTTP Trailer
|
||||
+ 877 Programmatic servlet mappings cannot override mappings from
|
||||
|
@ -128,6 +128,13 @@ jetty-9.4.4.v20170414 - 14 April 2017
|
|||
+ 1472 Broken *.gz symlinks cause NPE in DefaultServlet
|
||||
+ 1475 SIOOBE in ContextHandler startup
|
||||
|
||||
jetty-9.3.18.v20170406 - 06 April 2017
|
||||
+ 877 Programmatic servlet mappings cannot override mappings from
|
||||
webdefault.xml using quickstart
|
||||
+ 1201 X-Forwarded-For incorrectly set in jetty-http-forwarded.xml
|
||||
+ 1417 Improve classloader dumping
|
||||
+ 1439 Allow UNC paths to function as Resource bases
|
||||
|
||||
jetty-9.4.3.v20170317 - 17 March 2017
|
||||
+ 329 Javadoc for HttpTester and ServletTester needs to reference limited HTTP
|
||||
version scope
|
||||
|
@ -156,18 +163,14 @@ jetty-9.4.3.v20170317 - 17 March 2017
|
|||
+ 1403 Move new CookieCompliance class to jetty-http
|
||||
+ 1405 Cookie name cannot be blank or null
|
||||
|
||||
jetty-9.3.18.v20170406 - 06 April 2017
|
||||
+ 877 Programmatic servlet mappings cannot override mappings from
|
||||
webdefault.xml using quickstart
|
||||
+ 1201 X-Forwarded-For incorrectly set in jetty-http-forwarded.xml
|
||||
+ 1417 Improve classloader dumping
|
||||
+ 1439 Allow UNC paths to function as Resource bases
|
||||
|
||||
jetty-9.3.17.v20170317 - 17 March 2017
|
||||
+ 329 Javadoc for HttpTester and ServletTester needs to reference limited HTTP
|
||||
version scope
|
||||
+ 609 websocket ClientCloseTest testServerNoCloseHandshake is failing
|
||||
+ 1015 Ensure jetty-distribution excludes git / temp files
|
||||
+ 1047 ReadPendingException and then thread death
|
||||
+ 1049 test-jetty-osgi test exits/crashes the surefire forked JVM
|
||||
+ 1282 ByteArrayEndPointTest.testIdle() failure
|
||||
+ 1296 Introduce HTTP parser "content complete" event
|
||||
+ 1326 Jetty shutdown command got NullPointerException (http2 module added to
|
||||
start)
|
||||
|
@ -185,7 +188,9 @@ jetty-9.3.17.v20170317 - 17 March 2017
|
|||
+ 1387 Windows and paxexam failure due to "renaming bundle"
|
||||
+ 1389 Update to gcloud datastore-0.9.4-beta
|
||||
+ 1390 HashLoginService and "this.web-inf.url" property are incompatible
|
||||
+ 1394 Default OS Locale/Encoding/Charset can cause test failures
|
||||
+ 1396 Set-Cookie produced by Jetty is invalid for RFC6265 and Chrome
|
||||
+ 1399 SlowClientTest is failing on CI
|
||||
+ 1401 HttpOutput.recycle() does not clear the write listener
|
||||
|
||||
jetty-9.4.2.v20170220 - 20 February 2017
|
||||
|
@ -275,17 +280,6 @@ jetty-9.4.1.v20170120 - 20 January 2017
|
|||
+ 1276 Remove org.eclipse.jetty.websocket.server.WebSocketServerFactory from
|
||||
SPI
|
||||
|
||||
jetty-9.4.0.v20161208 - 08 December 2016
|
||||
+ 1112 How config async support in jsp tag?
|
||||
+ 1124 Allow configuration of WebSocket mappings from Spring
|
||||
+ 1139 Support configuration of properties during --add-to-start
|
||||
+ 1146 jetty.server.HttpInput deadlock
|
||||
+ 1148 Support HTTP/2 HEADERS trailer
|
||||
+ 1151 NPE in ClasspathPattern.match()
|
||||
+ 1153 Make SessionData easier to subclass
|
||||
+ 123 AbstractSessionIdManager can't atomically check for uniqueness of new
|
||||
session ID
|
||||
|
||||
jetty-9.3.16.v20170120 - 20 January 2017
|
||||
+ 486 JDK 9 ALPN implementation
|
||||
+ 592 Support no-value Host header in HttpParser
|
||||
|
@ -300,6 +294,9 @@ jetty-9.3.16.v20170120 - 20 January 2017
|
|||
+ 1229 ClassLoader constraint issue when using NativeWebSocketConfiguration
|
||||
with WEB-INF/lib/jetty-http.jar present
|
||||
+ 1234 onBadMessage called from with handled message
|
||||
+ 1259 HostnameVerificationTest.simpleGetWithHostnameVerificationEnabledTest
|
||||
is broken
|
||||
+ 1261 Intermittent H2C test failure AsyncIOServletTest.testAsyncReadEarlyEOF
|
||||
+ 1262 BufferUtil.isMappedBuffer() uses reflection on private JDK fields
|
||||
+ 1265 JAXB not available in JDK 9
|
||||
+ 1267 Request.getRemoteUser can throw undeclared IllegalStateException via
|
||||
|
@ -313,6 +310,14 @@ jetty-9.3.16.v20170120 - 20 January 2017
|
|||
+ 1275 Get rid of Mockito
|
||||
+ 1276 Remove org.eclipse.jetty.websocket.server.WebSocketServerFactory from
|
||||
SPI
|
||||
+ 1277 http2 alpn test error
|
||||
|
||||
jetty-9.2.21.v20170120 - 20 January 2017
|
||||
+ 592 Support no-value Host header in HttpParser
|
||||
+ 1229 ClassLoader constraint issue when using NativeWebSocketConfiguration
|
||||
with WEB-INF/lib/jetty-http.jar present
|
||||
+ 1267 Request.getRemoteUser can throw undeclared IllegalStateException via
|
||||
DeferredAuthentication & FormAuthenticator
|
||||
|
||||
jetty-9.3.15.v20161220 - 20 December 2016
|
||||
+ 240 Missing content for multipart request after upgrade to Jetty > 9.2.7
|
||||
|
@ -341,6 +346,7 @@ jetty-9.3.15.v20161220 - 20 December 2016
|
|||
+ 1099 PushCacheFilter pushes POST requests
|
||||
+ 1108 Please improve logging in SslContextFactory when there are no approved
|
||||
cipher suites
|
||||
+ 1114 Add testcase for WSUF for stop/start of the Server
|
||||
+ 1118 Filter.destroy() conflicts with ContainerLifeCycle.destroy() in
|
||||
WebSocketUpgradeFilter
|
||||
+ 1123 Broken lifecycle for WebSocket's mappings
|
||||
|
@ -360,12 +366,27 @@ jetty-9.3.15.v20161220 - 20 December 2016
|
|||
+ 1186 Where can i find SocketConnector .java and
|
||||
BlockingChannelConnector.java etc?
|
||||
|
||||
jetty-9.2.21.v20170120 - 20 January 2017
|
||||
+ 592 Support no-value Host header in HttpParser
|
||||
+ 1229 ClassLoader constraint issue when using NativeWebSocketConfiguration
|
||||
with WEB-INF/lib/jetty-http.jar present
|
||||
+ 1267 Request.getRemoteUser can throw undeclared IllegalStateException via
|
||||
DeferredAuthentication & FormAuthenticator
|
||||
jetty-9.2.20.v20161216 - 16 December 2016
|
||||
+ 295 Ensure Jetty Client use of Deflater / Inflater calls .end() to avoid
|
||||
memory leak
|
||||
+ Reset Response buffer size
|
||||
+ 1051 NCSARequestLog/RolloverFileOutputStream does not roll day after DST
|
||||
ends
|
||||
+ 1057 Improve WebSocketUpgradeFilter fast path performance
|
||||
+ 1090 Allow WebSocketUpgradeFilter to be used by WEB-INF/web.xml
|
||||
+ 1124 Allow configuration of WebSocket mappings from Spring
|
||||
+ 1130 PROXY protocol support reports incorrect remote address
|
||||
|
||||
jetty-9.4.0.v20161208 - 08 December 2016
|
||||
+ 1112 How config async support in jsp tag?
|
||||
+ 1124 Allow configuration of WebSocket mappings from Spring
|
||||
+ 1139 Support configuration of properties during --add-to-start
|
||||
+ 1146 jetty.server.HttpInput deadlock
|
||||
+ 1148 Support HTTP/2 HEADERS trailer
|
||||
+ 1151 NPE in ClasspathPattern.match()
|
||||
+ 1153 Make SessionData easier to subclass
|
||||
+ 123 AbstractSessionIdManager can't atomically check for uniqueness of new
|
||||
session ID
|
||||
|
||||
jetty-9.4.0.RC3 - 05 December 2016
|
||||
+ 1051 NCSARequestLog/RolloverFileOutputStream does not roll day after DST
|
||||
|
@ -438,6 +459,23 @@ jetty-9.4.0.RC2 - 16 November 2016
|
|||
+ 1099 PushCacheFilter pushes POST requests
|
||||
+ 1103 AbstractNCSARequestLog reports too much of the Request URI
|
||||
|
||||
jetty-9.3.14.v20161028 - 28 October 2016
|
||||
+ 292 NPE in SslConnectionFactory newConnection
|
||||
+ 295 Ensure Jetty Client use of Deflater / Inflater calls .end() to avoid
|
||||
memory leak
|
||||
+ 989 InputStreamResponseListener.get() throws with HTTP/2 following redirect
|
||||
+ 1009 9.3.x] ThreadLimitHandler has no method setBlockForMs
|
||||
+ 1018 Remove dependency on asm types in oej.annotations.Util
|
||||
+ 1029 Restore Request.setHttpVersion()
|
||||
+ 1031 Improve HttpField pre-encoding
|
||||
+ 1032 Remove jetty dependencies in jetty jasper classes
|
||||
+ 1037 Don't execute AsyncListener.onTimeout events in spare Scheduler-Thread
|
||||
+ 1038 AttributeNormalizer does not favor ${WAR} over other attributes, like
|
||||
${jetty.base}
|
||||
+ 1039 AttributeNormalizer should not track attributes that are null
|
||||
+ 1046 Improve HTTP2Flusher error report
|
||||
+ 480764 Add extra tests for empty multipart
|
||||
|
||||
jetty-9.4.0.RC1 - 21 October 2016
|
||||
+ 277 Proxy servlet does not handle HTTP status 100 correctly
|
||||
+ 292 NPE in SslConnectionFactory newConnection
|
||||
|
@ -479,6 +517,27 @@ jetty-9.4.0.RC1 - 21 October 2016
|
|||
+ 1017 Output session configuration for dump
|
||||
+ 1018 Remove dependency on asm types in oej.annotations.Util
|
||||
|
||||
jetty-9.3.13.v20161014 - 14 October 2016
|
||||
+ 295 Ensure Jetty Client use of Deflater / Inflater calls .end() to avoid
|
||||
memory leak
|
||||
+ 926 No LSB Tags on jetty.sh script cause warning on Ubuntu 16.04
|
||||
+ 999 Create a Flight Recorder module
|
||||
+ 1000 Allow legacy behaviour if 2 servlets map to same path
|
||||
|
||||
jetty-9.3.13.M0 - 30 September 2016
|
||||
+ 277 Proxy servlet does not handle HTTP status 100 correctly
|
||||
+ 870 TLS protocol exclusion broken for SslContextFactory(String)
|
||||
+ 915 The jetty-maven-plugin:stop goal doesn't stop everything completely
|
||||
+ 918 Support certificates hot reload
|
||||
+ 930 Add module instructions to SSL section
|
||||
+ 943 Docs: Error in 'Embedding Jetty' page - example 'FileServer'
|
||||
+ 948 9.4.0.RC0 jetty-distribution invalid config etc/jetty-http2c.xml
|
||||
+ 955 Response listeners not invoked when using Connection.send()
|
||||
+ 959 CompleteListener invoked twice for HTTP/2 transport and response content
|
||||
+ 960 Async I/O spin when reading early EOF
|
||||
+ 965 Link from High Load docs to Garbage Collection Tuning is broken
|
||||
+ 966 Remove usages of ConcurrentArrayQueue
|
||||
|
||||
jetty-9.4.0.RC0 - 15 September 2016
|
||||
+ 131 Improve Connector Statistic names and values
|
||||
+ 572 Don't reject HTTP/2 requests without body in low threads mode
|
||||
|
@ -514,6 +573,54 @@ jetty-9.4.0.RC0 - 15 September 2016
|
|||
+ 922 Implements methods Connection.getBytes[In|Out]()
|
||||
+ 931 Update gcloud datastore to 0.3.0
|
||||
|
||||
jetty-9.3.12.v20160915 - 15 September 2016
|
||||
+ 56 Fix authn issues in LdapLoginModule
|
||||
+ 131 Improve Connector Statistic names and values
|
||||
+ 185 Implement RFC 7239 (Forwarded header)
|
||||
+ 700 Bundle org.eclipse.jetty.http.spi not available via p2 repository
|
||||
+ 725 Provide a private way to report security issues
|
||||
+ 752 Implement support for HTTP2 SETTINGS_MAX_HEADER_LIST_SIZE
|
||||
+ 759 Ensure wrapped Responses will close and commit outputstream or writer
|
||||
+ 780 The moved websocket PathSpec is incompatible with cometd 3.0.x
|
||||
+ 783 Report name of broken jar file
|
||||
+ 784 JSP Session updated before sendRedirect() lose their information
|
||||
+ 786 Buffering Response Handler
|
||||
+ 790 AsyncContentListener semantic broken with HTTP/2 transport
|
||||
+ 792 HTTP/2] Socket seems to be not closed completely
|
||||
+ 797 MimeTypes resource loading incorrect on OSGi
|
||||
+ 798 async IO Write closed race
|
||||
+ 804 setting default Url Encoding broken in Jetty >= 9.3
|
||||
+ 806 Jetty HttpClient authentication - missing any realm option
|
||||
+ 817 NPE in jndi Resource
|
||||
+ 826 Better default for HTTP/2's max concurrent streams
|
||||
+ 827 HTTPClient fails connecting to HTTPS host through an HTTP proxy
|
||||
w/authentication
|
||||
+ 830 Test webapp not properly copied to demo-base
|
||||
+ 832 ServerWithJNDI example uses wrong webapp
|
||||
+ 841 support reset in buffering interceptors
|
||||
+ 844 Implement a Thread Limit Handler
|
||||
+ 845 Improve blocking IO for data rate limiting
|
||||
+ 851 MBeanContainer no longer unregisters MBeans when "stopped"
|
||||
+ 854 If container.destroy() is called, calling container.start() again should
|
||||
throw an IllegalStateException
|
||||
+ 855 JMXify MBeanContainer
|
||||
+ 860 Only TLS 1.2 Supported
|
||||
+ 868 ClassLoader leak with Jetty and Karaf - static instances of
|
||||
java.lang.Throwable
|
||||
+ 880 Refactor jetty-http's HostPortHttpField logic into new jetty-util class
|
||||
+ 882 Add IPv6 support to IPAddressMap in jetty-util
|
||||
+ 889 ConstantThrowable.name can be removed
|
||||
+ 894 When adding servless class, preserve Class instead of going through
|
||||
String
|
||||
+ 897 Remove GzipHandler interceptor when out of scope
|
||||
+ 898 GzipHandler adds multiple Vary header
|
||||
+ 902 Expect: 100-Continue does not work with HTTP/2
|
||||
+ 909 Path and Domain not properly matched in addCookie()
|
||||
+ 911 Request.getRequestURI() gets decoded after startAsync(req, resp) is
|
||||
invoked
|
||||
+ 913 Unprotected debug in WebAppClassLoader
|
||||
+ 922 Implements methods Connection.getBytes[In|Out]()
|
||||
|
||||
jetty-9.4.0.M1 - 15 August 2016
|
||||
+ 185 Implement RFC 7239 (Forwarded header)
|
||||
+ 213 jetty.osgi.boot requires Server services registered before
|
||||
|
@ -614,6 +721,117 @@ jetty-9.4.0.M1 - 15 August 2016
|
|||
+ 837 Update to support apache jasper 8.5.4
|
||||
+ 841 support reset in buffering interceptors
|
||||
|
||||
jetty-9.3.11.v20160721 - 21 July 2016
|
||||
+ 230 customize Content-Type in ErrorHandler's default error page
|
||||
+ 592 Support no-value Host header in HttpParser
|
||||
+ 631 SLOTH protection
|
||||
+ 643 NPE in passing websocket client test
|
||||
+ 649 LDAPLoginModule should disallow blank username and password
|
||||
+ 658 Add memcached option for gcloud-sessions in jetty-9.3
|
||||
+ 660 NullPointerException in Request.getParameter: _parameters is null
|
||||
+ 663 Update gcloud datastore to 0.2.3
|
||||
+ 667 Introduce optional `jetty.deploy.monitoredPath` for jetty-deploy paths
|
||||
outside of ${jetty.base}
|
||||
+ 668 Introduce optional `jetty.deploy.defaultsDescriptorPath` for
|
||||
jetty-deploy defaults descriptor outside of ${jetty.home}
|
||||
+ 669 Support UNC paths in PathResource
|
||||
+ 671 Incorrect ALPN default protocol
|
||||
+ 672 Allow logging configuration announcement to be programmatically disabled
|
||||
+ 673 ClasspathPattern needs a match all pattern
|
||||
+ 675 Slf4jLog.ignore() should produce at DEBUG level
|
||||
+ 676 JavaUtilLog.ignore() should produce at DEBUG level
|
||||
+ 677 Logging of .ignore() should indicate that it was an "Ignored Exception"
|
||||
+ 678 Log at less than DEBUG level when annotation scanning takes significant
|
||||
time
|
||||
+ 682 Quickstart should not scan all container path jars
|
||||
+ 684 HttpClient proxies (HttpProxy and Socks4Proxy) do not support
|
||||
authentication
|
||||
+ 685 SecureRequestCustomizer SSLSession attribute not set
|
||||
+ 687 AllowSymLinkAliasChecker not normalizing relative symlinks properly
|
||||
+ 690 jetty-maven-plugin does not configure AnnotationConfiguration for
|
||||
jetty:effective-web-xml goal
|
||||
+ 693 QoSFilterTest failures are not capture by junit
|
||||
+ 694 http2.client.StreamResetTest.testServerExceptionConsumesQueuedData stack
|
||||
not suppressed in test
|
||||
+ 695 Deprecate LocalConnector.getResponses() in favor of using .getResponse()
|
||||
+ 696 LocalConnector.getResponse() doesn't find close if using HTTP/1.1
|
||||
w/Connection: close
|
||||
+ 701 Document CachingWebAppClassLoader
|
||||
+ 706 org.apache.jasper.compiler.disablejsr199 is no longer present in Jetty
|
||||
9.3+
|
||||
+ 708 SslContextFactory: newSslServerSocket/newSslSocket customization
|
||||
+ 717 GzipHandler.minGzipSize still compresses small responses
|
||||
+ 718 Document HttpClient transports
|
||||
+ 720 asciiToLowerCase throws NullPointerException
|
||||
+ 721 HTTP Response header value encoding is invalid for RFC7230
|
||||
+ 723 Improve bad/missing mime.properties reporting
|
||||
+ 726 Http2 Client parse error
|
||||
+ 730 "Slow" client causes IllegalStateException
|
||||
+ 733 Allow setCharacterEncoding after getOutputStream
|
||||
+ 739 Illegal WindowUpdate frame with delta=0
|
||||
+ 742 Fixed link to webtide.com
|
||||
+ 745 Removed README.txt
|
||||
+ 747 Update documentation to reflect TLS and SSL support
|
||||
+ 751 Remove usages of ArrayQueue
|
||||
+ 752 Implement support for HTTP2 SETTINGS_MAX_HEADER_LIST_SIZE
|
||||
+ 755 NPE in HttpChannelOverHTTP2.requestContent()
|
||||
+ 756 Filter problematic headers from CGI and FastCGIProxy
|
||||
|
||||
jetty-9.2.19.v20160908 - 08 September 2016
|
||||
+ 817 NPE in jndi Resource
|
||||
+ 830 Test webapp not properly copied to demo-base
|
||||
+ 832 ServerWithJNDI example uses wrong webapp
|
||||
+ 851 MBeanContainer no longer unregisters MBeans when "stopped"
|
||||
+ 868 ClassLoader leak with Jetty and Karaf - static instances of
|
||||
java.lang.Throwable
|
||||
+ 880 Refactor jetty-http's HostPortHttpField logic into new jetty-util class
|
||||
+ 882 Add IPv6 support to IPAddressMap in jetty-util
|
||||
+ 894 When adding servless class, preserve Class instead of going through
|
||||
String
|
||||
+ 899 PathFinderTest fails in jetty-9.2.x
|
||||
|
||||
jetty-9.2.18.v20160721 - 21 July 2016
|
||||
+ 425 Incorrect @ServerEndpoint Encoder/Decoder lifecycle
|
||||
+ 649 LDAPLoginModule should disallow blank username and password
|
||||
+ 654 Jetty 9.3 ServletContext.getResourceAsStream("/") returns an unusable
|
||||
stream
|
||||
+ 661 JsrExtension is missing hashCode() and equals()
|
||||
+ 756 Filter problematic headers from CGI and FastCGIProxy
|
||||
|
||||
jetty-9.3.11.M0 - 22 June 2016
|
||||
+ 425 Incorrect @ServerEndpoint Encoder/Decoder lifecycle
|
||||
+ 624 AsyncContext.onCompleted called twice
|
||||
+ 645 jetty-requestlog.xml default log path
|
||||
+ 654 Jetty 9.3 ServletContext.getResourceAsStream("/") returns an unusable
|
||||
stream
|
||||
+ 659 CONNECT request fails spuriously
|
||||
+ 660 NullPointerException in Request.getParameter: _parameters is null
|
||||
+ 661 JsrExtension is missing hashCode() and equals()
|
||||
|
||||
jetty-9.3.10.v20160621 - 21 June 2016
|
||||
+ 388 Add methods to send text frames with pre-encoded strings
|
||||
+ 605 Guard concurrent calls to WebSocketSession.close()
|
||||
+ 608 reset encoding set from content type?
|
||||
+ 609 websocket ClientCloseTest testServerNoCloseHandshake is failing
|
||||
+ 610 HttpClientRedirectTest/testRedirectWithWrongScheme test failing in CI
|
||||
+ 620 Missing call to setPattern in RewritePatternRule constructor
|
||||
+ 622 NoSqlSessionManager test for expired session does not use
|
||||
session.maxInactiveInterval
|
||||
+ 623 Add --gzip suffix to 304 responses with ETAGs
|
||||
+ 624 AsyncContext.onCompleted called twice
|
||||
+ 628 IOException: Unable to open root Jar file
|
||||
MetaInfConfiguration.getTlds(MetaInfConfiguration.java:406) with Spring boot
|
||||
loader + WebAppContext + non-expanded war
|
||||
+ 632 JMX tests rely on fixed port
|
||||
+ 633 If jmx and websocket is enabled, redploying a context produces a
|
||||
NullPointerException
|
||||
+ 638 ConnectHandler responses should have Content-Length
|
||||
+ 639 ServerContainer stores WebSocket sessions twice
|
||||
+ 640 ClientContainer should store WebSocket sessions as beans
|
||||
+ 641 MongoSessionIdManager uses deprecated ensureIndex
|
||||
+ 647 HTTP/2 CONTINUATION frame parsing throws IllegalStateException
|
||||
+ 648 Problem using InputStreamResponseListener to handle HTTP/2 responses
|
||||
|
||||
jetty-9.4.0.M0 - 03 June 2016
|
||||
+ 356 Element error-page/location must start with a '/'
|
||||
+ 360 Improve HTTP/2 stream interleaving
|
||||
|
@ -687,203 +905,6 @@ jetty-9.4.0.M0 - 03 June 2016
|
|||
+ 605 Guard concurrent calls to WebSocketSession.close()
|
||||
+ 608 reset encoding set from content type
|
||||
|
||||
jetty-9.2.20.v20161216 - 16 December 2016
|
||||
+ 295 Ensure Jetty Client use of Deflater / Inflater calls .end() to avoid
|
||||
memory leak
|
||||
+ Reset Response buffer size
|
||||
+ 1051 NCSARequestLog/RolloverFileOutputStream does not roll day after DST
|
||||
ends
|
||||
+ 1057 Improve WebSocketUpgradeFilter fast path performance
|
||||
+ 1090 Allow WebSocketUpgradeFilter to be used by WEB-INF/web.xml
|
||||
+ 1124 Allow configuration of WebSocket mappings from Spring
|
||||
+ 1130 PROXY protocol support reports incorrect remote address
|
||||
|
||||
jetty-9.3.14.v20161028 - 28 October 2016
|
||||
+ 292 NPE in SslConnectionFactory newConnection
|
||||
+ 295 Ensure Jetty Client use of Deflater / Inflater calls .end() to avoid
|
||||
memory leak
|
||||
+ 989 InputStreamResponseListener.get() throws with HTTP/2 following redirect
|
||||
+ 1009 9.3.x] ThreadLimitHandler has no method setBlockForMs
|
||||
+ 1018 Remove dependency on asm types in oej.annotations.Util
|
||||
+ 1029 Restore Request.setHttpVersion()
|
||||
+ 1031 Improve HttpField pre-encoding
|
||||
+ 1032 Remove jetty dependencies in jetty jasper classes
|
||||
+ 1037 Don't execute AsyncListener.onTimeout events in spare Scheduler-Thread
|
||||
+ 1038 AttributeNormalizer does not favor ${WAR} over other attributes, like
|
||||
${jetty.base}
|
||||
+ 1039 AttributeNormalizer should not track attributes that are null
|
||||
+ 1046 Improve HTTP2Flusher error report
|
||||
|
||||
jetty-9.3.13.v20161014 - 14 October 2016
|
||||
+ 295 Ensure Jetty Client use of Deflater / Inflater calls .end() to avoid
|
||||
memory leak
|
||||
+ 926 No LSB Tags on jetty.sh script cause warning on Ubuntu 16.04
|
||||
+ 999 Create a Flight Recorder module
|
||||
+ 1000 Allow legacy behaviour if 2 servlets map to same path
|
||||
|
||||
jetty-9.3.13.M0 - 30 September 2016
|
||||
+ 277 Proxy servlet does not handle HTTP status 100 correctly
|
||||
+ 870 TLS protocol exclusion broken for SslContextFactory(String)
|
||||
+ 915 The jetty-maven-plugin:stop goal doesn't stop everything completely
|
||||
+ 918 Support certificates hot reload
|
||||
+ 930 Add module instructions to SSL section
|
||||
+ 943 Docs: Error in 'Embedding Jetty' page - example 'FileServer'
|
||||
+ 948 9.4.0.RC0 jetty-distribution invalid config etc/jetty-http2c.xml
|
||||
+ 955 Response listeners not invoked when using Connection.send()
|
||||
+ 959 CompleteListener invoked twice for HTTP/2 transport and response content
|
||||
+ 960 Async I/O spin when reading early EOF
|
||||
+ 965 Link from High Load docs to Garbage Collection Tuning is broken
|
||||
+ 966 Remove usages of ConcurrentArrayQueue
|
||||
|
||||
jetty-9.3.12.v20160915 - 15 September 2016
|
||||
+ 56 Fix authn issues in LdapLoginModule
|
||||
+ 131 Improve Connector Statistic names and values
|
||||
+ 185 Implement RFC 7239 (Forwarded header)
|
||||
+ 700 Bundle org.eclipse.jetty.http.spi not available via p2 repository
|
||||
+ 725 Provide a private way to report security issues
|
||||
+ 752 Implement support for HTTP2 SETTINGS_MAX_HEADER_LIST_SIZE
|
||||
+ 759 Ensure wrapped Responses will close and commit outputstream or writer
|
||||
+ 780 The moved websocket PathSpec is incompatible with cometd 3.0.x
|
||||
+ 783 Report name of broken jar file
|
||||
+ 784 JSP Session updated before sendRedirect() lose their information
|
||||
+ 786 Buffering Response Handler
|
||||
+ 790 AsyncContentListener semantic broken with HTTP/2 transport
|
||||
+ 792 HTTP/2] Socket seems to be not closed completely
|
||||
+ 797 MimeTypes resource loading incorrect on OSGi
|
||||
+ 798 async IO Write closed race
|
||||
+ 804 setting default Url Encoding broken in Jetty >= 9.3
|
||||
+ 806 Jetty HttpClient authentication - missing any realm option
|
||||
+ 817 NPE in jndi Resource
|
||||
+ 826 Better default for HTTP/2's max concurrent streams
|
||||
+ 827 HTTPClient fails connecting to HTTPS host through an HTTP proxy
|
||||
w/authentication
|
||||
+ 830 Test webapp not properly copied to demo-base
|
||||
+ 832 ServerWithJNDI example uses wrong webapp
|
||||
+ 841 support reset in buffering interceptors
|
||||
+ 844 Implement a Thread Limit Handler
|
||||
+ 845 Improve blocking IO for data rate limiting
|
||||
+ 851 MBeanContainer no longer unregisters MBeans when "stopped"
|
||||
+ 854 If container.destroy() is called, calling container.start() again should
|
||||
throw an IllegalStateException
|
||||
+ 855 JMXify MBeanContainer
|
||||
+ 860 Only TLS 1.2 Supported
|
||||
+ 868 ClassLoader leak with Jetty and Karaf - static instances of
|
||||
java.lang.Throwable
|
||||
+ 880 Refactor jetty-http's HostPortHttpField logic into new jetty-util class
|
||||
+ 882 Add IPv6 support to IPAddressMap in jetty-util
|
||||
+ 889 ConstantThrowable.name can be removed
|
||||
+ 894 When adding servless class, preserve Class instead of going through
|
||||
String
|
||||
+ 897 Remove GzipHandler interceptor when out of scope
|
||||
+ 898 GzipHandler adds multiple Vary header
|
||||
+ 902 Expect: 100-Continue does not work with HTTP/2
|
||||
+ 909 Path and Domain not properly matched in addCookie()
|
||||
+ 911 Request.getRequestURI() gets decoded after startAsync(req, resp) is
|
||||
invoked
|
||||
+ 913 Unprotected debug in WebAppClassLoader
|
||||
+ 922 Implements methods Connection.getBytes[In|Out]()
|
||||
|
||||
jetty-9.3.11.v20160721 - 21 July 2016
|
||||
+ 230 customize Content-Type in ErrorHandler's default error page
|
||||
+ 592 Support no-value Host header in HttpParser
|
||||
+ 631 SLOTH protection
|
||||
+ 649 LDAPLoginModule should disallow blank username and password
|
||||
+ 658 Add memcached option for gcloud-sessions in jetty-9.3
|
||||
+ 660 NullPointerException in Request.getParameter: _parameters is null
|
||||
+ 663 Update gcloud datastore to 0.2.3
|
||||
+ 667 Introduce optional `jetty.deploy.monitoredPath` for jetty-deploy paths
|
||||
outside of ${jetty.base}
|
||||
+ 668 Introduce optional `jetty.deploy.defaultsDescriptorPath` for
|
||||
jetty-deploy defaults descriptor outside of ${jetty.home}
|
||||
+ 669 Support UNC paths in PathResource
|
||||
+ 671 Incorrect ALPN default protocol
|
||||
+ 672 Allow logging configuration announcement to be programmatically disabled
|
||||
+ 673 ClasspathPattern needs a match all pattern
|
||||
+ 675 Slf4jLog.ignore() should produce at DEBUG level
|
||||
+ 676 JavaUtilLog.ignore() should produce at DEBUG level
|
||||
+ 677 Logging of .ignore() should indicate that it was an "Ignored Exception"
|
||||
+ 678 Log at less than DEBUG level when annotation scanning takes significant
|
||||
time
|
||||
+ 682 Quickstart should not scan all container path jars
|
||||
+ 684 HttpClient proxies (HttpProxy and Socks4Proxy) do not support
|
||||
authentication
|
||||
+ 685 SecureRequestCustomizer SSLSession attribute not set
|
||||
+ 687 AllowSymLinkAliasChecker not normalizing relative symlinks properly
|
||||
+ 690 jetty-maven-plugin does not configure AnnotationConfiguration for
|
||||
jetty:effective-web-xml goal
|
||||
+ 695 Deprecate LocalConnector.getResponses() in favor of using .getResponse()
|
||||
+ 696 LocalConnector.getResponse() doesn't find close if using HTTP/1.1
|
||||
w/Connection: close
|
||||
+ 701 Document CachingWebAppClassLoader
|
||||
+ 706 org.apache.jasper.compiler.disablejsr199 is no longer present in Jetty
|
||||
9.3+
|
||||
+ 708 SslContextFactory: newSslServerSocket/newSslSocket customization
|
||||
+ 717 GzipHandler.minGzipSize still compresses small responses
|
||||
+ 718 Document HttpClient transports
|
||||
+ 720 asciiToLowerCase throws NullPointerException
|
||||
+ 721 HTTP Response header value encoding is invalid for RFC7230
|
||||
+ 723 Improve bad/missing mime.properties reporting
|
||||
+ 726 Http2 Client parse error
|
||||
+ 730 "Slow" client causes IllegalStateException
|
||||
+ 733 Allow setCharacterEncoding after getOutputStream
|
||||
+ 739 Illegal WindowUpdate frame with delta=0
|
||||
+ 742 Fixed link to webtide.com
|
||||
+ 745 Removed README.txt
|
||||
+ 747 Update documentation to reflect TLS and SSL support
|
||||
+ 751 Remove usages of ArrayQueue
|
||||
+ 752 Implement support for HTTP2 SETTINGS_MAX_HEADER_LIST_SIZE
|
||||
+ 755 NPE in HttpChannelOverHTTP2.requestContent()
|
||||
+ 756 Filter problematic headers from CGI and FastCGIProxy
|
||||
|
||||
jetty-9.2.19.v20160908 - 08 September 2016
|
||||
+ 817 NPE in jndi Resource
|
||||
+ 830 Test webapp not properly copied to demo-base
|
||||
+ 832 ServerWithJNDI example uses wrong webapp
|
||||
+ 851 MBeanContainer no longer unregisters MBeans when "stopped"
|
||||
+ 868 ClassLoader leak with Jetty and Karaf - static instances of
|
||||
java.lang.Throwable
|
||||
+ 880 Refactor jetty-http's HostPortHttpField logic into new jetty-util class
|
||||
+ 882 Add IPv6 support to IPAddressMap in jetty-util
|
||||
+ 894 When adding servless class, preserve Class instead of going through
|
||||
String
|
||||
|
||||
jetty-9.2.18.v20160721 - 21 July 2016
|
||||
+ 425 Incorrect @ServerEndpoint Encoder/Decoder lifecycle
|
||||
+ 649 LDAPLoginModule should disallow blank username and password
|
||||
+ 654 Jetty 9.3 ServletContext.getResourceAsStream("/") returns an unusable
|
||||
stream
|
||||
+ 661 JsrExtension is missing hashCode() and equals()
|
||||
+ 756 Filter problematic headers from CGI and FastCGIProxy
|
||||
|
||||
jetty-9.3.11.M0 - 22 June 2016
|
||||
+ 425 Incorrect @ServerEndpoint Encoder/Decoder lifecycle
|
||||
+ 624 AsyncContext.onCompleted called twice
|
||||
+ 645 jetty-requestlog.xml default log path
|
||||
+ 654 Jetty 9.3 ServletContext.getResourceAsStream("/") returns an unusable
|
||||
stream
|
||||
+ 659 CONNECT request fails spuriously
|
||||
+ 660 NullPointerException in Request.getParameter: _parameters is null
|
||||
+ 661 JsrExtension is missing hashCode() and equals()
|
||||
|
||||
jetty-9.3.10.v20160621 - 21 June 2016
|
||||
+ 388 Add methods to send text frames with pre-encoded strings
|
||||
+ 605 Guard concurrent calls to WebSocketSession.close()
|
||||
+ 608 reset encoding set from content type?
|
||||
+ 620 Missing call to setPattern in RewritePatternRule constructor
|
||||
+ 623 Add --gzip suffix to 304 responses with ETAGs
|
||||
+ 624 AsyncContext.onCompleted called twice
|
||||
+ 628 IOException: Unable to open root Jar file
|
||||
MetaInfConfiguration.getTlds(MetaInfConfiguration.java:406) with Spring boot
|
||||
loader + WebAppContext + non-expanded war
|
||||
+ 633 If jmx and websocket is enabled, redploying a context produces a
|
||||
NullPointerException
|
||||
+ 638 ConnectHandler responses should have Content-Length
|
||||
+ 639 ServerContainer stores WebSocket sessions twice
|
||||
+ 640 ClientContainer should store WebSocket sessions as beans
|
||||
+ 641 MongoSessionIdManager uses deprecated ensureIndex
|
||||
+ 647 HTTP/2 CONTINUATION frame parsing throws IllegalStateException
|
||||
+ 648 Problem using InputStreamResponseListener to handle HTTP/2 responses
|
||||
|
||||
jetty-9.3.10.M0 - 26 May 2016
|
||||
+ 354 Spin loop in case of exception thrown during accept()
|
||||
+ 464 Improve reporting of SSLHandshakeException
|
||||
|
@ -916,6 +937,7 @@ jetty-9.3.9.v20160517 - 17 May 2016
|
|||
+ 558 HTTP/2 server hangs when thread pool is low on threads
|
||||
+ 560 Jetty Client Proxy Authentication does not work with HTTP Proxy
|
||||
tunneling
|
||||
+ 561 Fixed test timer
|
||||
+ 567 NPE in ErrorPageErrorHandler debug
|
||||
+ 570 URIUtil.encodePath does not always encode utf8 chars
|
||||
+ 571 AbstractAuthentication.matchesURI() fails to match scheme
|
||||
|
@ -961,6 +983,8 @@ jetty-9.3.9.M1 - 11 April 2016
|
|||
+ 418 Add osgi capability for endpoint configurator
|
||||
+ 424 Jetty impl. of Websocket ServerEndpointConfig.Configurator lifecycle out
|
||||
of spec
|
||||
+ 427 Squelch intentional exceptions seen during websocket testing
|
||||
+ 434 RequestTest stack traces
|
||||
+ 435 adjust debug log message
|
||||
+ 437 Avoid NPE on receiving empty message though MessageHandler.Partial
|
||||
+ 438 File and Path Resources with control characters should be rejected
|
||||
|
@ -980,6 +1004,7 @@ jetty-9.3.9.M1 - 11 April 2016
|
|||
+ 476 HttpClient should not send absolute-form target with non HttpProxy
|
||||
|
||||
jetty-9.3.8.v20160314 - 14 March 2016
|
||||
+ 107 ResourceHandler range support testcase
|
||||
+ 124 Don't produce text/html if the request doesn't accept it
|
||||
+ 247 improving invalid buffer manipulation exception messages
|
||||
+ 258 Http request to origin server over https proxy contains absolute URL
|
||||
|
@ -988,6 +1013,8 @@ jetty-9.3.8.v20160314 - 14 March 2016
|
|||
+ 305 NPE when notifying the session listener if the channel is closed before
|
||||
a session has been opened
|
||||
+ 316 Add *.chm mimetype mapping
|
||||
+ 343 ensure release deployment of test-jetty-webapp:war and
|
||||
test-proxy-webapp:war
|
||||
+ 346 HttpParser RFC2616 Compliance mode
|
||||
+ 353 Jetty Client doesn't forward authentication headers with redirects when
|
||||
using proxy
|
||||
|
@ -1006,6 +1033,7 @@ jetty-9.3.8.v20160314 - 14 March 2016
|
|||
+ 386 Explicit Authorization header is dropped when handling 407s
|
||||
+ 397 Multipart EOF handling
|
||||
+ 402 Don't use Thread.isAlive() in ShutdownMonitor
|
||||
+ 405 adding testcase for problematic HttpURI parsing of path params
|
||||
+ 406 GzipHandler: allow to override the Vary response header
|
||||
+ 407 JSR356 Server WebSocket Sessions no longer being tracked
|
||||
+ 408 Http client does not work on https with proxy
|
||||
|
@ -1100,6 +1128,7 @@ jetty-9.3.7.RC0 - 05 January 2016
|
|||
+ 482243 Fixed GzipHandler for Include
|
||||
+ 482270 Expose upgrade request locales
|
||||
+ 482272 Fixed relative symlink checking
|
||||
+ 482506 HTTP/2 load test with h2load fails
|
||||
+ 482670 HttpURI wrongly parser URI paths starting with /@
|
||||
+ 482855 Content-Length omitted for POST requests with empty body
|
||||
+ 482959 Local stream count never decrements when closing a stream causing
|
||||
|
@ -1420,6 +1449,8 @@ jetty-9.3.0.v20150612 - 12 June 2015
|
|||
+ 452503 Start.jar --add-to-start=jstl results in GraphException: Unable to
|
||||
expand property in name: jsp-impl/${jsp-impl}-jstl
|
||||
+ 453487 Recycle HttpChannelOverHTTP2
|
||||
+ 453627 Fixed FileSystem test for nanosecond filesystems
|
||||
+ 453636 Improved spin detection on test
|
||||
+ 453829 Added HeaderRegexRule
|
||||
+ 453834 CDI Support for WebSocket
|
||||
+ 454152 Remove mux remnants from WebSocketClient
|
||||
|
@ -1430,6 +1461,7 @@ jetty-9.3.0.v20150612 - 12 June 2015
|
|||
+ 456956 Reduce ThreadLocal.remove() weak reference garbage
|
||||
+ 457130 HTTPS request with IP host and HTTP proxy throws
|
||||
IllegalArgumentException.
|
||||
+ 457309 Add test to ensure GET and HEAD response headers same for gzip
|
||||
+ 457508 Add flag to scan exploded jars in jetty-jspc-maven-plugin
|
||||
+ 457788 Powered By in o.e.j.util.Jetty conditional on sendServerVersion
|
||||
+ 458478 JarFileResource improve performance of exist method
|
||||
|
|
|
@ -2,108 +2,121 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.eclipse.jetty.aggregate</groupId>
|
||||
<artifactId>jetty-all</artifactId>
|
||||
<name>Jetty :: Aggregate :: All core Jetty</name>
|
||||
<description>UberJar for Core Jetty features</description>
|
||||
<packaging>pom</packaging>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<properties>
|
||||
<uber-jar>${project.build.directory}/${project.artifactId}-${project.version}-uber.jar</uber-jar>
|
||||
<gen-resources-dir>${project.build.directory}/gen-resources</gen-resources-dir>
|
||||
</properties>
|
||||
<build>
|
||||
<sourceDirectory>${project.build.directory}/sources</sourceDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unpack-dependencies</id>
|
||||
<id>massage-manifest</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<excludes>**/MANIFEST.MF,javax/**</excludes>
|
||||
<excludeArtifactIds>javax</excludeArtifactIds>
|
||||
<excludeGroupIds>javax,org.eclipse.jetty.orbit,org.mortbay.jetty.npn,org.slf4j,org.ow2.asm</excludeGroupIds>
|
||||
<outputDirectory>${project.build.directory}/classes</outputDirectory>
|
||||
<overWriteReleases>false</overWriteReleases>
|
||||
<overWriteSnapshots>true</overWriteSnapshots>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>unpack-source</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<classifier>sources</classifier>
|
||||
<includes>**/*</includes>
|
||||
<excludes>META-INF/**,**/Servlet3Continuation*,**/Jetty6Continuation*</excludes>
|
||||
<includeGroupIds>org.eclipse.jetty,org.eclipse.jetty.websocket</includeGroupIds>
|
||||
<excludeArtifactIds>javax</excludeArtifactIds>
|
||||
<excludeGroupIds>javax,org.eclipse.jetty.orbit,org.mortbay.jetty.npn,org.slf4j,org.ow2.asm</excludeGroupIds>
|
||||
<outputDirectory>${project.build.directory}/sources</outputDirectory>
|
||||
<overWriteReleases>true</overWriteReleases>
|
||||
<overWriteSnapshots>true</overWriteSnapshots>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins
|
||||
</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>package</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
</manifest>
|
||||
<manifestEntries>
|
||||
<mode>development</mode>
|
||||
<url>http://eclipse.org/jetty</url>
|
||||
<Built-By>${user.name}</Built-By>
|
||||
<package>org.eclipse.jetty</package>
|
||||
<Bundle-License>http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/NOTICE.txt</Bundle-License>
|
||||
<Bundle-Name>Jetty</Bundle-Name>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
<outputDirectory>${gen-resources-dir}</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-build-support</artifactId>
|
||||
<version>1.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>javadoc-jar</id>
|
||||
<phase>compile</phase>
|
||||
<id>uberjar</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<shadedArtifactAttached>true</shadedArtifactAttached>
|
||||
<shadedClassifierName>uber</shadedClassifierName>
|
||||
<outputFile>${uber-jar}</outputFile>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
|
||||
<transformer implementation="org.eclipse.jetty.toolchain.shade.IncludeDirectoryTransformer">
|
||||
<directory>${gen-resources-dir}</directory>
|
||||
</transformer>
|
||||
</transformers>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/LICENSE.txt</exclude>
|
||||
<exclude>META-INF/*.MF</exclude>
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
<artifactSet>
|
||||
<excludes>
|
||||
<exclude>javax:*</exclude>
|
||||
<exclude>org.eclipse.jetty.orbit:*</exclude>
|
||||
<exclude>org.mortbay.jetty:*</exclude>
|
||||
<exclude>org.mortbay.jetty.alpn:*</exclude>
|
||||
<exclude>org.slf4j:*</exclude>
|
||||
<exclude>org.ow2.asm:*</exclude>
|
||||
<exclude>*:javax</exclude>
|
||||
</excludes>
|
||||
</artifactSet>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-artifacts</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>attach-artifact</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifacts>
|
||||
<artifact>
|
||||
<file>${uber-jar}</file>
|
||||
<type>jar</type>
|
||||
<classifier>uber</classifier>
|
||||
</artifact>
|
||||
</artifacts>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
|
@ -111,120 +124,109 @@
|
|||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-deploy</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-servlet</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>javax-websocket-server-impl</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.spdy</groupId>
|
||||
<artifactId>spdy-http-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jmx</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-plus</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-annotations</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-util</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jaspi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jndi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-rewrite</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlets</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-quickstart</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- websocket support -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-servlet</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>javax-websocket-server-impl</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<!-- http/2 support -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-alpn-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.http2</groupId>
|
||||
<artifactId>http2-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.http2</groupId>
|
||||
<artifactId>http2-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<!-- dependencies that jetty-all needs (some optional) -->
|
||||
<dependency>
|
||||
<groupId>javax.websocket</groupId>
|
||||
<artifactId>javax.websocket-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.transaction</groupId>
|
||||
<artifactId>javax.transaction-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>javax.mail.glassfish</artifactId>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>apache-jsp</artifactId>
|
||||
|
@ -18,62 +18,32 @@
|
|||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate-manifest</id>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-Description>Jetty-specific ServletContainerInitializer for Jasper</Bundle-Description>
|
||||
<Export-Package>org.eclipse.jetty.apache.jsp.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}",
|
||||
<Export-Package>org.eclipse.jetty.apache.jsp.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}",
|
||||
org.eclipse.jetty.jsp.*;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
|
||||
</Export-Package>
|
||||
<Require-Capability>osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)"</Require-Capability>
|
||||
<Provide-Capability>osgi.serviceloader; osgi.serviceloader=javax.servlet.ServletContainerInitializer</Provide-Capability>
|
||||
<Provide-Capability>osgi.serviceloader;osgi.serviceloader=javax.servlet.ServletContainerInitializer,osgi.serviceloader;osgi.serviceloader=org.apache.juli.logging.Log</Provide-Capability>
|
||||
<_nouses>true</_nouses>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>artifact-jar</id>
|
||||
<id>nolog-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-jar</id>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
<classifier>nolog</classifier>
|
||||
<excludes>
|
||||
<exclude>META-INF/services/org.apache.juli.logging.Log</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
@ -94,12 +64,7 @@
|
|||
<artifactId>jetty-util</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Schemas -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
|
@ -120,8 +85,28 @@
|
|||
|
||||
<!-- Eclipse Java Compiler (for JSP Compilation) -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>org.eclipse.jdt.core</artifactId>
|
||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
||||
<artifactId>ecj</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- tests -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlet</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlet</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-test-helper</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -2,32 +2,25 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>apache-jstl</artifactId>
|
||||
<name>Apache :: JSTL module</name>
|
||||
<url>http://tomcat.apache.org/taglibs/standard/</url>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.apache.jstl</bundle-symbolic-name>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<useSystemClassLoader>false</useSystemClassLoader>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
|
@ -51,6 +44,34 @@
|
|||
<groupId>org.apache.taglibs</groupId>
|
||||
<artifactId>taglibs-standard-impl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-test-helper</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>apache-jsp</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-annotations</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-webapp</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>example-async-rest</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.eclipse.jetty.example-async-rest</groupId>
|
||||
|
@ -10,6 +10,9 @@
|
|||
<packaging>jar</packaging>
|
||||
<name>Example Async Rest :: Jar</name>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.examples.asyc.rest</bundle-symbolic-name>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>example-async-rest</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.eclipse.jetty.example-async-rest</groupId>
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty.examples</groupId>
|
||||
<artifactId>examples-parent</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>example-async-rest</artifactId>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty.examples</groupId>
|
||||
<artifactId>examples-parent</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -11,7 +11,17 @@
|
|||
<name>Example :: Jetty Embedded</name>
|
||||
<description>Jetty Embedded Examples</description>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.embedded</bundle-symbolic-name>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>18.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-util-ajax</artifactId>
|
||||
|
@ -37,6 +47,11 @@
|
|||
<artifactId>jetty-deploy</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-rewrite</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jmx</artifactId>
|
||||
|
@ -53,8 +68,18 @@
|
|||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.spdy</groupId>
|
||||
<artifactId>spdy-http-server</artifactId>
|
||||
<groupId>org.eclipse.jetty.http2</groupId>
|
||||
<artifactId>http2-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.alpn</groupId>
|
||||
<artifactId>alpn-api</artifactId>
|
||||
<version>${alpn.api.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-alpn-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -105,5 +130,12 @@
|
|||
<artifactId>jetty-test-helper</artifactId>
|
||||
<!-- scope>test</scope-->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-http</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -1,27 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
// ========================================================================
|
||||
// Copyright (c) Webtide LLC
|
||||
//
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0.txt
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<groupId>org.eclipse.jetty.examples</groupId>
|
||||
|
@ -42,7 +25,7 @@
|
|||
</build>
|
||||
<modules>
|
||||
<!--
|
||||
- The async-rest and embedded are examples that have historical locations,
|
||||
- The async-rest and embedded are examples that have historical locations,
|
||||
- new ones should appear nested under o.e.jetty.examples groupId
|
||||
-->
|
||||
<module>async-rest</module>
|
||||
|
|
|
@ -2,13 +2,11 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-alpn-parent</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-alpn-client</artifactId>
|
||||
<name>Jetty :: ALPN Client</name>
|
||||
<description>Jetty ALPN client services</description>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<name>Jetty :: ALPN :: Client</name>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.alpn.client</bundle-symbolic-name>
|
||||
</properties>
|
||||
|
@ -31,15 +29,6 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- always include the sources to be able to prepare the eclipse-jetty-SDK feature
|
||||
with a snapshot. -->
|
||||
<plugin>
|
||||
|
|
|
@ -2,62 +2,16 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-alpn-parent</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-alpn-server</artifactId>
|
||||
<name>Jetty :: ALPN Server</name>
|
||||
<description>Jetty ALPN server services</description>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<name>Jetty :: ALPN :: Server</name>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.alpn.server</bundle-symbolic-name>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>org.eclipse.jetty.alpn,*</Import-Package>
|
||||
<_nouses>true</_nouses>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- always include the sources to be able to prepare the eclipse-jetty-SDK feature
|
||||
with a snapshot. -->
|
||||
<plugin>
|
||||
|
@ -71,6 +25,32 @@
|
|||
<onlyAnalyze>org.eclipse.jetty.alpn.*</onlyAnalyze>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>parse-version</id>
|
||||
<goals>
|
||||
<goal>parse-version</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<propertyPrefix>alpn</propertyPrefix>
|
||||
<versionString>${alpn.api.version}</versionString>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-SymbolicName>${bundle-symbolic-name};singleton:=true</Bundle-SymbolicName>
|
||||
<Import-Package>org.eclipse.jetty.alpn;version="${alpn.majorVersion}.${alpn.minorVersion}.${alpn.incrementalVersion}",*</Import-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
[name]
|
||||
alpn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar
|
||||
|
||||
|
|
|
@ -1,17 +1,29 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-alpn-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Jetty :: ALPN :: Parent</name>
|
||||
<description>Jetty ALPN services parent</description>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<modules>
|
||||
<module>jetty-alpn-server</module>
|
||||
<module>jetty-alpn-client</module>
|
||||
</modules>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>jdk9</id>
|
||||
<activation>
|
||||
<jdk>[1.9,)</jdk>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>jetty-alpn-java-client</module>
|
||||
<module>jetty-alpn-java-server</module>
|
||||
</modules>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-annotations</artifactId>
|
||||
|
@ -14,53 +14,15 @@
|
|||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate-manifest</id>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",org.objectweb.asm.*;version=5,*</Import-Package>
|
||||
<Require-Capability>osgi.serviceloader; filter:="(osgi.serviceloader=javax.servlet.ServletContainerInitializer)";resolution:=optional;cardinality:=multiple, osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)"</Require-Capability>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!--
|
||||
Required for OSGI
|
||||
-->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
|
|
|
@ -2,13 +2,16 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-ant</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Jetty :: Ant Plugin</name>
|
||||
|
||||
<properties>
|
||||
<bundle-symbolic-name>org.eclipse.jetty.ant</bundle-symbolic-name>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
@ -22,8 +25,8 @@
|
|||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>org.eclipse.jetty</includeGroupIds>
|
||||
<excludeGroupIds>org.eclipse.jetty.orbit,org.eclipse.jetty.spdy,org.eclipse.jetty.websocket,org.eclipse.jetty.drafts</excludeGroupIds>
|
||||
<excludeArtifactIds>jetty-all,jetty-start,jetty-monitor,jetty-jsp</excludeArtifactIds>
|
||||
<excludeGroupIds>org.eclipse.jetty.orbit,org.eclipse.jetty.websocket,org.eclipse.jetty.drafts</excludeGroupIds>
|
||||
<excludeArtifactIds>jetty-all,jetty-start</excludeArtifactIds>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<outputDirectory>${project.build.directory}/test-lib</outputDirectory>
|
||||
</configuration>
|
||||
|
|
|
@ -146,11 +146,6 @@
|
|||
<artifactId>cdi-servlet</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.cdi</groupId>
|
||||
<artifactId>cdi-websocket</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-client</artifactId>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -15,50 +15,6 @@
|
|||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.net.*,*</Import-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- Required for OSGI -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
|
@ -92,6 +48,43 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<shadedArtifactAttached>true</shadedArtifactAttached>
|
||||
<shadedClassifierName>hybrid</shadedClassifierName>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>org.eclipse.jetty:jetty-http</include>
|
||||
<include>org.eclipse.jetty:jetty-io</include>
|
||||
<include>org.eclipse.jetty:jetty-util</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>org.eclipse.jetty.http</pattern>
|
||||
<shadedPattern>org.eclipse.jetty.client.shaded.http</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.eclipse.jetty.io</pattern>
|
||||
<shadedPattern>org.eclipse.jetty.client.shaded.io</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.eclipse.jetty.util</pattern>
|
||||
<shadedPattern>org.eclipse.jetty.client.shaded.util</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ import org.eclipse.jetty.http.HttpFields;
|
|||
import org.eclipse.jetty.http.HttpHeader;
|
||||
import org.eclipse.jetty.http.HttpHeaderValue;
|
||||
import org.eclipse.jetty.http.HttpMethod;
|
||||
import org.eclipse.jetty.http.HttpStatus;
|
||||
import org.eclipse.jetty.http.HttpVersion;
|
||||
|
||||
public class HttpChannelOverHTTP extends HttpChannel
|
||||
|
@ -142,6 +143,8 @@ public class HttpChannelOverHTTP extends HttpChannel
|
|||
closeReason = "failure";
|
||||
else if (receiver.isShutdown())
|
||||
closeReason = "server close";
|
||||
else if (sender.isShutdown())
|
||||
closeReason = "client close";
|
||||
|
||||
if (closeReason == null)
|
||||
{
|
||||
|
@ -156,7 +159,7 @@ public class HttpChannelOverHTTP extends HttpChannel
|
|||
}
|
||||
else
|
||||
{
|
||||
// HTTP 1.1 or greater closes only if it has an explicit close.
|
||||
// HTTP 1.1 closes only if it has an explicit close.
|
||||
if (responseHeaders.contains(HttpHeader.CONNECTION, HttpHeaderValue.CLOSE.asString()))
|
||||
closeReason = "http/1.1";
|
||||
}
|
||||
|
@ -170,7 +173,10 @@ public class HttpChannelOverHTTP extends HttpChannel
|
|||
}
|
||||
else
|
||||
{
|
||||
release();
|
||||
if (response.getStatus() == HttpStatus.SWITCHING_PROTOCOLS_101)
|
||||
connection.remove();
|
||||
else
|
||||
release();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpCookie;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.net.URI;
|
||||
|
@ -1581,62 +1582,86 @@ public class HttpClientTest extends AbstractHttpClientServerTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testCONNECTWithHTTP10() throws Exception
|
||||
public void testCopyRequest() throws Exception
|
||||
{
|
||||
try (ServerSocket server = new ServerSocket(0))
|
||||
startClient();
|
||||
|
||||
assertCopyRequest(client.newRequest("http://example.com/some/url")
|
||||
.method(HttpMethod.HEAD)
|
||||
.version(HttpVersion.HTTP_2)
|
||||
.content(new StringContentProvider("some string"))
|
||||
.timeout(321, TimeUnit.SECONDS)
|
||||
.idleTimeout(2221, TimeUnit.SECONDS)
|
||||
.followRedirects(true)
|
||||
.header(HttpHeader.CONTENT_TYPE, "application/json")
|
||||
.header("X-Some-Custom-Header", "some-value"));
|
||||
|
||||
assertCopyRequest(client.newRequest("https://example.com")
|
||||
.method(HttpMethod.POST)
|
||||
.version(HttpVersion.HTTP_1_0)
|
||||
.content(new StringContentProvider("some other string"))
|
||||
.timeout(123231, TimeUnit.SECONDS)
|
||||
.idleTimeout(232342, TimeUnit.SECONDS)
|
||||
.followRedirects(false)
|
||||
.header(HttpHeader.ACCEPT, "application/json")
|
||||
.header("X-Some-Other-Custom-Header", "some-other-value"));
|
||||
|
||||
assertCopyRequest(client.newRequest("https://example.com")
|
||||
.header(HttpHeader.ACCEPT, "application/json")
|
||||
.header(HttpHeader.ACCEPT, "application/xml")
|
||||
.header("x-same-name", "value1")
|
||||
.header("x-same-name", "value2"));
|
||||
|
||||
assertCopyRequest(client.newRequest("https://example.com")
|
||||
.header(HttpHeader.ACCEPT, "application/json")
|
||||
.header(HttpHeader.CONTENT_TYPE, "application/json"));
|
||||
|
||||
assertCopyRequest(client.newRequest("https://example.com")
|
||||
.header("Accept", "application/json")
|
||||
.header("Content-Type", "application/json"));
|
||||
|
||||
assertCopyRequest(client.newRequest("https://example.com")
|
||||
.header("X-Custom-Header-1", "value1")
|
||||
.header("X-Custom-Header-2", "value2"));
|
||||
|
||||
assertCopyRequest(client.newRequest("https://example.com")
|
||||
.header("X-Custom-Header-1", "value")
|
||||
.header("X-Custom-Header-2", "value"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHostWithHTTP10() throws Exception
|
||||
{
|
||||
start(new AbstractHandler()
|
||||
{
|
||||
startClient();
|
||||
|
||||
String host = "localhost";
|
||||
int port = server.getLocalPort();
|
||||
|
||||
Request request = client.newRequest(host, port)
|
||||
.method(HttpMethod.CONNECT)
|
||||
.version(HttpVersion.HTTP_1_0);
|
||||
FuturePromise<Connection> promise = new FuturePromise<>();
|
||||
client.getDestination("http", host, port).newConnection(promise);
|
||||
Connection connection = promise.get(5, TimeUnit.SECONDS);
|
||||
FutureResponseListener listener = new FutureResponseListener(request);
|
||||
connection.send(request, listener);
|
||||
|
||||
try (Socket socket = server.accept())
|
||||
@Override
|
||||
public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
|
||||
{
|
||||
InputStream input = socket.getInputStream();
|
||||
consume(input, false);
|
||||
|
||||
// HTTP/1.0 response, the client must not close the connection.
|
||||
String httpResponse = "" +
|
||||
"HTTP/1.0 200 OK\r\n" +
|
||||
"\r\n";
|
||||
OutputStream output = socket.getOutputStream();
|
||||
output.write(httpResponse.getBytes(StandardCharsets.UTF_8));
|
||||
output.flush();
|
||||
|
||||
ContentResponse response = listener.get(5, TimeUnit.SECONDS);
|
||||
Assert.assertEquals(200, response.getStatus());
|
||||
|
||||
// Because the tunnel was successful, this connection will be
|
||||
// upgraded to an SslConnection, so it will not be fill interested.
|
||||
// This test doesn't upgrade, so it needs to restore the fill interest.
|
||||
((AbstractConnection)connection).fillInterested();
|
||||
|
||||
// Test that I can send another request on the same connection.
|
||||
request = client.newRequest(host, port);
|
||||
listener = new FutureResponseListener(request);
|
||||
connection.send(request, listener);
|
||||
|
||||
consume(input, false);
|
||||
|
||||
httpResponse = "" +
|
||||
"HTTP/1.1 200 OK\r\n" +
|
||||
"Content-Length: 0\r\n" +
|
||||
"\r\n";
|
||||
output.write(httpResponse.getBytes(StandardCharsets.UTF_8));
|
||||
output.flush();
|
||||
|
||||
listener.get(5, TimeUnit.SECONDS);
|
||||
baseRequest.setHandled(true);
|
||||
Assert.assertThat(request.getHeader("Host"), Matchers.notNullValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ContentResponse response = client.newRequest("localhost", connector.getLocalPort())
|
||||
.scheme(scheme)
|
||||
.version(HttpVersion.HTTP_1_0)
|
||||
.timeout(5, TimeUnit.SECONDS)
|
||||
.send();
|
||||
|
||||
Assert.assertEquals(200, response.getStatus());
|
||||
}
|
||||
|
||||
private void assertCopyRequest(Request original)
|
||||
{
|
||||
Request copy = client.copyRequest((HttpRequest) original, original.getURI());
|
||||
Assert.assertEquals(original.getURI(), copy.getURI());
|
||||
Assert.assertEquals(original.getMethod(), copy.getMethod());
|
||||
Assert.assertEquals(original.getVersion(), copy.getVersion());
|
||||
Assert.assertEquals(original.getContent(), copy.getContent());
|
||||
Assert.assertEquals(original.getIdleTimeout(), copy.getIdleTimeout());
|
||||
Assert.assertEquals(original.getTimeout(), copy.getTimeout());
|
||||
Assert.assertEquals(original.isFollowRedirects(), copy.isFollowRedirects());
|
||||
Assert.assertEquals(original.getHeaders(), copy.getHeaders());
|
||||
}
|
||||
|
||||
private void consume(InputStream input, boolean eof) throws IOException
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-continuation</artifactId>
|
||||
|
@ -14,35 +14,6 @@
|
|||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>artifact-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-deploy</artifactId>
|
||||
|
@ -14,53 +14,6 @@
|
|||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>org.eclipse.jetty.jmx.*;version="9.1";resolution:=optional,*</Import-Package>
|
||||
<_nouses>true</_nouses>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!--
|
||||
Required for OSGI
|
||||
-->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
|
|
|
@ -1,27 +1,35 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-distribution</artifactId>
|
||||
<name>Jetty :: Distribution Assemblies</name>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<assembly-directory>${basedir}/target/distribution</assembly-directory>
|
||||
<jetty-setuid-version>1.0.1</jetty-setuid-version>
|
||||
<home-directory>${basedir}/target/home</home-directory>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!--
|
||||
Copies the additional distribution content over the unpacked jetty-home
|
||||
artifact contents, after the antrun execution that initially populates
|
||||
the jetty-distribution directory
|
||||
-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-base-assembly-tree</id>
|
||||
<phase>generate-resources</phase>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
|
@ -68,6 +76,18 @@
|
|||
</tasks>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>removeKeystore</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<tasks>
|
||||
<delete file="${assembly-directory}/etc/keystore" />
|
||||
</tasks>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
@ -91,24 +111,39 @@
|
|||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<!--
|
||||
The jetty-home artifact is the starting point for the jetty-distribution
|
||||
and must happen early in the build process
|
||||
-->
|
||||
<execution>
|
||||
<id>copy</id>
|
||||
<id>unpack-jetty-home</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
<goal>unpack</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<artifactId>jetty-home</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>version</classifier>
|
||||
<type>txt</type>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${assembly-directory}/</outputDirectory>
|
||||
<destFileName>VERSION.txt</destFileName>
|
||||
<outputDirectory>${home-directory}</outputDirectory>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<excludes>META-INF/**</excludes>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
<execution>
|
||||
<id>copy</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>test-jetty-webapp</artifactId>
|
||||
|
@ -169,80 +204,11 @@
|
|||
<outputDirectory>${assembly-directory}/demo-base/webapps</outputDirectory>
|
||||
<destFileName>async-rest.war</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-start</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>jar</type>
|
||||
<overWrite>true</overWrite>
|
||||
<includes>**</includes>
|
||||
<outputDirectory>${assembly-directory}</outputDirectory>
|
||||
<destFileName>start.jar</destFileName>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-setuid-deps</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.eclipse.jetty.toolchain.setuid</groupId>
|
||||
<artifactId>jetty-setuid-java</artifactId>
|
||||
<version>${jetty-setuid-version}</version>
|
||||
<type>jar</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${assembly-directory}/lib/setuid</outputDirectory>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.eclipse.jetty.toolchain.setuid</groupId>
|
||||
<artifactId>libsetuid-linux</artifactId>
|
||||
<version>${jetty-setuid-version}</version>
|
||||
<type>so</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${assembly-directory}/lib/setuid</outputDirectory>
|
||||
<destFileName>libsetuid-linux.so</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.eclipse.jetty.toolchain.setuid</groupId>
|
||||
<artifactId>libsetuid-osx</artifactId>
|
||||
<version>${jetty-setuid-version}</version>
|
||||
<type>so</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${assembly-directory}/lib/setuid</outputDirectory>
|
||||
<destFileName>libsetuid-osx.so</destFileName>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
<execution>
|
||||
<id>unpack-setuid-config</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.eclipse.jetty.toolchain.setuid</groupId>
|
||||
<artifactId>jetty-setuid-java</artifactId>
|
||||
<version>${jetty-setuid-version}</version>
|
||||
<classifier>config</classifier>
|
||||
<type>jar</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${assembly-directory}</outputDirectory>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<excludes>META-INF/**</excludes>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
<execution>
|
||||
<id>unpack-test-webapp-config</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
|
@ -329,272 +295,35 @@
|
|||
<excludes>META-INF/**</excludes>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
<execution>
|
||||
<id>copy-lib-deps</id>
|
||||
<phase>generate-resources</phase>
|
||||
<id>unpack-documentation</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>org.eclipse.jetty</includeGroupIds>
|
||||
<excludeGroupIds>org.eclipse.jetty.orbit,org.eclipse.jetty.spdy,org.eclipse.jetty.websocket,org.eclipse.jetty.fcgi,org.eclipse.jetty.toolchain,org.apache.taglibs</excludeGroupIds>
|
||||
<excludeArtifactIds>jetty-all,jetty-jsp,apache-jsp,apache-jstl,jetty-start,jetty-monitor,jetty-spring</excludeArtifactIds>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<outputDirectory>${assembly-directory}/lib</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-lib-websocket-deps</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>javax.websocket,org.eclipse.jetty.websocket</includeGroupIds>
|
||||
<excludeArtifactIds>javax.websocket-client-api</excludeArtifactIds>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<outputDirectory>${assembly-directory}/lib/websocket</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-lib-fcgi-deps</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>org.eclipse.jetty.fcgi</includeGroupIds>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<outputDirectory>${assembly-directory}/lib/fcgi</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-lib-spring-deps</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>org.eclipse.jetty</includeGroupIds>
|
||||
<includeArtifactIds>jetty-spring</includeArtifactIds>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<outputDirectory>${assembly-directory}/lib/spring</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-lib-monitor-deps</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
<goal>unpack</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-monitor</artifactId>
|
||||
<artifactId>jetty-documentation</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>jar</type>
|
||||
<classifier>html</classifier>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${assembly-directory}/lib/monitor</outputDirectory>
|
||||
<outputDirectory>${assembly-directory}/demo-base/webapps/doc</outputDirectory>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-servlet-api-deps</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${assembly-directory}/lib</outputDirectory>
|
||||
<destFileName>servlet-api-3.1.jar</destFileName>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-schemas</artifactId>
|
||||
<version>3.1.M0</version>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${assembly-directory}/lib</outputDirectory>
|
||||
<destFileName>jetty-schemas-3.1.jar</destFileName>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>unpack-spdy</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>org.eclipse.jetty.spdy</includeGroupIds>
|
||||
<classifier>config</classifier>
|
||||
<failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>
|
||||
<excludes>META-INF/**</excludes>
|
||||
<outputDirectory>${assembly-directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-lib-spdy-deps</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>org.eclipse.jetty.spdy</includeGroupIds>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<outputDirectory>${assembly-directory}/lib/spdy</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-annotations-deps</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>javax.annotation,org.eclipse.jetty.orbit,org.ow2.asm</includeGroupIds>
|
||||
<includeArtifactIds>javax.annotation-api,asm,asm-commons</includeArtifactIds>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<outputDirectory>${assembly-directory}/lib/annotations</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
<execution>
|
||||
<id>copy-jta-deps</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>javax.transaction</includeGroupIds>
|
||||
<includeArtifactIds>javax.transaction-api</includeArtifactIds>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<outputDirectory>${assembly-directory}/lib/jndi</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-jndi-deps</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>org.eclipse.jetty.orbit</includeGroupIds>
|
||||
<includeArtifactIds>javax.mail.glassfish</includeArtifactIds>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<outputDirectory>${assembly-directory}/lib/jndi</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-glassfish-jsp-deps</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>org.eclipse.jetty.orbit,org.glassfish.web, org.glassfish, javax.el, javax.servlet.jsp, org.eclipse.jetty.toolchain, org.eclipse.jetty</includeGroupIds>
|
||||
<includeArtifactIds>org.eclipse.jdt.core, javax.servlet.jsp-api, javax.servlet.jsp, jetty-jsp-jdt, javax.el-api, javax.el, jetty-jsp</includeArtifactIds>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<outputDirectory>${assembly-directory}/lib/jsp</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-apache-jsp-deps</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>org.eclipse.jetty,org.eclipse.jetty.toolchain,org.mortbay.jasper,org.eclipse.jetty.orbit</includeGroupIds>
|
||||
<includeArtifactIds>apache-jsp,apache-el,org.eclipse.jdt.core</includeArtifactIds>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<prependGroupId>true</prependGroupId>
|
||||
<outputDirectory>${assembly-directory}/lib/apache-jsp</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-jstl-api</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>org.eclipse.jetty.orbit</includeGroupIds>
|
||||
<includeArtifactIds>javax.servlet.jsp.jstl</includeArtifactIds>
|
||||
<prependGroupId>true</prependGroupId>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<outputDirectory>${assembly-directory}/lib/jsp</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-jstl-impl</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>org.glassfish.web</includeGroupIds>
|
||||
<includeArtifactIds>javax.servlet.jsp.jstl</includeArtifactIds>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<outputDirectory>${assembly-directory}/lib/jsp</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-apache-jstl-deps</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<excludeGroupIds>org.glassfish.web</excludeGroupIds>
|
||||
<includeArtifactIds>taglibs-standard-spec,taglibs-standard-impl</includeArtifactIds>
|
||||
<prependGroupId>true</prependGroupId>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<outputDirectory>${assembly-directory}/lib/apache-jstl</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-jaspi-deps</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>org.eclipse.jetty.orbit</includeGroupIds>
|
||||
<includeArtifactIds>javax.security.auth.message</includeArtifactIds>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<outputDirectory>${assembly-directory}/lib/jaspi</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>unpack-config-deps</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>org.eclipse.jetty,org.eclipse.jetty.websocket</includeGroupIds>
|
||||
<classifier>config</classifier>
|
||||
<failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>
|
||||
<excludes>META-INF/**</excludes>
|
||||
<outputDirectory>${assembly-directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<!--
|
||||
Setup the jetty distribution as a jetty.home/jetty.base combo using start.ini configuration mechanism
|
||||
-->
|
||||
<execution>
|
||||
<id>setup home</id>
|
||||
<phase>process-classes</phase>
|
||||
|
@ -610,16 +339,18 @@
|
|||
<goal>java</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<!--
|
||||
Setup the demo-base using the start.d configuration mechanism
|
||||
-->
|
||||
<execution>
|
||||
<id>setup demo-base</id>
|
||||
<id>setup demo-base-startd</id>
|
||||
<phase>process-classes</phase>
|
||||
<configuration>
|
||||
<mainClass>org.eclipse.jetty.start.Main</mainClass>
|
||||
<arguments>
|
||||
<argument>jetty.home=${assembly-directory}</argument>
|
||||
<argument>jetty.base=${assembly-directory}/demo-base</argument>
|
||||
<argument>--add-to-start=server,continuation,deploy,websocket,ext,resources,client,annotations,jndi,servlets</argument>
|
||||
<argument>--add-to-startd=jsp,jstl,http,https</argument>
|
||||
<argument>--add-to-startd=server,continuation,deploy,websocket,ext,resources,client,annotations,jndi,servlets,jsp,jstl,http,https</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
<goals>
|
||||
|
@ -665,62 +396,13 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<!-- Orbit Deps -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>javax.mail.glassfish</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>javax.security.auth.message</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.transaction</groupId>
|
||||
<artifactId>javax.transaction-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.glassfish.web</groupId>
|
||||
<artifactId>javax.servlet.jsp.jstl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.glassfish.web</groupId>
|
||||
<artifactId>javax.servlet.jsp</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-jsp-jdt</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet.jsp</groupId>
|
||||
<artifactId>javax.servlet.jsp-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish</groupId>
|
||||
<artifactId>javax.el</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm-commons</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- jetty deps -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-deploy</artifactId>
|
||||
<artifactId>jetty-home</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
@ -734,159 +416,6 @@
|
|||
<type>war</type>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jmx</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-monitor</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-quickstart</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-start</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlets</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-servlet</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>javax-websocket-server-impl</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jsp</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>apache-jsp</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>apache-jstl</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-plus</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-continuation</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-proxy</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.fcgi</groupId>
|
||||
<artifactId>fcgi-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-spring</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-overlay-deployer</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-cdi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jaas</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-annotations</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-rewrite</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.spdy</groupId>
|
||||
<artifactId>spdy-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.spdy</groupId>
|
||||
<artifactId>spdy-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.spdy</groupId>
|
||||
<artifactId>spdy-http-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.spdy</groupId>
|
||||
<artifactId>spdy-example-webapp</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>war</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-infinispan</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-hazelcast</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.gcloud</groupId>
|
||||
<artifactId>jetty-gcloud-session-manager</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.gcloud</groupId>
|
||||
<artifactId>jetty-gcloud-memcached-session-manager</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.example-async-rest</groupId>
|
||||
<artifactId>example-async-rest-webapp</artifactId>
|
||||
|
@ -895,8 +424,10 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jaspi</artifactId>
|
||||
<artifactId>jetty-documentation</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>html</classifier>
|
||||
<type>zip</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -17,10 +17,24 @@
|
|||
[[session-management]]
|
||||
== Session Management
|
||||
|
||||
include::setting-session-characteristics.adoc[]
|
||||
include::using-persistent-sessions.adoc[]
|
||||
include::session-clustering-jdbc.adoc[]
|
||||
include::session-clustering-mongodb.adoc[]
|
||||
include::session-clustering-infinispan.adoc[]
|
||||
Sessions are a concept within the Servlet api which allow requests to store and retrieve information across the time a user spends in an application.
|
||||
Choosing the correct session manager implementation is an important consideration for every application as each can fit and perform optimally in different situations.
|
||||
If you need a simple in-memory session manager that can persist to disk then session management using the local file system can be a good place to start.
|
||||
If you need a session manager that can work in a clustered scenario with multiple instances of Jetty, then the JDBC session manager can be an excellent option.
|
||||
Jetty also offers more niche session managers that leverage backends such as MongoDB, Inifinispan, or even Google's Cloud Data Store.
|
||||
|
||||
include::session-hierarchy.adoc[]
|
||||
include::sessions-details.adoc[]
|
||||
include::session-configuration-memory.adoc[]
|
||||
include::session-configuration-file-system.adoc[]
|
||||
include::session-configuration-jdbc.adoc[]
|
||||
include::session-configuration-mongodb.adoc[]
|
||||
include::session-configuration-infinispan.adoc[]
|
||||
include::session-configuration-hazelcast.adoc[]
|
||||
include::session-clustering-gcloud-datastore.adoc[]
|
||||
include::session-configuration-gcloud.adoc[]
|
||||
//include::setting-session-characteristics.adoc[]
|
||||
//include::using-persistent-sessions.adoc[]
|
||||
//include::session-clustering-jdbc.adoc[]
|
||||
//include::session-clustering-mongodb.adoc[]
|
||||
//include::session-clustering-infinispan.adoc[]
|
||||
//include::session-clustering-gcloud-datastore.adoc[]
|
||||
|
|
|
@ -27,7 +27,7 @@ When using the Jetty distribution, you will first need to enable the `session-st
|
|||
mb-olamy:tmp-base olamy$ java -jar ../start.jar --create-startd
|
||||
MKDIR : ${jetty.base}/start.d
|
||||
INFO : Base directory was modified
|
||||
mb-olamy:tmp-base olamy$ java -jar ../start.jar --add-to-start=hazelcast-remote-sessions
|
||||
mb-olamy:tmp-base olamy$ java -jar ../start.jar --add-to-start=session-store-hazelcast-remote
|
||||
|
||||
ALERT: There are enabled module(s) with licenses.
|
||||
The following 1 module(s):
|
||||
|
@ -35,17 +35,21 @@ The following 1 module(s):
|
|||
+ contains software not covered by the Eclipse Public License!
|
||||
+ has not been audited for compliance with its license
|
||||
|
||||
Module: hazelcast-remote-sessions
|
||||
Module: session-store-hazelcast-remote
|
||||
+ Hazelcast is an open source project hosted on Github and released under the Apache 2.0 license.
|
||||
+ https://hazelcast.org/
|
||||
+ http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
Proceed (y/N)? y
|
||||
INFO: hazelcast-remote-sessions initialised in ${jetty.base}/start.ini
|
||||
COPY: /Users/olamy/repository/com/hazelcast/hazelcast-all/3.8.2/hazelcast-all-3.8.2.jar to ${jetty.base}/lib/hazelcast/hazelcast-all-3.8.2.jar
|
||||
COPY: /Users/olamy/repository/com/hazelcast/hazelcast-jetty9-sessionmanager/1.0.2/hazelcast-jetty9-sessionmanager-1.0.2.jar to ${jetty.base}/lib/hazelcast/hazelcast-jetty9-sessionmanager-1.0.2.jar
|
||||
COPY: /Users/olamy/repository/org/eclipse/jetty/jetty-nosql/9.3.21-SNAPSHOT/jetty-nosql-9.3.21-SNAPSHOT.jar to ${jetty.base}/lib/hazelcast/jetty-nosql-9.3.21-SNAPSHOT.jar
|
||||
INFO: Base directory was modified
|
||||
INFO : server transitively enabled, ini template available with --add-to-start=server
|
||||
INFO : sessions transitively enabled, ini template available with --add-to-start=sessions
|
||||
INFO : session-store-hazelcast-remote initialized in ${jetty.base}/start.d/session-store-hazelcast-remote.ini
|
||||
MKDIR : /Users/olamy/mvn-repo/com/hazelcast/hazelcast/3.8.2
|
||||
DOWNLD: http://central.maven.org/maven2/com/hazelcast/hazelcast/3.8.2/hazelcast-3.8.2.jar to /Users/olamy/mvn-repo/com/hazelcast/hazelcast/3.8.2/hazelcast-3.8.2.jar
|
||||
MKDIR : ${jetty.base}/lib/hazelcast
|
||||
COPY : /Users/olamy/mvn-repo/com/hazelcast/hazelcast/3.8.2/hazelcast-3.8.2.jar to ${jetty.base}/lib/hazelcast/hazelcast-3.8.2.jar
|
||||
COPY : /Users/olamy/mvn-repo/com/hazelcast/hazelcast-client/3.8.2/hazelcast-client-3.8.2.jar to ${jetty.base}/lib/hazelcast/hazelcast-client-3.8.2.jar
|
||||
INFO : Base directory was modified
|
||||
----
|
||||
|
||||
Doing this enables the remote Hazelcast Session module and any dependent modules or files needed for it to run on the server.
|
||||
|
@ -64,19 +68,42 @@ ____
|
|||
|
||||
==== Configuring Hazelcast Remote Properties
|
||||
|
||||
Opening the `start.ini` will show a list of all the configurable options for the Hazelcast module:
|
||||
Opening the `start.d/session-store-hazelcast-remote.ini` will show a list of all the configurable options for the Hazelcast module:
|
||||
|
||||
[source, screen, subs="{sub-order}"]
|
||||
----
|
||||
# ---------------------------------------
|
||||
# Module: session-store-hazelcast-remote
|
||||
# Enables session data store in a remote Hazelcast Map
|
||||
# ---------------------------------------
|
||||
--module=session-store-hazelcast-remote
|
||||
|
||||
#jetty.session.hazelcast.mapName=jetty_sessions
|
||||
#jetty.session.hazelcast.onlyClient=true
|
||||
#jetty.session.hazelcast.configurationLocation=
|
||||
#jetty.session.gracePeriod.seconds=3600
|
||||
#jetty.session.savePeriod.seconds=0
|
||||
----
|
||||
|
||||
jetty.session.hazelcast.mapName::
|
||||
Name of the Map in Hazelcast where sessions will be stored.
|
||||
jetty.session.hazelcast.onlyClient::
|
||||
Hazelcast instance will be configured in client mode
|
||||
jetty.session.hazelcast.configurationLocation::
|
||||
Path to an an Hazelcast xml configuration file
|
||||
jetty.session.gracePeriod.seconds::
|
||||
Amount of time, in seconds, to wait for other nodes to be checked to verify an expired session is in fact expired throughout the cluster before closing it.
|
||||
jetty.session.savePeriod.seconds=0::
|
||||
By default whenever the last concurrent request leaves a session, that session is always persisted via the `SessionDataStore`, even if the only thing that changed on the session is its updated last access time.
|
||||
A non-zero value means that the `SessionDataStore` will skip persisting the session if only the access time changed, and it has been less than `savePeriod` seconds since the last time the session was written.
|
||||
+
|
||||
____
|
||||
[NOTE]
|
||||
Configuring `savePeriod` is useful if your persistence technology is very slow/costly for writes.
|
||||
In a clustered environment, there is a risk of the last access time of the session being out-of-date in the shared store for up to `savePeriod` seconds.
|
||||
This allows the possibility that a node may prematurely expire the session, even though it is in use by another node.
|
||||
Thorough consideration of the `maxIdleTime` of the session when setting the `savePeriod` is imperative - there is no point in setting a `savePeriod` that is larger than the `maxIdleTime`.
|
||||
____
|
||||
|
||||
==== Configuring Embedded Hazelcast Clustering
|
||||
|
||||
|
@ -88,7 +115,7 @@ To enable this you will first need to enable the `session-store-hazelcast-embedd
|
|||
mb-olamy:tmp-base olamy$ java -jar ../start.jar --create-startd
|
||||
MKDIR : ${jetty.base}/start.d
|
||||
INFO : Base directory was modified
|
||||
mb-olamy:tmp-base olamy$ java -jar ../start.jar --add-to-start=hazelcast-embedded-sessions
|
||||
mb-olamy:tmp-base olamy$ java -jar ../start.jar --add-to-start=session-store-hazelcast-embedded
|
||||
|
||||
ALERT: There are enabled module(s) with licenses.
|
||||
The following 1 module(s):
|
||||
|
@ -96,17 +123,20 @@ The following 1 module(s):
|
|||
+ contains software not covered by the Eclipse Public License!
|
||||
+ has not been audited for compliance with its license
|
||||
|
||||
Module: hazelcast-embedded-sessions
|
||||
Module: session-store-hazelcast-embedded
|
||||
+ Hazelcast is an open source project hosted on Github and released under the Apache 2.0 license.
|
||||
+ https://hazelcast.org/
|
||||
+ http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
Proceed (y/N)? y
|
||||
INFO: hazelcast-embedded-sessions initialised in ${jetty.base}/start.ini
|
||||
COPY: /Users/olamy/repository/com/hazelcast/hazelcast-all/3.8.2/hazelcast-all-3.8.2.jar to ${jetty.base}/lib/hazelcast/hazelcast-all-3.8.2.jar
|
||||
COPY: /Users/olamy/repository/com/hazelcast/hazelcast-jetty9-sessionmanager/1.0.2/hazelcast-jetty9-sessionmanager-1.0.2.jar to ${jetty.base}/lib/hazelcast/hazelcast-jetty9-sessionmanager-1.0.2.jar
|
||||
COPY: /Users/olamy/repository/org/eclipse/jetty/jetty-nosql/9.3.21-SNAPSHOT/jetty-nosql-9.3.21-SNAPSHOT.jar to ${jetty.base}/lib/hazelcast/jetty-nosql-9.3.21-SNAPSHOT.jar
|
||||
INFO: Base directory was modified
|
||||
INFO : server transitively enabled, ini template available with --add-to-start=server
|
||||
INFO : sessions transitively enabled, ini template available with --add-to-start=sessions
|
||||
INFO : session-store-hazelcast-embedded initialized in ${jetty.base}/start.d/session-store-hazelcast-embedded.ini
|
||||
MKDIR : /Users/olamy/mvn-repo/com/hazelcast/hazelcast/3.8.2
|
||||
DOWNLD: http://central.maven.org/maven2/com/hazelcast/hazelcast/3.8.2/hazelcast-3.8.2.jar to /Users/olamy/mvn-repo/com/hazelcast/hazelcast/3.8.2/hazelcast-3.8.2.jar
|
||||
MKDIR : ${jetty.base}/lib/hazelcast
|
||||
COPY : /Users/olamy/mvn-repo/com/hazelcast/hazelcast/3.8.2/hazelcast-3.8.2.jar to ${jetty.base}/lib/hazelcast/hazelcast-3.8.2.jar
|
||||
COPY : /Users/olamy/mvn-repo/com/hazelcast/hazelcast-client/3.8.2/hazelcast-client-3.8.2.jar to ${jetty.base}/lib/hazelcast/hazelcast-client-3.8.2.jar
|
||||
----
|
||||
|
||||
Doing this enables the embedded Hazelcast Session module and any dependent modules or files needed for it to run on the server.
|
||||
|
@ -120,15 +150,35 @@ In addition to adding these modules to the classpath of the server it also added
|
|||
|
||||
==== Configuring Hazelcast Embedded Properties
|
||||
|
||||
Opening the `start.ini` will show a list of all the configurable options for the Hazelcast module:
|
||||
Opening the `start.d/start.d/session-store-hazelcast-embedded.ini` will show a list of all the configurable options for the Hazelcast module:
|
||||
|
||||
[source, screen, subs="{sub-order}"]
|
||||
----
|
||||
# ---------------------------------------
|
||||
# Module: hazelcast-embedded-sessions
|
||||
--module=hazelcast-embedded-sessions
|
||||
# Module: session-store-hazelcast-embedded
|
||||
# Enables session data store in an embedded Hazelcast Map
|
||||
# ---------------------------------------
|
||||
--module=session-store-hazelcast-embedded
|
||||
|
||||
#jetty.session.hazelcast.mapName=jetty_sessions
|
||||
#jetty.session.hazelcast.configurationLocation=
|
||||
#jetty.session.gracePeriod.seconds=3600
|
||||
#jetty.session.savePeriod.seconds=0
|
||||
----
|
||||
jetty.session.hazelcast.mapName::
|
||||
Name of the Map in Hazelcast where sessions will be stored.
|
||||
jetty.session.gracePeriod.seconds::
|
||||
Amount of time, in seconds, to wait for other nodes to be checked to verify an expired session is in fact expired throughout the cluster before closing it.
|
||||
jetty.session.hazelcast.configurationLocation::
|
||||
Path to an an Hazelcast xml configuration file
|
||||
jetty.session.savePeriod.seconds=0::
|
||||
By default whenever the last concurrent request leaves a session, that session is always persisted via the `SessionDataStore`, even if the only thing that changed on the session is its updated last access time.
|
||||
A non-zero value means that the `SessionDataStore` will skip persisting the session if only the access time changed, and it has been less than `savePeriod` seconds since the last time the session was written.
|
||||
+
|
||||
____
|
||||
[NOTE]
|
||||
Configuring `savePeriod` is useful if your persistence technology is very slow/costly for writes.
|
||||
In a clustered environment, there is a risk of the last access time of the session being out-of-date in the shared store for up to `savePeriod` seconds.
|
||||
This allows the possibility that a node may prematurely expire the session, even though it is in use by another node.
|
||||
Thorough consideration of the `maxIdleTime` of the session when setting the `savePeriod` is imperative - there is no point in setting a `savePeriod` that is larger than the `maxIdleTime`.
|
||||
____
|
||||
|
|
|
@ -637,10 +637,9 @@ KeyIdentifier [
|
|||
*******************************************
|
||||
----
|
||||
|
||||
Additionally, you can split `$JETTY/etc/keystore` into two files.
|
||||
One being `$JETTY/etc/keystore` which only contains the server’s private key and certificate, while the other would be `$JETTY/etc/truststore` which contains intermediary CA and root CA.
|
||||
|
||||
An example of this would look like the following:
|
||||
In addition, you can split `$JETTY/etc/keystore` as two files.
|
||||
One is `$JETTY/etc/keystore` which only contains the server’s private key and certificate,
|
||||
the other is `$JETTY/etc/truststore` which contains intermediary CA and root CA.
|
||||
|
||||
[literal]
|
||||
.The structure of `$JETTY/etc/keystore`
|
||||
|
@ -688,7 +687,7 @@ setKeyStorePath::
|
|||
The configured keystore to use for all SSL/TLS in configured Jetty Connector (or Client).
|
||||
____
|
||||
[NOTE]
|
||||
As the keystore is vital security information, it recommended the file is located in a directory with *very* restricted access.
|
||||
As a keystore is vital security information, it can be desirable to locate the file in a directory with *very* restricted access.
|
||||
____
|
||||
|
||||
setKeyStorePassword::
|
||||
|
@ -713,7 +712,7 @@ ____
|
|||
|
||||
____
|
||||
[CAUTION]
|
||||
The keystore and truststore passwords may also be set using the system properties: `org.eclipse.jetty.ssl.keypassword` and `org.eclipse.jetty.ssl.password`.
|
||||
The keystore and truststore passwords may also be set using the system properties: `org.eclipse.jetty.ssl.keypassword` `org.eclipse.jetty.ssl.password`.
|
||||
This is _not_ a recommended usage.
|
||||
____
|
||||
|
||||
|
@ -802,8 +801,7 @@ jetty.sslContext.needClientAuth=true
|
|||
[[configuring-sslcontextfactory-cipherSuites]]
|
||||
==== Disabling/Enabling Specific Cipher Suites
|
||||
|
||||
To avoid specific attacks it is often necessary to configure a specific set of cipher suites to include or exclude.
|
||||
This can either be done via link:{JDURL}/org/eclipse/jetty/util/ssl/SslContextFactory.html#setIncludeCipherSuites(java.lang.String...)[SslContext.setIncludeCipherSuites(java.lang.String...)] or vialink:{JDURL}/org/eclipse/jetty/util/ssl/SslContextFactory.html#setExcludeCipherSuites(java.lang.String...)[SslContext.setExcludeCipherSuites(java.lang.String...)].
|
||||
As an example, to avoid the BEAST attack it is necessary to configure a specific set of cipher suites. This can either be done via link:{JDURL}/org/eclipse/jetty/util/ssl/SslContextFactory.html#setIncludeCipherSuites(java.lang.String...)[SslContext.setIncludeCipherSuites(java.lang.String...)] or vialink:{JDURL}/org/eclipse/jetty/util/ssl/SslContextFactory.html#setExcludeCipherSuites(java.lang.String...)[SslContext.setExcludeCipherSuites(java.lang.String...)].
|
||||
|
||||
____
|
||||
[NOTE]
|
||||
|
|
|
@ -1,96 +1,96 @@
|
|||
<copyright>
|
||||
<year>1995-2017</year>
|
||||
<holder>Mort Bay Consulting Pty. Ltd.</holder>
|
||||
</copyright>
|
||||
<revhistory>
|
||||
<revision>
|
||||
<revnumber>{revnumber}</revnumber>
|
||||
<date>
|
||||
<?dbtimestamp format="Y-m-d H:M:S"?>
|
||||
</date>
|
||||
<revdescription>
|
||||
</copyright>
|
||||
<revhistory>
|
||||
<revision>
|
||||
<revnumber>{revnumber}</revnumber>
|
||||
<date>
|
||||
<?dbtimestamp format="Y-m-d H:M:S"?>
|
||||
</date>
|
||||
<revdescription>
|
||||
<para>This documentation is produced and contributed to under the Eclipse Public License v1.0.</para>
|
||||
</revdescription>
|
||||
</revision>
|
||||
</revhistory>
|
||||
<keywordset>
|
||||
<keyword>jetty</keyword>
|
||||
<keyword>servlet</keyword>
|
||||
<keyword>servlet-api</keyword>
|
||||
<keyword>cometd</keyword>
|
||||
<keyword>http</keyword>
|
||||
<keyword>websocket</keyword>
|
||||
<keyword>eclipse</keyword>
|
||||
<keyword>maven</keyword>
|
||||
<keyword>java</keyword>
|
||||
<keyword>server</keyword>
|
||||
<keyword>software</keyword>
|
||||
</keywordset>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<personname>
|
||||
<firstname>Jan</firstname>
|
||||
<surname>Bartel</surname>
|
||||
</personname>
|
||||
<affiliation>
|
||||
<shortaffil>Jetty</shortaffil>
|
||||
<jobtitle>Project Lead</jobtitle>
|
||||
</affiliation>
|
||||
</author>
|
||||
<author>
|
||||
<personname>
|
||||
<firstname>Thomas</firstname>
|
||||
<surname>Becker</surname>
|
||||
</personname>
|
||||
<affiliation>
|
||||
<shortaffil>Jetty</shortaffil>
|
||||
<jobtitle>Committer</jobtitle>
|
||||
</affiliation>
|
||||
</author>
|
||||
<author>
|
||||
<personname>
|
||||
<firstname>Simone</firstname>
|
||||
<surname>Bordet</surname>
|
||||
</personname>
|
||||
<affiliation>
|
||||
<shortaffil>Jetty</shortaffil>
|
||||
<jobtitle>Committer</jobtitle>
|
||||
</affiliation>
|
||||
</author>
|
||||
<author>
|
||||
<personname>
|
||||
<firstname>Joakim</firstname>
|
||||
<surname>Erdfelt</surname>
|
||||
</personname>
|
||||
<affiliation>
|
||||
<shortaffil>Jetty</shortaffil>
|
||||
<jobtitle>Committer</jobtitle>
|
||||
</affiliation>
|
||||
</author>
|
||||
<author>
|
||||
<personname>
|
||||
<firstname>Jesse</firstname>
|
||||
<surname>McConnell</surname>
|
||||
</personname>
|
||||
<affiliation>
|
||||
<shortaffil>Jetty</shortaffil>
|
||||
<jobtitle>Committer</jobtitle>
|
||||
</affiliation>
|
||||
</author>
|
||||
<author>
|
||||
<personname>
|
||||
<firstname>Greg</firstname>
|
||||
<surname>Wilkins</surname>
|
||||
</personname>
|
||||
<affiliation>
|
||||
<shortaffil>Jetty</shortaffil>
|
||||
<jobtitle>Project Lead</jobtitle>
|
||||
</affiliation>
|
||||
</author>
|
||||
<editor>
|
||||
<personname>
|
||||
<firstname>Shirley</firstname>
|
||||
<surname>Boulay</surname>
|
||||
</personname>
|
||||
</editor>
|
||||
</authorgroup>
|
||||
</revdescription>
|
||||
</revision>
|
||||
</revhistory>
|
||||
<keywordset>
|
||||
<keyword>jetty</keyword>
|
||||
<keyword>servlet</keyword>
|
||||
<keyword>servlet-api</keyword>
|
||||
<keyword>cometd</keyword>
|
||||
<keyword>http</keyword>
|
||||
<keyword>websocket</keyword>
|
||||
<keyword>eclipse</keyword>
|
||||
<keyword>maven</keyword>
|
||||
<keyword>java</keyword>
|
||||
<keyword>server</keyword>
|
||||
<keyword>software</keyword>
|
||||
</keywordset>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<personname>
|
||||
<firstname>Jan</firstname>
|
||||
<surname>Bartel</surname>
|
||||
</personname>
|
||||
<affiliation>
|
||||
<shortaffil>Jetty</shortaffil>
|
||||
<jobtitle>Project Lead</jobtitle>
|
||||
</affiliation>
|
||||
</author>
|
||||
<author>
|
||||
<personname>
|
||||
<firstname>Thomas</firstname>
|
||||
<surname>Becker</surname>
|
||||
</personname>
|
||||
<affiliation>
|
||||
<shortaffil>Jetty</shortaffil>
|
||||
<jobtitle>Committer</jobtitle>
|
||||
</affiliation>
|
||||
</author>
|
||||
<author>
|
||||
<personname>
|
||||
<firstname>Simone</firstname>
|
||||
<surname>Bordet</surname>
|
||||
</personname>
|
||||
<affiliation>
|
||||
<shortaffil>Jetty</shortaffil>
|
||||
<jobtitle>Committer</jobtitle>
|
||||
</affiliation>
|
||||
</author>
|
||||
<author>
|
||||
<personname>
|
||||
<firstname>Joakim</firstname>
|
||||
<surname>Erdfelt</surname>
|
||||
</personname>
|
||||
<affiliation>
|
||||
<shortaffil>Jetty</shortaffil>
|
||||
<jobtitle>Committer</jobtitle>
|
||||
</affiliation>
|
||||
</author>
|
||||
<author>
|
||||
<personname>
|
||||
<firstname>Jesse</firstname>
|
||||
<surname>McConnell</surname>
|
||||
</personname>
|
||||
<affiliation>
|
||||
<shortaffil>Jetty</shortaffil>
|
||||
<jobtitle>Committer</jobtitle>
|
||||
</affiliation>
|
||||
</author>
|
||||
<author>
|
||||
<personname>
|
||||
<firstname>Greg</firstname>
|
||||
<surname>Wilkins</surname>
|
||||
</personname>
|
||||
<affiliation>
|
||||
<shortaffil>Jetty</shortaffil>
|
||||
<jobtitle>Project Lead</jobtitle>
|
||||
</affiliation>
|
||||
</author>
|
||||
<editor>
|
||||
<personname>
|
||||
<firstname>Shirley</firstname>
|
||||
<surname>Boulay</surname>
|
||||
</personname>
|
||||
</editor>
|
||||
</authorgroup>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty.fcgi</groupId>
|
||||
<artifactId>fcgi-parent</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
|
|
@ -1,73 +1,67 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty.fcgi</groupId>
|
||||
<artifactId>fcgi-parent</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
</parent>
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty.fcgi</groupId>
|
||||
<artifactId>fcgi-parent</artifactId>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>fcgi-server</artifactId>
|
||||
<name>Jetty :: FastCGI :: Server</name>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>fcgi-server</artifactId>
|
||||
<name>Jetty :: FastCGI :: Server</name>
|
||||
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.server</bundle-symbolic-name>
|
||||
</properties>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.server</bundle-symbolic-name>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.fcgi</groupId>
|
||||
<artifactId>fcgi-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-proxy</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlet</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.spdy</groupId>
|
||||
<artifactId>spdy-http-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.fcgi</groupId>
|
||||
<artifactId>fcgi-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-proxy</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlet</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.http2</groupId>
|
||||
<artifactId>http2-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-alpn-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-annotations</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
|
|
@ -1,19 +1,68 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.3.21-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-hazelcast</artifactId>
|
||||
<name>Jetty :: Hazelcast Session Managers</name>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<name>Jetty :: Hazelcast Session Manager</name>
|
||||
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.hazelcast</bundle-symbolic-name>
|
||||
<hazelcast.sessionManager.version>1.0.2</hazelcast.sessionManager.version>
|
||||
<hazelcast.version>3.8.2</hazelcast.version>
|
||||
<bundle-symbolic-name>${project.groupId}.hazelcast</bundle-symbolic-name>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.hazelcast</groupId>
|
||||
<artifactId>hazelcast</artifactId>
|
||||
<version>${hazelcast.version}</version>
|
||||
<type>test-jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.hazelcast</groupId>
|
||||
<artifactId>hazelcast-client</artifactId>
|
||||
<version>${hazelcast.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.hazelcast</groupId>
|
||||
<artifactId>hazelcast</artifactId>
|
||||
<version>${hazelcast.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-webapp</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-servlet</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-test-helper</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
@ -33,32 +82,7 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.hazelcast</groupId>
|
||||
<artifactId>hazelcast-jetty9-sessionmanager</artifactId>
|
||||
<version>${hazelcast.sessionManager.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.hazelcast</groupId>
|
||||
<artifactId>hazelcast-all</artifactId>
|
||||
<version>${hazelcast.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -3,17 +3,19 @@
|
|||
|
||||
<Configure id="Server" class="org.eclipse.jetty.server.Server">
|
||||
|
||||
<!-- ===================================================================== -->
|
||||
<!-- Configure a SessionIdManager with the Hazelcast IdManager. -->
|
||||
<!-- ===================================================================== -->
|
||||
<Set name="sessionIdManager">
|
||||
<New id="hazelcastIdMgr" class="com.hazelcast.session.HazelcastSessionIdManager">
|
||||
<Arg>
|
||||
<Ref refid="Server"/>
|
||||
</Arg>
|
||||
<Set name="configLocation"><Property name="jetty.session.hazelcast.configurationLocation"/></Set>
|
||||
<Set name="clientOnly">false</Set>
|
||||
</New>
|
||||
</Set>
|
||||
|
||||
</Configure>
|
||||
<!-- ===================================================================== -->
|
||||
<!-- Configure a factory for HazelcastSessionDataStore using -->
|
||||
<!-- an embedded Hazelcast Instance -->
|
||||
<!-- ===================================================================== -->
|
||||
<Call name="addBean">
|
||||
<Arg>
|
||||
<New id="sessionDataStoreFactory" class="org.eclipse.jetty.hazelcast.session.HazelcastSessionDataStoreFactory">
|
||||
<Set name="mapName"><Property name="jetty.session.hazelcast.mapName" default="jetty-distributed-session-map" /></Set>
|
||||
<Set name="hazelcastInstanceName"><Property name="jetty.session.hazelcast.hazelcastInstanceName" default="JETTY_DISTRIBUTED_SESSION_INSTANCE" /></Set>
|
||||
<Set name="gracePeriodSec"><Property name="jetty.session.gracePeriod.seconds" default="3600" /></Set>
|
||||
<Set name="savePeriodSec"><Property name="jetty.session.savePeriod.seconds" default="0" /></Set>
|
||||
</New>
|
||||
</Arg>
|
||||
</Call>
|
||||
</Configure>
|
||||
|
|
|
@ -4,16 +4,18 @@
|
|||
<Configure id="Server" class="org.eclipse.jetty.server.Server">
|
||||
|
||||
<!-- ===================================================================== -->
|
||||
<!-- Configure a SessionIdManager with the Hazelcast IdManager. -->
|
||||
<!-- Configure a factory for HazelcastSessionDataStore using -->
|
||||
<!-- an embedded Hazelcast Instance -->
|
||||
<!-- ===================================================================== -->
|
||||
<Set name="sessionIdManager">
|
||||
<New id="hazelcastIdMgr" class="com.hazelcast.session.HazelcastSessionIdManager">
|
||||
<Arg>
|
||||
<Ref refid="Server"/>
|
||||
</Arg>
|
||||
<Set name="configLocation"><Property name="jetty.session.hazelcast.configurationLocation"/></Set>
|
||||
<Set name="clientOnly">true</Set>
|
||||
</New>
|
||||
</Set>
|
||||
|
||||
</Configure>
|
||||
<Call name="addBean">
|
||||
<Arg>
|
||||
<New id="sessionDataStoreFactory" class="org.eclipse.jetty.hazelcast.session.HazelcastSessionDataStoreFactory">
|
||||
<Set name="mapName"><Property name="jetty.session.hazelcast.mapName" default="jetty-distributed-session-map" /></Set>
|
||||
<Set name="hazelcastInstanceName"><Property name="jetty.session.hazelcast.hazelcastInstanceName" default="JETTY_DISTRIBUTED_SESSION_INSTANCE" /></Set>
|
||||
<Set name="gracePeriodSec"><Property name="jetty.session.gracePeriod.seconds" default="3600" /></Set>
|
||||
<Set name="savePeriodSec"><Property name="jetty.session.savePeriod.seconds" default="0" /></Set>
|
||||
<Set name="onlyClient"><Property name="jetty.session.hazelcast.onlyClient" default="true" /></Set>
|
||||
</New>
|
||||
</Arg>
|
||||
</Call>
|
||||
</Configure>
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
[description]
|
||||
Enables session data store in an embedded Hazelcast Map
|
||||
|
||||
[tags]
|
||||
session
|
||||
|
||||
[provides]
|
||||
session-store
|
||||
|
||||
[depend]
|
||||
sessions
|
||||
|
||||
[files]
|
||||
maven://com.hazelcast/hazelcast/3.8.2|lib/hazelcast/hazelcast-3.8.2.jar
|
||||
|
||||
[xml]
|
||||
etc/sessions/hazelcast/default.xml
|
||||
|
||||
[lib]
|
||||
lib/jetty-hazelcast-${jetty.version}.jar
|
||||
lib/hazelcast/*.jar
|
||||
|
||||
[license]
|
||||
Hazelcast is an open source project hosted on Github and released under the Apache 2.0 license.
|
||||
https://hazelcast.org/
|
||||
http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
|
||||
[ini-template]
|
||||
jetty.session.hazelcast.mapName=jetty-distributed-session-map
|
||||
jetty.session.hazelcast.hazelcastInstanceName=JETTY_DISTRIBUTED_SESSION_INSTANCE
|
||||
#jetty.session.hazelcast.configurationLocation=
|
||||
jetty.session.gracePeriod.seconds=3600
|
||||
jetty.session.savePeriod.seconds=0
|
|
@ -0,0 +1,36 @@
|
|||
[description]
|
||||
Enables session data store in a remote Hazelcast Map
|
||||
|
||||
[tags]
|
||||
session
|
||||
|
||||
[provides]
|
||||
session-store
|
||||
|
||||
[depend]
|
||||
sessions
|
||||
|
||||
[files]
|
||||
maven://com.hazelcast/hazelcast/3.8.2|lib/hazelcast/hazelcast-3.8.2.jar
|
||||
maven://com.hazelcast/hazelcast-client/3.8.2|lib/hazelcast/hazelcast-client-3.8.2.jar
|
||||
|
||||
[xml]
|
||||
etc/sessions/hazelcast/remote.xml
|
||||
|
||||
[lib]
|
||||
lib/jetty-hazelcast-${jetty.version}.jar
|
||||
lib/hazelcast/*.jar
|
||||
|
||||
[license]
|
||||
Hazelcast is an open source project hosted on Github and released under the Apache 2.0 license.
|
||||
https://hazelcast.org/
|
||||
http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
|
||||
[ini-template]
|
||||
jetty.session.hazelcast.mapName=jetty-distributed-session-map
|
||||
jetty.session.hazelcast.hazelcastInstanceName=JETTY_DISTRIBUTED_SESSION_INSTANCE
|
||||
jetty.session.hazelcast.onlyClient=true
|
||||
#jetty.session.hazelcast.configurationLocation=
|
||||
jetty.session.gracePeriod.seconds=3600
|
||||
jetty.session.savePeriod.seconds=0
|
|
@ -483,23 +483,11 @@
|
|||
<artifactId>jetty-spring</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-overlay-deployer</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.cdi</groupId>
|
||||
<artifactId>cdi-servlet</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.cdi</groupId>
|
||||
<artifactId>cdi-websocket</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jaas</artifactId>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-http-spi</artifactId>
|
||||
|
@ -32,35 +32,6 @@
|
|||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>artifact-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
|
@ -68,6 +39,19 @@
|
|||
<onlyAnalyze>org.eclipse.jetty.http.spi.*</onlyAnalyze>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-Description>Jetty Http SPI</Bundle-Description>
|
||||
<Require-Capability>osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)"</Require-Capability>
|
||||
<Provide-Capability>osgi.serviceloader; osgi.serviceloader=com.sun.net.httpserver.spi.HttpServerProvider</Provide-Capability>
|
||||
<_nouses>true</_nouses>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
|
|
|
@ -1,162 +1,162 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.http.spi;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
import com.sun.net.httpserver.Authenticator;
|
||||
import com.sun.net.httpserver.Authenticator.Result;
|
||||
import com.sun.net.httpserver.HttpContext;
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
import com.sun.net.httpserver.HttpHandler;
|
||||
import com.sun.net.httpserver.HttpPrincipal;
|
||||
|
||||
/**
|
||||
* Jetty handler that bridges requests to {@link HttpHandler}.
|
||||
*/
|
||||
public class HttpSpiContextHandler extends ContextHandler
|
||||
{
|
||||
public static final Logger LOG = Log.getLogger(HttpSpiContextHandler.class);
|
||||
|
||||
private HttpContext _httpContext;
|
||||
|
||||
private HttpHandler _httpHandler;
|
||||
|
||||
public HttpSpiContextHandler(HttpContext httpContext, HttpHandler httpHandler)
|
||||
{
|
||||
this._httpContext = httpContext;
|
||||
this._httpHandler = httpHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doScope(String target, Request baseRequest, HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException
|
||||
{
|
||||
if (!target.startsWith(getContextPath()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
HttpExchange jettyHttpExchange;
|
||||
if (baseRequest.isSecure())
|
||||
{
|
||||
jettyHttpExchange = new JettyHttpsExchange(_httpContext,req,resp);
|
||||
}
|
||||
else
|
||||
{
|
||||
jettyHttpExchange = new JettyHttpExchange(_httpContext,req,resp);
|
||||
}
|
||||
|
||||
// TODO: add filters processing
|
||||
|
||||
try
|
||||
{
|
||||
Authenticator auth = _httpContext.getAuthenticator();
|
||||
if (auth != null)
|
||||
{
|
||||
handleAuthentication(resp,jettyHttpExchange,auth);
|
||||
}
|
||||
else
|
||||
{
|
||||
_httpHandler.handle(jettyHttpExchange);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOG.debug(ex);
|
||||
PrintWriter writer = new PrintWriter(jettyHttpExchange.getResponseBody());
|
||||
|
||||
resp.setStatus(500);
|
||||
writer.println("<h2>HTTP ERROR: 500</h2>");
|
||||
writer.println("<pre>INTERNAL_SERVER_ERROR</pre>");
|
||||
writer.println("<p>RequestURI=" + StringUtil.sanitizeXmlString(req.getRequestURI()) + "</p>");
|
||||
|
||||
if (LOG.isDebugEnabled())
|
||||
{
|
||||
writer.println("<pre>");
|
||||
ex.printStackTrace(writer);
|
||||
writer.println("</pre>");
|
||||
}
|
||||
|
||||
baseRequest.getHttpChannel().getHttpConfiguration().writePoweredBy(writer,"<p>","</p>");
|
||||
|
||||
writer.close();
|
||||
}
|
||||
finally
|
||||
{
|
||||
baseRequest.setHandled(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void handleAuthentication(HttpServletResponse resp, HttpExchange httpExchange, Authenticator auth) throws IOException
|
||||
{
|
||||
Result result = auth.authenticate(httpExchange);
|
||||
if (result instanceof Authenticator.Failure)
|
||||
{
|
||||
int rc = ((Authenticator.Failure)result).getResponseCode();
|
||||
for (Map.Entry<String,List<String>> header : httpExchange.getResponseHeaders().entrySet())
|
||||
{
|
||||
for (String value : header.getValue())
|
||||
resp.addHeader(header.getKey(),value);
|
||||
}
|
||||
resp.sendError(rc);
|
||||
}
|
||||
else if (result instanceof Authenticator.Retry)
|
||||
{
|
||||
int rc = ((Authenticator.Retry)result).getResponseCode();
|
||||
for (Map.Entry<String,List<String>> header : httpExchange.getResponseHeaders().entrySet())
|
||||
{
|
||||
for (String value : header.getValue())
|
||||
resp.addHeader(header.getKey(),value);
|
||||
}
|
||||
resp.setStatus(rc);
|
||||
resp.flushBuffer();
|
||||
}
|
||||
else if (result instanceof Authenticator.Success)
|
||||
{
|
||||
HttpPrincipal principal = ((Authenticator.Success)result).getPrincipal();
|
||||
((JettyExchange)httpExchange).setPrincipal(principal);
|
||||
_httpHandler.handle(httpExchange);
|
||||
}
|
||||
}
|
||||
|
||||
public HttpHandler getHttpHandler()
|
||||
{
|
||||
return _httpHandler;
|
||||
}
|
||||
|
||||
public void setHttpHandler(HttpHandler handler)
|
||||
{
|
||||
this._httpHandler = handler;
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.http.spi;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
import com.sun.net.httpserver.Authenticator;
|
||||
import com.sun.net.httpserver.Authenticator.Result;
|
||||
import com.sun.net.httpserver.HttpContext;
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
import com.sun.net.httpserver.HttpHandler;
|
||||
import com.sun.net.httpserver.HttpPrincipal;
|
||||
|
||||
/**
|
||||
* Jetty handler that bridges requests to {@link HttpHandler}.
|
||||
*/
|
||||
public class HttpSpiContextHandler extends ContextHandler
|
||||
{
|
||||
public static final Logger LOG = Log.getLogger(HttpSpiContextHandler.class);
|
||||
|
||||
private HttpContext _httpContext;
|
||||
|
||||
private HttpHandler _httpHandler;
|
||||
|
||||
public HttpSpiContextHandler(HttpContext httpContext, HttpHandler httpHandler)
|
||||
{
|
||||
this._httpContext = httpContext;
|
||||
this._httpHandler = httpHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doScope(String target, Request baseRequest, HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException
|
||||
{
|
||||
if (!target.startsWith(getContextPath()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
HttpExchange jettyHttpExchange;
|
||||
if (baseRequest.isSecure())
|
||||
{
|
||||
jettyHttpExchange = new JettyHttpsExchange(_httpContext,req,resp);
|
||||
}
|
||||
else
|
||||
{
|
||||
jettyHttpExchange = new JettyHttpExchange(_httpContext,req,resp);
|
||||
}
|
||||
|
||||
// TODO: add filters processing
|
||||
|
||||
try
|
||||
{
|
||||
Authenticator auth = _httpContext.getAuthenticator();
|
||||
if (auth != null)
|
||||
{
|
||||
handleAuthentication(resp,jettyHttpExchange,auth);
|
||||
}
|
||||
else
|
||||
{
|
||||
_httpHandler.handle(jettyHttpExchange);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOG.debug(ex);
|
||||
PrintWriter writer = new PrintWriter(jettyHttpExchange.getResponseBody());
|
||||
|
||||
resp.setStatus(500);
|
||||
writer.println("<h2>HTTP ERROR: 500</h2>");
|
||||
writer.println("<pre>INTERNAL_SERVER_ERROR</pre>");
|
||||
writer.println("<p>RequestURI=" + StringUtil.sanitizeXmlString(req.getRequestURI()) + "</p>");
|
||||
|
||||
if (LOG.isDebugEnabled())
|
||||
{
|
||||
writer.println("<pre>");
|
||||
ex.printStackTrace(writer);
|
||||
writer.println("</pre>");
|
||||
}
|
||||
|
||||
baseRequest.getHttpChannel().getHttpConfiguration().writePoweredBy(writer,"<p>","</p>");
|
||||
|
||||
writer.close();
|
||||
}
|
||||
finally
|
||||
{
|
||||
baseRequest.setHandled(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void handleAuthentication(HttpServletResponse resp, HttpExchange httpExchange, Authenticator auth) throws IOException
|
||||
{
|
||||
Result result = auth.authenticate(httpExchange);
|
||||
if (result instanceof Authenticator.Failure)
|
||||
{
|
||||
int rc = ((Authenticator.Failure)result).getResponseCode();
|
||||
for (Map.Entry<String,List<String>> header : httpExchange.getResponseHeaders().entrySet())
|
||||
{
|
||||
for (String value : header.getValue())
|
||||
resp.addHeader(header.getKey(),value);
|
||||
}
|
||||
resp.sendError(rc);
|
||||
}
|
||||
else if (result instanceof Authenticator.Retry)
|
||||
{
|
||||
int rc = ((Authenticator.Retry)result).getResponseCode();
|
||||
for (Map.Entry<String,List<String>> header : httpExchange.getResponseHeaders().entrySet())
|
||||
{
|
||||
for (String value : header.getValue())
|
||||
resp.addHeader(header.getKey(),value);
|
||||
}
|
||||
resp.setStatus(rc);
|
||||
resp.flushBuffer();
|
||||
}
|
||||
else if (result instanceof Authenticator.Success)
|
||||
{
|
||||
HttpPrincipal principal = ((Authenticator.Success)result).getPrincipal();
|
||||
((JettyExchange)httpExchange).setPrincipal(principal);
|
||||
_httpHandler.handle(httpExchange);
|
||||
}
|
||||
}
|
||||
|
||||
public HttpHandler getHttpHandler()
|
||||
{
|
||||
return _httpHandler;
|
||||
}
|
||||
|
||||
public void setHttpHandler(HttpHandler handler)
|
||||
{
|
||||
this._httpHandler = handler;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,111 +1,111 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.http.spi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.sun.net.httpserver.Authenticator;
|
||||
import com.sun.net.httpserver.Filter;
|
||||
import com.sun.net.httpserver.HttpHandler;
|
||||
import com.sun.net.httpserver.HttpServer;
|
||||
|
||||
/**
|
||||
* Jetty implementation of {@link com.sun.net.httpserver.HttpContext}
|
||||
*/
|
||||
public class JettyHttpContext extends com.sun.net.httpserver.HttpContext
|
||||
{
|
||||
|
||||
private HttpSpiContextHandler _jettyContextHandler;
|
||||
|
||||
private HttpServer _server;
|
||||
|
||||
private Map<String,Object> _attributes = new HashMap<String,Object>();
|
||||
|
||||
private List<Filter> _filters = new ArrayList<Filter>();
|
||||
|
||||
private Authenticator _authenticator;
|
||||
|
||||
|
||||
protected JettyHttpContext(HttpServer server, String path,
|
||||
HttpHandler handler)
|
||||
{
|
||||
this._server = server;
|
||||
_jettyContextHandler = new HttpSpiContextHandler(this, handler);
|
||||
_jettyContextHandler.setContextPath(path);
|
||||
}
|
||||
|
||||
protected HttpSpiContextHandler getJettyContextHandler()
|
||||
{
|
||||
return _jettyContextHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpHandler getHandler()
|
||||
{
|
||||
return _jettyContextHandler.getHttpHandler();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHandler(HttpHandler h)
|
||||
{
|
||||
_jettyContextHandler.setHttpHandler(h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPath()
|
||||
{
|
||||
return _jettyContextHandler.getContextPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpServer getServer()
|
||||
{
|
||||
return _server;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getAttributes()
|
||||
{
|
||||
return _attributes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Filter> getFilters()
|
||||
{
|
||||
return _filters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Authenticator setAuthenticator(Authenticator auth)
|
||||
{
|
||||
Authenticator previous = _authenticator;
|
||||
_authenticator = auth;
|
||||
return previous;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Authenticator getAuthenticator()
|
||||
{
|
||||
return _authenticator;
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.http.spi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.sun.net.httpserver.Authenticator;
|
||||
import com.sun.net.httpserver.Filter;
|
||||
import com.sun.net.httpserver.HttpHandler;
|
||||
import com.sun.net.httpserver.HttpServer;
|
||||
|
||||
/**
|
||||
* Jetty implementation of {@link com.sun.net.httpserver.HttpContext}
|
||||
*/
|
||||
public class JettyHttpContext extends com.sun.net.httpserver.HttpContext
|
||||
{
|
||||
|
||||
private HttpSpiContextHandler _jettyContextHandler;
|
||||
|
||||
private HttpServer _server;
|
||||
|
||||
private Map<String,Object> _attributes = new HashMap<String,Object>();
|
||||
|
||||
private List<Filter> _filters = new ArrayList<Filter>();
|
||||
|
||||
private Authenticator _authenticator;
|
||||
|
||||
|
||||
protected JettyHttpContext(HttpServer server, String path,
|
||||
HttpHandler handler)
|
||||
{
|
||||
this._server = server;
|
||||
_jettyContextHandler = new HttpSpiContextHandler(this, handler);
|
||||
_jettyContextHandler.setContextPath(path);
|
||||
}
|
||||
|
||||
protected HttpSpiContextHandler getJettyContextHandler()
|
||||
{
|
||||
return _jettyContextHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpHandler getHandler()
|
||||
{
|
||||
return _jettyContextHandler.getHttpHandler();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHandler(HttpHandler h)
|
||||
{
|
||||
_jettyContextHandler.setHttpHandler(h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPath()
|
||||
{
|
||||
return _jettyContextHandler.getContextPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpServer getServer()
|
||||
{
|
||||
return _server;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getAttributes()
|
||||
{
|
||||
return _attributes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Filter> getFilters()
|
||||
{
|
||||
return _filters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Authenticator setAuthenticator(Authenticator auth)
|
||||
{
|
||||
Authenticator previous = _authenticator;
|
||||
_authenticator = auth;
|
||||
return previous;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Authenticator getAuthenticator()
|
||||
{
|
||||
return _authenticator;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,233 +1,233 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.http.spi;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.sun.net.httpserver.Headers;
|
||||
import com.sun.net.httpserver.HttpContext;
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
import com.sun.net.httpserver.HttpPrincipal;
|
||||
|
||||
/**
|
||||
* Jetty implementation of {@link com.sun.net.httpserver.HttpExchange}
|
||||
*/
|
||||
public class JettyHttpExchangeDelegate extends HttpExchange
|
||||
{
|
||||
|
||||
private HttpContext _httpContext;
|
||||
|
||||
private HttpServletRequest _req;
|
||||
|
||||
private HttpServletResponse _resp;
|
||||
|
||||
private Headers _responseHeaders = new Headers();
|
||||
|
||||
private int _responseCode = 0;
|
||||
|
||||
private InputStream _is;
|
||||
|
||||
private OutputStream _os;
|
||||
|
||||
private HttpPrincipal _httpPrincipal;
|
||||
|
||||
JettyHttpExchangeDelegate(HttpContext jaxWsContext, HttpServletRequest req, HttpServletResponse resp)
|
||||
{
|
||||
this._httpContext = jaxWsContext;
|
||||
this._req = req;
|
||||
this._resp = resp;
|
||||
try
|
||||
{
|
||||
this._is = req.getInputStream();
|
||||
this._os = resp.getOutputStream();
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Headers getRequestHeaders()
|
||||
{
|
||||
Headers headers = new Headers();
|
||||
Enumeration<?> en = _req.getHeaderNames();
|
||||
while (en.hasMoreElements())
|
||||
{
|
||||
String name = (String)en.nextElement();
|
||||
Enumeration<?> en2 = _req.getHeaders(name);
|
||||
while (en2.hasMoreElements())
|
||||
{
|
||||
String value = (String)en2.nextElement();
|
||||
headers.add(name,value);
|
||||
}
|
||||
}
|
||||
return headers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Headers getResponseHeaders()
|
||||
{
|
||||
return _responseHeaders;
|
||||
}
|
||||
|
||||
@Override
|
||||
public URI getRequestURI()
|
||||
{
|
||||
try
|
||||
{
|
||||
String uriAsString = _req.getRequestURI();
|
||||
if (_req.getQueryString() != null)
|
||||
{
|
||||
uriAsString += "?" + _req.getQueryString();
|
||||
}
|
||||
|
||||
return new URI(uriAsString);
|
||||
}
|
||||
catch (URISyntaxException ex)
|
||||
{
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRequestMethod()
|
||||
{
|
||||
return _req.getMethod();
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpContext getHttpContext()
|
||||
{
|
||||
return _httpContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close()
|
||||
{
|
||||
try
|
||||
{
|
||||
_resp.getOutputStream().close();
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getRequestBody()
|
||||
{
|
||||
return _is;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OutputStream getResponseBody()
|
||||
{
|
||||
return _os;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendResponseHeaders(int rCode, long responseLength) throws IOException
|
||||
{
|
||||
this._responseCode = rCode;
|
||||
|
||||
for (Map.Entry<String, List<String>> stringListEntry : _responseHeaders.entrySet())
|
||||
{
|
||||
String name = stringListEntry.getKey();
|
||||
List<String> values = stringListEntry.getValue();
|
||||
|
||||
for (String value : values)
|
||||
{
|
||||
_resp.setHeader(name,value);
|
||||
}
|
||||
}
|
||||
if (responseLength > 0)
|
||||
{
|
||||
_resp.setHeader("content-length","" + responseLength);
|
||||
}
|
||||
_resp.setStatus(rCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InetSocketAddress getRemoteAddress()
|
||||
{
|
||||
return new InetSocketAddress(_req.getRemoteAddr(),_req.getRemotePort());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getResponseCode()
|
||||
{
|
||||
return _responseCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InetSocketAddress getLocalAddress()
|
||||
{
|
||||
return new InetSocketAddress(_req.getLocalAddr(),_req.getLocalPort());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProtocol()
|
||||
{
|
||||
return _req.getProtocol();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAttribute(String name)
|
||||
{
|
||||
return _req.getAttribute(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttribute(String name, Object value)
|
||||
{
|
||||
_req.setAttribute(name,value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStreams(InputStream i, OutputStream o)
|
||||
{
|
||||
_is = i;
|
||||
_os = o;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpPrincipal getPrincipal()
|
||||
{
|
||||
return _httpPrincipal;
|
||||
}
|
||||
|
||||
public void setPrincipal(HttpPrincipal principal)
|
||||
{
|
||||
this._httpPrincipal = principal;
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.http.spi;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.sun.net.httpserver.Headers;
|
||||
import com.sun.net.httpserver.HttpContext;
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
import com.sun.net.httpserver.HttpPrincipal;
|
||||
|
||||
/**
|
||||
* Jetty implementation of {@link com.sun.net.httpserver.HttpExchange}
|
||||
*/
|
||||
public class JettyHttpExchangeDelegate extends HttpExchange
|
||||
{
|
||||
|
||||
private HttpContext _httpContext;
|
||||
|
||||
private HttpServletRequest _req;
|
||||
|
||||
private HttpServletResponse _resp;
|
||||
|
||||
private Headers _responseHeaders = new Headers();
|
||||
|
||||
private int _responseCode = 0;
|
||||
|
||||
private InputStream _is;
|
||||
|
||||
private OutputStream _os;
|
||||
|
||||
private HttpPrincipal _httpPrincipal;
|
||||
|
||||
JettyHttpExchangeDelegate(HttpContext jaxWsContext, HttpServletRequest req, HttpServletResponse resp)
|
||||
{
|
||||
this._httpContext = jaxWsContext;
|
||||
this._req = req;
|
||||
this._resp = resp;
|
||||
try
|
||||
{
|
||||
this._is = req.getInputStream();
|
||||
this._os = resp.getOutputStream();
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Headers getRequestHeaders()
|
||||
{
|
||||
Headers headers = new Headers();
|
||||
Enumeration<?> en = _req.getHeaderNames();
|
||||
while (en.hasMoreElements())
|
||||
{
|
||||
String name = (String)en.nextElement();
|
||||
Enumeration<?> en2 = _req.getHeaders(name);
|
||||
while (en2.hasMoreElements())
|
||||
{
|
||||
String value = (String)en2.nextElement();
|
||||
headers.add(name,value);
|
||||
}
|
||||
}
|
||||
return headers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Headers getResponseHeaders()
|
||||
{
|
||||
return _responseHeaders;
|
||||
}
|
||||
|
||||
@Override
|
||||
public URI getRequestURI()
|
||||
{
|
||||
try
|
||||
{
|
||||
String uriAsString = _req.getRequestURI();
|
||||
if (_req.getQueryString() != null)
|
||||
{
|
||||
uriAsString += "?" + _req.getQueryString();
|
||||
}
|
||||
|
||||
return new URI(uriAsString);
|
||||
}
|
||||
catch (URISyntaxException ex)
|
||||
{
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRequestMethod()
|
||||
{
|
||||
return _req.getMethod();
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpContext getHttpContext()
|
||||
{
|
||||
return _httpContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close()
|
||||
{
|
||||
try
|
||||
{
|
||||
_resp.getOutputStream().close();
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getRequestBody()
|
||||
{
|
||||
return _is;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OutputStream getResponseBody()
|
||||
{
|
||||
return _os;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendResponseHeaders(int rCode, long responseLength) throws IOException
|
||||
{
|
||||
this._responseCode = rCode;
|
||||
|
||||
for (Map.Entry<String, List<String>> stringListEntry : _responseHeaders.entrySet())
|
||||
{
|
||||
String name = stringListEntry.getKey();
|
||||
List<String> values = stringListEntry.getValue();
|
||||
|
||||
for (String value : values)
|
||||
{
|
||||
_resp.setHeader(name,value);
|
||||
}
|
||||
}
|
||||
if (responseLength > 0)
|
||||
{
|
||||
_resp.setHeader("content-length","" + responseLength);
|
||||
}
|
||||
_resp.setStatus(rCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InetSocketAddress getRemoteAddress()
|
||||
{
|
||||
return new InetSocketAddress(_req.getRemoteAddr(),_req.getRemotePort());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getResponseCode()
|
||||
{
|
||||
return _responseCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InetSocketAddress getLocalAddress()
|
||||
{
|
||||
return new InetSocketAddress(_req.getLocalAddr(),_req.getLocalPort());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProtocol()
|
||||
{
|
||||
return _req.getProtocol();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getAttribute(String name)
|
||||
{
|
||||
return _req.getAttribute(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttribute(String name, Object value)
|
||||
{
|
||||
_req.setAttribute(name,value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStreams(InputStream i, OutputStream o)
|
||||
{
|
||||
_is = i;
|
||||
_os = o;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpPrincipal getPrincipal()
|
||||
{
|
||||
return _httpPrincipal;
|
||||
}
|
||||
|
||||
public void setPrincipal(HttpPrincipal principal)
|
||||
{
|
||||
this._httpPrincipal = principal;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,79 +1,79 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.http.spi;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
|
||||
import org.eclipse.jetty.server.handler.DefaultHandler;
|
||||
import org.eclipse.jetty.server.handler.HandlerCollection;
|
||||
import org.eclipse.jetty.util.thread.QueuedThreadPool;
|
||||
import org.eclipse.jetty.util.thread.ThreadPool;
|
||||
|
||||
import com.sun.net.httpserver.HttpServer;
|
||||
import com.sun.net.httpserver.HttpsServer;
|
||||
import com.sun.net.httpserver.spi.HttpServerProvider;
|
||||
|
||||
/**
|
||||
* Jetty implementation of <a href="http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/index.html">Java HTTP Server SPI</a>
|
||||
*/
|
||||
public class JettyHttpServerProvider extends HttpServerProvider
|
||||
{
|
||||
|
||||
private static Server _server;
|
||||
|
||||
public static void setServer(Server server)
|
||||
{
|
||||
_server = server;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpServer createHttpServer(InetSocketAddress addr, int backlog)
|
||||
throws IOException
|
||||
{
|
||||
Server server = _server;
|
||||
boolean shared = true;
|
||||
|
||||
if (server == null)
|
||||
{
|
||||
ThreadPool threadPool = new DelegatingThreadPool(new QueuedThreadPool());
|
||||
server = new Server(threadPool);
|
||||
|
||||
HandlerCollection handlerCollection = new HandlerCollection();
|
||||
handlerCollection.setHandlers(new Handler[] {new ContextHandlerCollection(), new DefaultHandler()});
|
||||
server.setHandler(handlerCollection);
|
||||
|
||||
shared = false;
|
||||
}
|
||||
|
||||
JettyHttpServer jettyHttpServer = new JettyHttpServer(server, shared);
|
||||
jettyHttpServer.bind(addr, backlog);
|
||||
return jettyHttpServer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpsServer createHttpsServer(InetSocketAddress addr, int backlog) throws IOException
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.http.spi;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
|
||||
import org.eclipse.jetty.server.handler.DefaultHandler;
|
||||
import org.eclipse.jetty.server.handler.HandlerCollection;
|
||||
import org.eclipse.jetty.util.thread.QueuedThreadPool;
|
||||
import org.eclipse.jetty.util.thread.ThreadPool;
|
||||
|
||||
import com.sun.net.httpserver.HttpServer;
|
||||
import com.sun.net.httpserver.HttpsServer;
|
||||
import com.sun.net.httpserver.spi.HttpServerProvider;
|
||||
|
||||
/**
|
||||
* Jetty implementation of <a href="http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/index.html">Java HTTP Server SPI</a>
|
||||
*/
|
||||
public class JettyHttpServerProvider extends HttpServerProvider
|
||||
{
|
||||
|
||||
private static Server _server;
|
||||
|
||||
public static void setServer(Server server)
|
||||
{
|
||||
_server = server;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpServer createHttpServer(InetSocketAddress addr, int backlog)
|
||||
throws IOException
|
||||
{
|
||||
Server server = _server;
|
||||
boolean shared = true;
|
||||
|
||||
if (server == null)
|
||||
{
|
||||
ThreadPool threadPool = new DelegatingThreadPool(new QueuedThreadPool());
|
||||
server = new Server(threadPool);
|
||||
|
||||
HandlerCollection handlerCollection = new HandlerCollection();
|
||||
handlerCollection.setHandlers(new Handler[] {new ContextHandlerCollection(), new DefaultHandler()});
|
||||
server.setHandler(handlerCollection);
|
||||
|
||||
shared = false;
|
||||
}
|
||||
|
||||
JettyHttpServer jettyHttpServer = new JettyHttpServer(server, shared);
|
||||
jettyHttpServer.bind(addr, backlog);
|
||||
return jettyHttpServer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpsServer createHttpsServer(InetSocketAddress addr, int backlog) throws IOException
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-http</artifactId>
|
||||
|
@ -18,6 +18,11 @@
|
|||
<artifactId>jetty-util</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-io</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-test-helper</artifactId>
|
||||
|
@ -30,29 +35,20 @@
|
|||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",javax.net.*,*</Import-Package>
|
||||
<Require-Capability>osgi.serviceloader; filter:="(osgi.serviceloader=org.eclipse.jetty.http.HttpFieldPreEncoder)";resolution:=optional;cardinality:=multiple, osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)";resolution:=optional, osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)";resolution:=optional</Require-Capability>
|
||||
<!--
|
||||
<Require-Capability>osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)"</Require-Capability>
|
||||
-->
|
||||
<Provide-Capability>osgi.serviceloader; osgi.serviceloader=org.eclipse.jetty.http.HttpFieldPreEncoder</Provide-Capability>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>artifact-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-jar</id>
|
||||
<goals>
|
||||
|
@ -60,11 +56,6 @@
|
|||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
|
@ -73,6 +64,7 @@
|
|||
<onlyAnalyze>org.eclipse.jetty.http.*</onlyAnalyze>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -1,142 +1,142 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.http;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Collection of Syntax validation methods.
|
||||
* <p>
|
||||
* Use in a similar way as you would {@link java.util.Objects#requireNonNull(Object)}
|
||||
* </p>
|
||||
*/
|
||||
public final class Syntax
|
||||
{
|
||||
|
||||
/**
|
||||
* Per RFC2616: Section 2.2, a token follows these syntax rules
|
||||
* <pre>
|
||||
* token = 1*<any CHAR except CTLs or separators>
|
||||
* CHAR = <any US-ASCII character (octets 0 - 127)>
|
||||
* CTL = <any US-ASCII control character
|
||||
* (octets 0 - 31) and DEL (127)>
|
||||
* separators = "(" | ")" | "<" | ">" | "@"
|
||||
* | "," | ";" | ":" | "\" | <">
|
||||
* | "/" | "[" | "]" | "?" | "="
|
||||
* | "{" | "}" | SP | HT
|
||||
* </pre>
|
||||
*
|
||||
* @param value the value to test
|
||||
* @param msg the message to be prefixed if an {@link IllegalArgumentException} is thrown.
|
||||
* @throws IllegalArgumentException if the value is invalid per spec
|
||||
*/
|
||||
public static void requireValidRFC2616Token(String value, String msg)
|
||||
{
|
||||
Objects.requireNonNull(msg, "msg cannot be null");
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int valueLen = value.length();
|
||||
if (valueLen == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < valueLen; i++)
|
||||
{
|
||||
char c = value.charAt(i);
|
||||
|
||||
// 0x00 - 0x1F are low order control characters
|
||||
// 0x7F is the DEL control character
|
||||
if ((c <= 0x1F) || (c == 0x7F))
|
||||
throw new IllegalArgumentException(msg + ": RFC2616 tokens may not contain control characters");
|
||||
if (c == '(' || c == ')' || c == '<' || c == '>' || c == '@'
|
||||
|| c == ',' || c == ';' || c == ':' || c == '\\' || c == '"'
|
||||
|| c == '/' || c == '[' || c == ']' || c == '?' || c == '='
|
||||
|| c == '{' || c == '}' || c == ' ')
|
||||
{
|
||||
throw new IllegalArgumentException(msg + ": RFC2616 tokens may not contain separator character: [" + c + "]");
|
||||
}
|
||||
if (c >= 0x80)
|
||||
throw new IllegalArgumentException(msg + ": RFC2616 tokens characters restricted to US-ASCII: 0x" + Integer.toHexString(c));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Per RFC6265, Cookie.value follows these syntax rules
|
||||
* <pre>
|
||||
* cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
|
||||
* cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
|
||||
* ; US-ASCII characters excluding CTLs,
|
||||
* ; whitespace DQUOTE, comma, semicolon,
|
||||
* ; and backslash
|
||||
* </pre>
|
||||
*
|
||||
* @param value the value to test
|
||||
* @throws IllegalArgumentException if the value is invalid per spec
|
||||
*/
|
||||
public static void requireValidRFC6265CookieValue(String value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int valueLen = value.length();
|
||||
if (valueLen == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
if (value.charAt(0) == '"')
|
||||
{
|
||||
// Has starting DQUOTE
|
||||
if (valueLen <= 1 || (value.charAt(valueLen - 1) != '"'))
|
||||
{
|
||||
throw new IllegalArgumentException("RFC6265 Cookie values must have balanced DQUOTES (if used)");
|
||||
}
|
||||
|
||||
// adjust search range to exclude DQUOTES
|
||||
i++;
|
||||
valueLen--;
|
||||
}
|
||||
for (; i < valueLen; i++)
|
||||
{
|
||||
char c = value.charAt(i);
|
||||
|
||||
// 0x00 - 0x1F are low order control characters
|
||||
// 0x7F is the DEL control character
|
||||
if ((c <= 0x1F) || (c == 0x7F))
|
||||
throw new IllegalArgumentException("RFC6265 Cookie values may not contain control characters");
|
||||
if ((c == ' ' /* 0x20 */) ||
|
||||
(c == '"' /* 0x2C */) ||
|
||||
(c == ';' /* 0x3B */) ||
|
||||
(c == '\\' /* 0x5C */))
|
||||
{
|
||||
throw new IllegalArgumentException("RFC6265 Cookie values may not contain character: [" + c + "]");
|
||||
}
|
||||
if (c >= 0x80)
|
||||
throw new IllegalArgumentException("RFC6265 Cookie values characters restricted to US-ASCII: 0x" + Integer.toHexString(c));
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.http;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Collection of Syntax validation methods.
|
||||
* <p>
|
||||
* Use in a similar way as you would {@link java.util.Objects#requireNonNull(Object)}
|
||||
* </p>
|
||||
*/
|
||||
public final class Syntax
|
||||
{
|
||||
|
||||
/**
|
||||
* Per RFC2616: Section 2.2, a token follows these syntax rules
|
||||
* <pre>
|
||||
* token = 1*<any CHAR except CTLs or separators>
|
||||
* CHAR = <any US-ASCII character (octets 0 - 127)>
|
||||
* CTL = <any US-ASCII control character
|
||||
* (octets 0 - 31) and DEL (127)>
|
||||
* separators = "(" | ")" | "<" | ">" | "@"
|
||||
* | "," | ";" | ":" | "\" | <">
|
||||
* | "/" | "[" | "]" | "?" | "="
|
||||
* | "{" | "}" | SP | HT
|
||||
* </pre>
|
||||
*
|
||||
* @param value the value to test
|
||||
* @param msg the message to be prefixed if an {@link IllegalArgumentException} is thrown.
|
||||
* @throws IllegalArgumentException if the value is invalid per spec
|
||||
*/
|
||||
public static void requireValidRFC2616Token(String value, String msg)
|
||||
{
|
||||
Objects.requireNonNull(msg, "msg cannot be null");
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int valueLen = value.length();
|
||||
if (valueLen == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < valueLen; i++)
|
||||
{
|
||||
char c = value.charAt(i);
|
||||
|
||||
// 0x00 - 0x1F are low order control characters
|
||||
// 0x7F is the DEL control character
|
||||
if ((c <= 0x1F) || (c == 0x7F))
|
||||
throw new IllegalArgumentException(msg + ": RFC2616 tokens may not contain control characters");
|
||||
if (c == '(' || c == ')' || c == '<' || c == '>' || c == '@'
|
||||
|| c == ',' || c == ';' || c == ':' || c == '\\' || c == '"'
|
||||
|| c == '/' || c == '[' || c == ']' || c == '?' || c == '='
|
||||
|| c == '{' || c == '}' || c == ' ')
|
||||
{
|
||||
throw new IllegalArgumentException(msg + ": RFC2616 tokens may not contain separator character: [" + c + "]");
|
||||
}
|
||||
if (c >= 0x80)
|
||||
throw new IllegalArgumentException(msg + ": RFC2616 tokens characters restricted to US-ASCII: 0x" + Integer.toHexString(c));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Per RFC6265, Cookie.value follows these syntax rules
|
||||
* <pre>
|
||||
* cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
|
||||
* cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
|
||||
* ; US-ASCII characters excluding CTLs,
|
||||
* ; whitespace DQUOTE, comma, semicolon,
|
||||
* ; and backslash
|
||||
* </pre>
|
||||
*
|
||||
* @param value the value to test
|
||||
* @throws IllegalArgumentException if the value is invalid per spec
|
||||
*/
|
||||
public static void requireValidRFC6265CookieValue(String value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int valueLen = value.length();
|
||||
if (valueLen == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
if (value.charAt(0) == '"')
|
||||
{
|
||||
// Has starting DQUOTE
|
||||
if (valueLen <= 1 || (value.charAt(valueLen - 1) != '"'))
|
||||
{
|
||||
throw new IllegalArgumentException("RFC6265 Cookie values must have balanced DQUOTES (if used)");
|
||||
}
|
||||
|
||||
// adjust search range to exclude DQUOTES
|
||||
i++;
|
||||
valueLen--;
|
||||
}
|
||||
for (; i < valueLen; i++)
|
||||
{
|
||||
char c = value.charAt(i);
|
||||
|
||||
// 0x00 - 0x1F are low order control characters
|
||||
// 0x7F is the DEL control character
|
||||
if ((c <= 0x1F) || (c == 0x7F))
|
||||
throw new IllegalArgumentException("RFC6265 Cookie values may not contain control characters");
|
||||
if ((c == ' ' /* 0x20 */) ||
|
||||
(c == '"' /* 0x2C */) ||
|
||||
(c == ';' /* 0x3B */) ||
|
||||
(c == '\\' /* 0x5C */))
|
||||
{
|
||||
throw new IllegalArgumentException("RFC6265 Cookie values may not contain character: [" + c + "]");
|
||||
}
|
||||
if (c >= 0x80)
|
||||
throw new IllegalArgumentException("RFC6265 Cookie values characters restricted to US-ASCII: 0x" + Integer.toHexString(c));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.io.IOException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import java.util.function.Predicate;
|
||||
|
@ -64,7 +65,7 @@ public class PathMappings<E> implements Iterable<MappedResource<E>>, Dumpable
|
|||
out.append("PathMappings[size=").append(Integer.toString(_mappings.size())).append("]\n");
|
||||
ContainerLifeCycle.dump(out, indent, _mappings);
|
||||
}
|
||||
|
||||
|
||||
@ManagedAttribute(value = "mappings", readonly = true)
|
||||
public List<MappedResource<E>> getMappings()
|
||||
{
|
||||
|
@ -206,6 +207,18 @@ public class PathMappings<E> implements Iterable<MappedResource<E>>, Dumpable
|
|||
return pathSpecString.charAt(0) == '^' ? new RegexPathSpec(pathSpecString):new ServletPathSpec(pathSpecString);
|
||||
}
|
||||
|
||||
public E get(PathSpec spec)
|
||||
{
|
||||
Optional<E> optionalResource = _mappings.stream()
|
||||
.filter(mappedResource -> mappedResource.getPathSpec().equals(spec))
|
||||
.map(mappedResource -> mappedResource.getResource())
|
||||
.findFirst();
|
||||
if(!optionalResource.isPresent())
|
||||
return null;
|
||||
|
||||
return optionalResource.get();
|
||||
}
|
||||
|
||||
public boolean put(String pathSpecString, E resource)
|
||||
{
|
||||
return put(asPathSpec(pathSpecString),resource);
|
||||
|
|
|
@ -1,134 +1,134 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.http;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.allOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class SyntaxTest
|
||||
{
|
||||
@Test
|
||||
public void testRequireValidRFC2616Token_Good()
|
||||
{
|
||||
String tokens[] = {
|
||||
"name",
|
||||
"",
|
||||
null,
|
||||
"n.a.m.e",
|
||||
"na-me",
|
||||
"+name",
|
||||
"na*me",
|
||||
"na$me",
|
||||
"#name"
|
||||
};
|
||||
|
||||
for (String token : tokens)
|
||||
{
|
||||
Syntax.requireValidRFC2616Token(token, "Test Based");
|
||||
// No exception should occur here
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRequireValidRFC2616Token_Bad()
|
||||
{
|
||||
String tokens[] = {
|
||||
"\"name\"",
|
||||
"name\t",
|
||||
"na me",
|
||||
"name\u0082",
|
||||
"na\tme",
|
||||
"na;me",
|
||||
"{name}",
|
||||
"[name]",
|
||||
"\""
|
||||
};
|
||||
|
||||
for (String token : tokens)
|
||||
{
|
||||
try
|
||||
{
|
||||
Syntax.requireValidRFC2616Token(token, "Test Based");
|
||||
fail("RFC2616 Token [" + token + "] Should have thrown " + IllegalArgumentException.class.getName());
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
assertThat("Testing Bad RFC2616 Token [" + token + "]", e.getMessage(),
|
||||
allOf(containsString("Test Based"),
|
||||
containsString("RFC2616")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRequireValidRFC6265CookieValue_Good()
|
||||
{
|
||||
String values[] = {
|
||||
"value",
|
||||
"",
|
||||
null,
|
||||
"val=ue",
|
||||
"val-ue",
|
||||
"\"value\"",
|
||||
"val/ue",
|
||||
"v.a.l.u.e"
|
||||
};
|
||||
|
||||
for (String value : values)
|
||||
{
|
||||
Syntax.requireValidRFC6265CookieValue(value);
|
||||
// No exception should occur here
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRequireValidRFC6265CookieValue_Bad()
|
||||
{
|
||||
String values[] = {
|
||||
"va\tlue",
|
||||
"\t",
|
||||
"value\u0000",
|
||||
"val\u0082ue",
|
||||
"va lue",
|
||||
"va;lue",
|
||||
"\"value",
|
||||
"value\"",
|
||||
"val\\ue",
|
||||
"val\"ue",
|
||||
"\""
|
||||
};
|
||||
|
||||
for (String value : values)
|
||||
{
|
||||
try
|
||||
{
|
||||
Syntax.requireValidRFC6265CookieValue(value);
|
||||
fail("RFC6265 Cookie Value [" + value + "] Should have thrown " + IllegalArgumentException.class.getName());
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
assertThat("Testing Bad RFC6265 Cookie Value [" + value + "]", e.getMessage(), containsString("RFC6265"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.http;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.allOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class SyntaxTest
|
||||
{
|
||||
@Test
|
||||
public void testRequireValidRFC2616Token_Good()
|
||||
{
|
||||
String tokens[] = {
|
||||
"name",
|
||||
"",
|
||||
null,
|
||||
"n.a.m.e",
|
||||
"na-me",
|
||||
"+name",
|
||||
"na*me",
|
||||
"na$me",
|
||||
"#name"
|
||||
};
|
||||
|
||||
for (String token : tokens)
|
||||
{
|
||||
Syntax.requireValidRFC2616Token(token, "Test Based");
|
||||
// No exception should occur here
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRequireValidRFC2616Token_Bad()
|
||||
{
|
||||
String tokens[] = {
|
||||
"\"name\"",
|
||||
"name\t",
|
||||
"na me",
|
||||
"name\u0082",
|
||||
"na\tme",
|
||||
"na;me",
|
||||
"{name}",
|
||||
"[name]",
|
||||
"\""
|
||||
};
|
||||
|
||||
for (String token : tokens)
|
||||
{
|
||||
try
|
||||
{
|
||||
Syntax.requireValidRFC2616Token(token, "Test Based");
|
||||
fail("RFC2616 Token [" + token + "] Should have thrown " + IllegalArgumentException.class.getName());
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
assertThat("Testing Bad RFC2616 Token [" + token + "]", e.getMessage(),
|
||||
allOf(containsString("Test Based"),
|
||||
containsString("RFC2616")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRequireValidRFC6265CookieValue_Good()
|
||||
{
|
||||
String values[] = {
|
||||
"value",
|
||||
"",
|
||||
null,
|
||||
"val=ue",
|
||||
"val-ue",
|
||||
"\"value\"",
|
||||
"val/ue",
|
||||
"v.a.l.u.e"
|
||||
};
|
||||
|
||||
for (String value : values)
|
||||
{
|
||||
Syntax.requireValidRFC6265CookieValue(value);
|
||||
// No exception should occur here
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRequireValidRFC6265CookieValue_Bad()
|
||||
{
|
||||
String values[] = {
|
||||
"va\tlue",
|
||||
"\t",
|
||||
"value\u0000",
|
||||
"val\u0082ue",
|
||||
"va lue",
|
||||
"va;lue",
|
||||
"\"value",
|
||||
"value\"",
|
||||
"val\\ue",
|
||||
"val\"ue",
|
||||
"\""
|
||||
};
|
||||
|
||||
for (String value : values)
|
||||
{
|
||||
try
|
||||
{
|
||||
Syntax.requireValidRFC6265CookieValue(value);
|
||||
fail("RFC6265 Cookie Value [" + value + "] Should have thrown " + IllegalArgumentException.class.getName());
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
assertThat("Testing Bad RFC6265 Cookie Value [" + value + "]", e.getMessage(), containsString("RFC6265"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
package org.eclipse.jetty.http2.server;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayDeque;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-io</artifactId>
|
||||
|
@ -22,43 +22,9 @@
|
|||
<artifactId>jetty-test-helper</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>artifact-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-jaas</artifactId>
|
||||
|
@ -13,52 +13,6 @@
|
|||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<_versionpolicy> </_versionpolicy>
|
||||
<Import-Package>javax.sql.*,javax.security.*,javax.naming.*,
|
||||
javax.servlet.*;version="[2.6.0,3.2)",
|
||||
*</Import-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- always include the sources to be able to prepare the eclipse-jetty-SDK feature
|
||||
with a snapshot. -->
|
||||
<plugin>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-jaspi</artifactId>
|
||||
|
@ -10,57 +10,10 @@
|
|||
<description>Jetty security infrastructure</description>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.jaspi</bundle-symbolic-name>
|
||||
<bundle-symbolic-name>${project.groupId}.security.jaspi</bundle-symbolic-name>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",*</Import-Package>
|
||||
<Export-Package>org.eclipse.jetty.security.jaspi.*;version="${parsedVersion.osgiVersion}"</Export-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!--
|
||||
Required for OSGI
|
||||
-->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
|
@ -70,6 +23,24 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>jdk9</id>
|
||||
<activation>
|
||||
<jdk>[1.9,)</jdk>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<argLine>@{argLine} --add-modules java.se.ee</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
@ -85,7 +56,6 @@
|
|||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>javax.security.auth.message</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.geronimo.components</groupId>
|
||||
<artifactId>geronimo-jaspi</artifactId>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-jmx</artifactId>
|
||||
|
@ -14,52 +14,6 @@
|
|||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.management.*,*</Import-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!--
|
||||
Required for OSGI
|
||||
-->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
|
@ -80,6 +34,13 @@
|
|||
<artifactId>jetty-util</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.openpojo</groupId>
|
||||
<artifactId>openpojo</artifactId>
|
||||
<version>0.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-jndi</artifactId>
|
||||
|
|
|
@ -2,31 +2,33 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-jspc-maven-plugin</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
<name>Jetty :: Jetty JSPC Maven Plugin</name>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.jspc.plugin</bundle-symbolic-name>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>2.9</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>exec-plugin-doc</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>xdoc</goal>
|
||||
<goal>descriptor</goal>
|
||||
<goal>helpmojo</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
|
@ -90,21 +92,20 @@
|
|||
<version>1.8.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>apache-jstl</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>apache-jstl</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>2.1</version>
|
||||
<configuration>
|
||||
<dependencyLocationEnabled>false</dependencyLocationEnabled>
|
||||
</configuration>
|
||||
<reportSets>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<configuration>
|
||||
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
|
||||
</configuration>
|
||||
<reportSets>
|
||||
<reportSet>
|
||||
<reports>
|
||||
<report>project-team</report>
|
||||
|
@ -116,7 +117,7 @@
|
|||
</reports>
|
||||
</reportSet>
|
||||
</reportSets>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
</project>
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<packaging>maven-plugin</packaging>
|
||||
<name>Jetty :: Jetty Maven Plugin</name>
|
||||
<description>Jetty maven plugins</description>
|
||||
<properties>
|
||||
<mavenVersion>3.0.3</mavenVersion>
|
||||
<pluginToolsVersion>3.4</pluginToolsVersion>
|
||||
|
@ -27,13 +28,11 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>${pluginToolsVersion}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>exec-plugin-doc</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>xdoc</goal>
|
||||
<goal>helpmojo</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
|
@ -165,15 +164,14 @@
|
|||
</dependency>
|
||||
</dependencies>
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>2.1</version>
|
||||
<configuration>
|
||||
<dependencyLocationEnabled>false</dependencyLocationEnabled>
|
||||
</configuration>
|
||||
<reportSets>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<configuration>
|
||||
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
|
||||
</configuration>
|
||||
<reportSets>
|
||||
<reportSet>
|
||||
<reports>
|
||||
<report>project-team</report>
|
||||
|
@ -185,8 +183,8 @@
|
|||
</reports>
|
||||
</reportSet>
|
||||
</reportSets>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
<profiles>
|
||||
<profile>
|
||||
|
|
|
@ -1,78 +1,78 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.maven.plugin;
|
||||
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.MojoFailureException;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* This goal is used to run Jetty with a pre-assembled war.
|
||||
* </p>
|
||||
* <p>
|
||||
* It accepts exactly the same options as the <a href="run-war-mojo.html">run-war</a> goal.
|
||||
* However, it doesn't assume that the current artifact is a
|
||||
* webapp and doesn't try to assemble it into a war before its execution.
|
||||
* So using it makes sense only when used in conjunction with the
|
||||
* <a href="run-war-mojo.html#webApp">war</a> configuration parameter pointing to a pre-built WAR.
|
||||
* </p>
|
||||
* <p>
|
||||
* This goal is useful e.g. for launching a web app in Jetty as a target for unit-tested
|
||||
* HTTP client components.
|
||||
* </p>
|
||||
*
|
||||
* @goal deploy-war
|
||||
* @requiresDependencyResolution runtime
|
||||
* @execute phase="validate"
|
||||
* @description Deploy a pre-assembled war
|
||||
*
|
||||
*/
|
||||
public class JettyDeployWar extends JettyRunWarMojo
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* If true, the plugin should continue and not block. Otherwise the
|
||||
* plugin will block further execution and you will need to use
|
||||
* cntrl-c to stop it.
|
||||
*
|
||||
*
|
||||
* @parameter default-value="true"
|
||||
*/
|
||||
protected boolean daemon = true;
|
||||
|
||||
|
||||
@Override
|
||||
public void execute() throws MojoExecutionException, MojoFailureException
|
||||
{
|
||||
nonBlocking = daemon;
|
||||
super.execute();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void finishConfigurationBeforeStart() throws Exception
|
||||
{
|
||||
super.finishConfigurationBeforeStart();
|
||||
//only stop the server at shutdown if we are blocking
|
||||
server.setStopAtShutdown(!nonBlocking );
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.maven.plugin;
|
||||
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.MojoFailureException;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* This goal is used to run Jetty with a pre-assembled war.
|
||||
* </p>
|
||||
* <p>
|
||||
* It accepts exactly the same options as the <a href="run-war-mojo.html">run-war</a> goal.
|
||||
* However, it doesn't assume that the current artifact is a
|
||||
* webapp and doesn't try to assemble it into a war before its execution.
|
||||
* So using it makes sense only when used in conjunction with the
|
||||
* <a href="run-war-mojo.html#webApp">war</a> configuration parameter pointing to a pre-built WAR.
|
||||
* </p>
|
||||
* <p>
|
||||
* This goal is useful e.g. for launching a web app in Jetty as a target for unit-tested
|
||||
* HTTP client components.
|
||||
* </p>
|
||||
*
|
||||
* @goal deploy-war
|
||||
* @requiresDependencyResolution runtime
|
||||
* @execute phase="validate"
|
||||
* @description Deploy a pre-assembled war
|
||||
*
|
||||
*/
|
||||
public class JettyDeployWar extends JettyRunWarMojo
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* If true, the plugin should continue and not block. Otherwise the
|
||||
* plugin will block further execution and you will need to use
|
||||
* cntrl-c to stop it.
|
||||
*
|
||||
*
|
||||
* @parameter default-value="true"
|
||||
*/
|
||||
protected boolean daemon = true;
|
||||
|
||||
|
||||
@Override
|
||||
public void execute() throws MojoExecutionException, MojoFailureException
|
||||
{
|
||||
nonBlocking = daemon;
|
||||
super.execute();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void finishConfigurationBeforeStart() throws Exception
|
||||
{
|
||||
super.finishConfigurationBeforeStart();
|
||||
//only stop the server at shutdown if we are blocking
|
||||
server.setStopAtShutdown(!nonBlocking );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,25 +1,9 @@
|
|||
<!--
|
||||
// ========================================================================
|
||||
// Copyright (c) Webtide LLC
|
||||
//
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0.txt
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
-->
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-monitor</artifactId>
|
||||
|
@ -31,52 +15,6 @@
|
|||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.management.*,*</Import-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!--
|
||||
Required for OSGI
|
||||
-->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-nosql</artifactId>
|
||||
|
@ -14,57 +14,6 @@
|
|||
<build>
|
||||
<defaultGoal>install</defaultGoal>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",org.eclipse.jetty.server.session.jmx;version="9.1";resolution:=optional,,org.eclipse.jetty.*;version="9.1",*</Import-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>artifact-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
|
@ -87,7 +36,7 @@
|
|||
<dependency>
|
||||
<groupId>org.mongodb</groupId>
|
||||
<artifactId>mongo-java-driver</artifactId>
|
||||
<version>2.6.1</version>
|
||||
<version>2.13.2</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||
<artifactId>jetty-osgi-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-osgi-alpn</artifactId>
|
||||
|
@ -16,7 +16,6 @@
|
|||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>1.7</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>parse-version</id>
|
||||
|
@ -25,26 +24,32 @@
|
|||
</goals>
|
||||
<configuration>
|
||||
<versionString>${alpn.api.version}</versionString>
|
||||
<propertyPrefix>alpn</propertyPrefix>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestEntries>
|
||||
<Bundle-ManifestVersion>2</Bundle-ManifestVersion>
|
||||
<instructions>
|
||||
<Bundle-SymbolicName>${bundle-symbolic-name};singleton:=true</Bundle-SymbolicName>
|
||||
<Bundle-Name>Jetty OSGi ALPN Fragment</Bundle-Name>
|
||||
<Bundle-Version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</Bundle-Version>
|
||||
<Export-Package>org.eclipse.jetty.alpn;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"</Export-Package>
|
||||
<Import-Package>!javax.*;!org.eclipse.jetty.*</Import-Package>
|
||||
<Export-Package>org.eclipse.jetty.alpn;version="${alpn.majorVersion}.${alpn.minorVersion}.${alpn.incrementalVersion}"</Export-Package>
|
||||
<Fragment-Host>system.bundle;extension:=framework</Fragment-Host>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.alpn</groupId>
|
||||
<artifactId>alpn-api</artifactId>
|
||||
<version>${alpn.api.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||
<artifactId>jetty-osgi-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-osgi-boot-jsp</artifactId>
|
||||
|
@ -42,67 +42,14 @@
|
|||
<artifactId>apache-jsp</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>javax.servlet.jsp.jstl</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.web</groupId>
|
||||
<artifactId>javax.servlet.jsp.jstl</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mortbay.jasper</groupId>
|
||||
<artifactId>apache-el</artifactId>
|
||||
<version>8.0.9.M3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>javax.el</groupId>
|
||||
<artifactId>javax.el-api</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
-->
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>artifact-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-jar</id>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>target/classes/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bundle-manifest</id>
|
||||
<phase>process-classes</phase>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-Name>Jetty-OSGi-Jasper Integration</Bundle-Name>
|
||||
|
@ -110,6 +57,7 @@
|
|||
<Fragment-Host>org.eclipse.jetty.osgi.boot</Fragment-Host>
|
||||
<Export-Package>!org.eclipse.jetty.osgi.boot.*</Export-Package>
|
||||
<Import-Package>org.eclipse.jdt.*;resolution:=optional,
|
||||
org.eclipse.jdt.core.compiler.*;resolution:=optional,
|
||||
com.sun.el;resolution:=optional,
|
||||
com.sun.el.lang;resolution:=optional,
|
||||
com.sun.el.parser;resolution:=optional,
|
||||
|
@ -125,20 +73,20 @@
|
|||
javax.servlet.jsp.jstl.fmt;version="1.2";resolution:=optional,
|
||||
javax.servlet.jsp.jstl.sql;version="1.2";resolution:=optional,
|
||||
javax.servlet.jsp.jstl.tlv;version="1.2";resolution:=optional,
|
||||
org.apache.el;version="[8.0.9,9)";resolution:=optional,
|
||||
org.apache.el.lang;version="[8.0.9,9)";resolution:=optional,
|
||||
org.apache.el.stream;version="[8.0.9,9)";resolution:=optional,
|
||||
org.apache.el.util;version="[8.0.9,9)";resolution:=optional,
|
||||
org.apache.el.parser;version="[8.0.9,9)";resolution:=optional,
|
||||
org.apache.jasper;version="[8.0.9,9)";resolution:=optional,
|
||||
org.apache.jasper.compiler;version="[8.0.9,9)";resolution:=optional,
|
||||
org.apache.jasper.compiler.tagplugin;version="[8.0.9,9)";resolution:=optional,
|
||||
org.apache.jasper.runtime;version="[8.0.9,9)";resolution:=optional,
|
||||
org.apache.jasper.security;version="[8.0.9,9)";resolution:=optional,
|
||||
org.apache.jasper.servlet;version="[8.0.9,9)";resolution:=optional,
|
||||
org.apache.jasper.tagplugins.jstl;version="[8.0.9,9)";resolution:=optional,
|
||||
org.apache.jasper.util;version="[8.0.9,9)";resolution:=optional,
|
||||
org.apache.jasper.xmlparser;version="[8.0.9,9)";resolution:=optional,
|
||||
org.apache.el;version="[8.0.23,9)";resolution:=optional,
|
||||
org.apache.el.lang;version="[8.0.23,9)";resolution:=optional,
|
||||
org.apache.el.stream;version="[8.0.23,9)";resolution:=optional,
|
||||
org.apache.el.util;version="[8.0.23,9)";resolution:=optional,
|
||||
org.apache.el.parser;version="[8.0.23,9)";resolution:=optional,
|
||||
org.apache.jasper;version="[8.0.23,9)";resolution:=optional,
|
||||
org.apache.jasper.compiler;version="[8.0.23,9)";resolution:=optional,
|
||||
org.apache.jasper.compiler.tagplugin;version="[8.0.23,9)";resolution:=optional,
|
||||
org.apache.jasper.runtime;version="[8.0.23,9)";resolution:=optional,
|
||||
org.apache.jasper.security;version="[8.0.23,9)";resolution:=optional,
|
||||
org.apache.jasper.servlet;version="[8.0.23,9)";resolution:=optional,
|
||||
org.apache.jasper.tagplugins.jstl;version="[8.0.23,9)";resolution:=optional,
|
||||
org.apache.jasper.util;version="[8.0.23,9)";resolution:=optional,
|
||||
org.apache.jasper.xmlparser;version="[8.0.23,9)";resolution:=optional,
|
||||
org.apache.taglibs.standard;version="1.2";resolution:=optional,
|
||||
org.apache.taglibs.standard.extra.spath;version="1.2";resolution:=optional,
|
||||
org.apache.taglibs.standard.functions;version="1.2";resolution:=optional,
|
||||
|
@ -162,8 +110,8 @@
|
|||
org.apache.taglibs.standard.tag.rt.xml;version="1.2";resolution:=optional,
|
||||
org.apache.taglibs.standard.tei;version="1.2";resolution:=optional,
|
||||
org.apache.taglibs.standard.tlv;version="1.2";resolution:=optional,
|
||||
org.apache.tomcat;version="[8.0.9,9)";resolution:=optional,
|
||||
org.eclipse.jetty.jsp;version="[9.2,10)";resolution:=optional,
|
||||
org.apache.tomcat;version="[8.0.23,9)";resolution:=optional,
|
||||
org.eclipse.jetty.jsp;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))";resolution:=optional,
|
||||
org.osgi.*,
|
||||
org.xml.*;resolution:=optional,
|
||||
org.xml.sax.*;resolution:=optional,
|
||||
|
@ -172,8 +120,7 @@
|
|||
org.w3c.dom.ls;resolution:=optional,
|
||||
javax.xml.parser;resolution:=optional
|
||||
</Import-Package>
|
||||
<_nouses>true</_nouses>
|
||||
<DynamicImport-Package>org.eclipse.jetty.jsp.*;version="9.2.6",org.apache.jasper.*;version="8.0.9",org.apache.el.*;version="8.0.9"</DynamicImport-Package>
|
||||
<DynamicImport-Package>org.eclipse.jetty.jsp.*;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))",org.apache.jasper.*;version="8.0.23",org.apache.el.*;version="8.0.23"</DynamicImport-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||
<artifactId>jetty-osgi-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -19,49 +19,17 @@
|
|||
<artifactId>jetty-util</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.osgi</groupId>
|
||||
<artifactId>org.eclipse.osgi</artifactId>
|
||||
<groupId>org.eclipse.osgi</groupId>
|
||||
<artifactId>org.eclipse.osgi</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>artifact-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-jar</id>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>target/classes/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bundle-manifest</id>
|
||||
<phase>process-classes</phase>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-Name>RFC66 War URL</Bundle-Name>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||
<artifactId>jetty-osgi-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-osgi-boot</artifactId>
|
||||
|
@ -30,8 +30,8 @@
|
|||
<artifactId>jetty-jmx</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.osgi</groupId>
|
||||
<artifactId>org.eclipse.osgi</artifactId>
|
||||
<groupId>org.eclipse.osgi</groupId>
|
||||
<artifactId>org.eclipse.osgi</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.osgi</groupId>
|
||||
|
@ -62,47 +62,15 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>artifact-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-jar</id>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>target/classes/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bundle-manifest</id>
|
||||
<phase>process-classes</phase>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-SymbolicName>org.eclipse.jetty.osgi.boot;singleton:=true</Bundle-SymbolicName>
|
||||
<Bundle-Activator>org.eclipse.jetty.osgi.boot.JettyBootstrapActivator</Bundle-Activator>
|
||||
<DynamicImport-Package>org.eclipse.jetty.*;version="[9.1,10.0)"</DynamicImport-Package>
|
||||
<DynamicImport-Package>org.eclipse.jetty.*;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))"</DynamicImport-Package>
|
||||
<Import-Package>javax.mail;version="1.4.0";resolution:=optional,
|
||||
javax.mail.event;version="1.4.0";resolution:=optional,
|
||||
javax.mail.internet;version="1.4.0";resolution:=optional,
|
||||
|
@ -112,8 +80,6 @@
|
|||
javax.servlet.http;version="[3.1,3.2)",
|
||||
javax.transaction;version="1.1.0";resolution:=optional,
|
||||
javax.transaction.xa;version="1.1.0";resolution:=optional,
|
||||
org.eclipse.jetty.annotations;version="9.1";resolution:=optional,
|
||||
org.eclipse.jetty.plus.webapp;version="9.1";resolution:=optional,
|
||||
org.objectweb.asm;version=4;resolution:=optional,
|
||||
org.osgi.framework,
|
||||
org.osgi.service.cm;version="1.2.0",
|
||||
|
@ -126,6 +92,7 @@
|
|||
org.slf4j.helpers;resolution:=optional,
|
||||
org.xml.sax,
|
||||
org.xml.sax.helpers,
|
||||
org.eclipse.jetty.annotations;resolution:=optional,
|
||||
*
|
||||
</Import-Package>
|
||||
<_nouses>true</_nouses>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||
<artifactId>jetty-osgi-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-httpservice</artifactId>
|
||||
|
@ -56,42 +56,10 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>artifact-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-jar</id>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>target/classes/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bundle-manifest</id>
|
||||
<phase>process-classes</phase>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-SymbolicName>org.eclipse.jetty.osgi.httpservice</Bundle-SymbolicName>
|
||||
|
|
|
@ -1,15 +1,19 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||
<artifactId>jetty-osgi-project</artifactId>
|
||||
<name>Jetty :: OSGi</name>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<osgi-version>3.6.0.v20100517</osgi-version>
|
||||
<osgi-services-version>3.2.100.v20100503</osgi-services-version>
|
||||
|
@ -18,6 +22,7 @@
|
|||
<logback-version>0.9.29</logback-version>
|
||||
<slf4j-version>1.6.1</slf4j-version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
<module>jetty-osgi-boot</module>
|
||||
<module>jetty-osgi-boot-jsp</module>
|
||||
|
@ -25,22 +30,23 @@
|
|||
<module>jetty-osgi-httpservice</module>
|
||||
<module>test-jetty-osgi-webapp</module>
|
||||
<module>test-jetty-osgi-context</module>
|
||||
<module>test-jetty-osgi</module>
|
||||
<module>test-jetty-osgi-fragment</module>
|
||||
<module>test-jetty-osgi-server</module>
|
||||
<module>jetty-osgi-alpn</module>
|
||||
</modules>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>npn</id>
|
||||
<id>jdk8</id>
|
||||
<activation>
|
||||
<jdk>1.7</jdk>
|
||||
<jdk>[1.8,1.9)</jdk>
|
||||
</activation>
|
||||
<modules>
|
||||
<!--
|
||||
<module>jetty-osgi-npn</module>
|
||||
-->
|
||||
<module>test-jetty-osgi</module>
|
||||
</modules>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
|
@ -72,7 +78,6 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-eclipse-plugin</artifactId>
|
||||
<version>2.8</version>
|
||||
<configuration>
|
||||
<manifest>prevent/overwriting/by/pointing/to/nonexisting/MANIFEST.MF</manifest>
|
||||
<pde>true</pde>
|
||||
|
@ -91,6 +96,7 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -192,4 +198,5 @@
|
|||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||
<artifactId>jetty-osgi-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>test-jetty-osgi-context</artifactId>
|
||||
<name>Jetty :: OSGi :: Context</name>
|
||||
<name>Jetty :: OSGi :: Test Context</name>
|
||||
<description>Test Jetty OSGi bundle with a ContextHandler</description>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<properties>
|
||||
|
@ -19,87 +19,55 @@
|
|||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.osgi</groupId>
|
||||
<artifactId>org.eclipse.osgi</artifactId>
|
||||
<scope>provided</scope>
|
||||
<groupId>org.eclipse.osgi</groupId>
|
||||
<artifactId>org.eclipse.osgi</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.osgi</groupId>
|
||||
<artifactId>org.eclipse.osgi.services</artifactId>
|
||||
<scope>provided</scope>
|
||||
<groupId>org.eclipse.osgi</groupId>
|
||||
<artifactId>org.eclipse.osgi.services</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-schemas</artifactId>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-schemas</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/context</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/context</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- DO NOT DEPLOY (or Release) -->
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>artifact-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-jar</id>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>target/classes/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bundle-manifest</id>
|
||||
<phase>process-classes</phase>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-SymbolicName>org.eclipse.jetty.osgi.testcontext;singleton:=true</Bundle-SymbolicName>
|
||||
<Bundle-Name>Jetty OSGi Test Context</Bundle-Name>
|
||||
<Bundle-Activator>com.acme.osgi.Activator</Bundle-Activator>
|
||||
<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
|
||||
<!-- disable the uses directive: jetty will accomodate pretty much any versions
|
||||
of the packages it uses; no need to reflect some tight dependency determined at
|
||||
compilation time. -->
|
||||
<_nouses>true</_nouses>
|
||||
<Import-Package>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- DO NOT DEPLOY (or Release) -->
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-SymbolicName>org.eclipse.jetty.osgi.testcontext;singleton:=true</Bundle-SymbolicName>
|
||||
<Bundle-Name>Jetty OSGi Test Context</Bundle-Name>
|
||||
<Bundle-Activator>com.acme.osgi.Activator</Bundle-Activator>
|
||||
<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
|
||||
<!-- disable the uses directive: jetty will accommodate pretty much any versions
|
||||
of the packages it uses; no need to reflect some tight dependency determined at
|
||||
compilation time. -->
|
||||
<_nouses>true</_nouses>
|
||||
<Import-Package>
|
||||
javax.servlet;version="[3.1,3.2)",
|
||||
javax.servlet.resources;version="[3.1,3.2)",
|
||||
org.osgi.framework,
|
||||
|
@ -109,17 +77,17 @@
|
|||
org.osgi.service.url;version="1.0.0",
|
||||
org.osgi.util.tracker;version="1.3.0",
|
||||
org.slf4j;resolution:=optional,
|
||||
org.slf4j.spi;resolution:=optional,
|
||||
org.slf4j.spi;resolution:=optional,
|
||||
org.slf4j.helpers;resolution:=optional,
|
||||
org.xml.sax,
|
||||
org.xml.sax.helpers,
|
||||
*
|
||||
</Import-Package>
|
||||
<DynamicImport-Package>org.eclipse.jetty.*;version="[9.1,10.0)"</DynamicImport-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</Import-Package>
|
||||
<DynamicImport-Package>org.eclipse.jetty.*;version="[9.1,10.0)"</DynamicImport-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||
<artifactId>jetty-osgi-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>test-jetty-osgi-webapp</artifactId>
|
||||
<name>Jetty :: OSGi :: WebApp</name>
|
||||
<name>Jetty :: OSGi :: Test WebApp</name>
|
||||
<description>Test Jetty OSGi Webapp bundle</description>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<properties>
|
||||
|
@ -19,80 +19,47 @@
|
|||
<artifactId>jetty-webapp</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.osgi</groupId>
|
||||
<artifactId>org.eclipse.osgi</artifactId>
|
||||
<scope>provided</scope>
|
||||
<groupId>org.eclipse.osgi</groupId>
|
||||
<artifactId>org.eclipse.osgi</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.osgi</groupId>
|
||||
<artifactId>org.eclipse.osgi.services</artifactId>
|
||||
<scope>provided</scope>
|
||||
<groupId>org.eclipse.osgi</groupId>
|
||||
<artifactId>org.eclipse.osgi.services</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- DO NOT DEPLOY (or Release) -->
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>artifact-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-jar</id>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>target/classes/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bundle-manifest</id>
|
||||
<phase>process-classes</phase>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-SymbolicName>org.eclipse.jetty.osgi.testapp;singleton:=true</Bundle-SymbolicName>
|
||||
<Bundle-Name>Jetty OSGi Test WebApp</Bundle-Name>
|
||||
<Bundle-Activator>com.acme.osgi.Activator</Bundle-Activator>
|
||||
<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
|
||||
<!-- disable the uses directive: jetty will accomodate pretty much any versions
|
||||
of the packages it uses; no need to reflect some tight dependency determined at
|
||||
compilation time. -->
|
||||
<_nouses>true</_nouses>
|
||||
<Import-Package>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- DO NOT DEPLOY (or Release) -->
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-SymbolicName>org.eclipse.jetty.osgi.testapp;singleton:=true</Bundle-SymbolicName>
|
||||
<Bundle-Name>Jetty OSGi Test WebApp</Bundle-Name>
|
||||
<Bundle-Activator>com.acme.osgi.Activator</Bundle-Activator>
|
||||
<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
|
||||
<!-- disable the uses directive: jetty will accomodate pretty much any versions
|
||||
of the packages it uses; no need to reflect some tight dependency determined at
|
||||
compilation time. -->
|
||||
<Import-Package>
|
||||
org.osgi.framework,
|
||||
org.osgi.service.cm;version="1.2.0",
|
||||
org.osgi.service.packageadmin,
|
||||
|
@ -100,17 +67,17 @@
|
|||
org.osgi.service.url;version="1.0.0",
|
||||
org.osgi.util.tracker;version="1.3.0",
|
||||
org.slf4j;resolution:=optional,
|
||||
org.slf4j.spi;resolution:=optional,
|
||||
org.slf4j.spi;resolution:=optional,
|
||||
org.slf4j.helpers;resolution:=optional,
|
||||
org.xml.sax,
|
||||
org.xml.sax.helpers,
|
||||
*
|
||||
</Import-Package>
|
||||
<DynamicImport-Package>org.eclipse.jetty.*;version="[9.1,10.0)"</DynamicImport-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</Import-Package>
|
||||
<Export-Package>com.acme.osgi</Export-Package>
|
||||
<DynamicImport-Package>org.eclipse.jetty.*;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))"</DynamicImport-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||
<artifactId>jetty-osgi-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -11,16 +11,15 @@
|
|||
<description>Jetty OSGi Integration test</description>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.boot.test.spdy</bundle-symbolic-name>
|
||||
<bundle-symbolic-name>${project.groupId}.boot.test.osgi</bundle-symbolic-name>
|
||||
<jetty-orbit-url>http://download.eclipse.org/jetty/orbit/</jetty-orbit-url>
|
||||
<assembly-directory>target/distribution</assembly-directory>
|
||||
<exam.version>3.5.0</exam.version>
|
||||
<url.version>1.5.2</url.version>
|
||||
<exam.version>4.10.0</exam.version>
|
||||
<url.version>2.5.2</url.version>
|
||||
<injection.bundle.version>1.0</injection.bundle.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- Pax Exam Dependencies -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ops4j.pax.exam</groupId>
|
||||
<artifactId>pax-exam</artifactId>
|
||||
|
@ -33,16 +32,13 @@
|
|||
<version>${exam.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- use the forked container so we can pass it system properties eg for npn/alpn -->
|
||||
<!-- Use the forked container so we can pass it system properties eg for alpn -->
|
||||
<dependency>
|
||||
<groupId>org.ops4j.pax.exam</groupId>
|
||||
<artifactId>pax-exam-container-forked</artifactId>
|
||||
<version>${exam.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.ops4j.pax.exam</groupId>
|
||||
<artifactId>pax-exam-junit4</artifactId>
|
||||
|
@ -68,34 +64,19 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- OSGi R4 frameworks -->
|
||||
<!--
|
||||
<dependency>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>org.apache.felix.framework</artifactId>
|
||||
<version>4.4.0</version>
|
||||
<groupId>org.eclipse.platform</groupId>
|
||||
<artifactId>org.eclipse.osgi</artifactId>
|
||||
<version>3.11.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.osgi</groupId>
|
||||
<artifactId>org.osgi.enterprise</artifactId>
|
||||
<version>5.0.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>org.eclipse</groupId>
|
||||
<artifactId>osgi</artifactId>
|
||||
<version>3.10.0-v20140606-1445</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.osgi</groupId>
|
||||
<groupId>org.eclipse.platform</groupId>
|
||||
<artifactId>org.eclipse.osgi.services</artifactId>
|
||||
<version>3.5.100</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Jetty OSGi Deps -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||
|
@ -129,7 +110,6 @@
|
|||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||
<artifactId>jetty-httpservice</artifactId>
|
||||
|
@ -142,14 +122,12 @@
|
|||
<artifactId>jetty-osgi-servlet-api</artifactId>
|
||||
<version>3.1.0.M3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-jta_1.1_spec</artifactId>
|
||||
<version>1.1.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-atinject_1.0_spec</artifactId>
|
||||
|
@ -162,14 +140,44 @@
|
|||
<version>1.0.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mortbay.jasper</groupId>
|
||||
<artifactId>apache-el</artifactId>
|
||||
<version>8.0.33</version>
|
||||
<scope>test</scope>
|
||||
<groupId>org.glassfish.web</groupId>
|
||||
<artifactId>javax.servlet.jsp.jstl</artifactId>
|
||||
<version>1.2.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>javax.servlet.jsp.jstl</groupId>
|
||||
<artifactId>jstl-api</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>javax.servlet.jsp</groupId>
|
||||
<artifactId>jsp-api</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>javax.el</groupId>
|
||||
<artifactId>el-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>javax.servlet.jsp.jstl</artifactId>
|
||||
<version>1.2.0.v201105211821</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>javax.servlet</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>javax.servlet.jsp</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Jetty Deps -->
|
||||
<dependency>
|
||||
|
@ -223,6 +231,7 @@
|
|||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-util</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -279,34 +288,14 @@
|
|||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.spdy</groupId>
|
||||
<artifactId>spdy-core</artifactId>
|
||||
<groupId>org.eclipse.jetty.http2</groupId>
|
||||
<artifactId>http2-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.spdy</groupId>
|
||||
<artifactId>spdy-server</artifactId>
|
||||
<groupId>org.eclipse.jetty.http2</groupId>
|
||||
<artifactId>http2-hpack</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.spdy</groupId>
|
||||
<artifactId>spdy-http-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.spdy</groupId>
|
||||
<artifactId>spdy-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mortbay.jetty.alpn</groupId>
|
||||
<artifactId>alpn-boot</artifactId>
|
||||
<version>${alpn.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||
|
@ -325,8 +314,6 @@
|
|||
<artifactId>jetty-schemas</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-plus</artifactId>
|
||||
|
@ -342,7 +329,6 @@
|
|||
<classifier>webbundle</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-spec-webapp</artifactId>
|
||||
|
@ -350,21 +336,29 @@
|
|||
<type>war</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-container-initializer</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||
<artifactId>test-jetty-osgi-fragment</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||
<artifactId>test-jetty-osgi-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-mock-resources</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.osgi</groupId>
|
||||
<artifactId>test-jetty-osgi-context</artifactId>
|
||||
|
@ -382,30 +376,28 @@
|
|||
<artifactId>jetty-test-helper</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>${slf4j-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<!-- downgrading to version 2.18 here as there's a known JVM crash issue with the 2.19.x series -->
|
||||
<version>2.18.1</version>
|
||||
<configuration>
|
||||
<!-- No point defining -Xbootclasspath as the actual OSGi VM is run as a forked process by pax-exam -->
|
||||
<!-- But we do pass the sys property of the alpn-boot jar so that it can be configued inside tests -->
|
||||
<!-- But we do pass the sys property of the alpn-boot jar so that it can be configured inside tests -->
|
||||
<argLine>-Dmortbay-alpn-boot=${settings.localRepository}/org/mortbay/jetty/alpn/alpn-boot/${alpn.version}/alpn-boot-${alpn.version}.jar</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.5.1</version>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.servicemix.tooling</groupId>
|
||||
<artifactId>depends-maven-plugin</artifactId>
|
||||
<version>1.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate-depends-file</id>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-plus</artifactId>
|
||||
|
@ -14,59 +14,6 @@
|
|||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<_nouses>true</_nouses>
|
||||
<!-- Export-Package>
|
||||
org.eclipse.jetty.plus.annotation;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}",
|
||||
org.eclipse.jetty.plus.webapp;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}",
|
||||
org.eclipse.jetty.plus.jndi;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}",
|
||||
org.eclipse.jetty.plus.security;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
|
||||
</Export-Package -->
|
||||
<Import-Package>javax.sql.*,javax.security.*,javax.naming.*,
|
||||
javax.servlet.*;version="[2.6.0,3.2)",javax.transaction.*;version="[1.1,1.3)",
|
||||
*
|
||||
</Import-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- always include the sources to be able to prepare the eclipse-jetty-SDK feature
|
||||
with a snapshot. -->
|
||||
<plugin>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-proxy</artifactId>
|
||||
|
@ -14,52 +14,6 @@
|
|||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",*</Import-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!--
|
||||
Required for OSGI
|
||||
-->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
|
@ -97,6 +51,13 @@
|
|||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-http</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-test-helper</artifactId>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
@ -10,6 +10,9 @@
|
|||
<name>Jetty :: Quick Start</name>
|
||||
<description>Jetty Quick Start</description>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.quickstart</bundle-symbolic-name>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
@ -79,26 +82,14 @@
|
|||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-test-helper</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-rewrite</artifactId>
|
||||
|
@ -14,52 +14,6 @@
|
|||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",*</Import-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!--
|
||||
Required for OSGI
|
||||
-->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-runner</artifactId>
|
||||
|
@ -10,6 +10,7 @@
|
|||
|
||||
<properties>
|
||||
<assembly-directory>target/distribution</assembly-directory>
|
||||
<bundle-symbolic-name>${project.groupId}.runner</bundle-symbolic-name>
|
||||
</properties>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<build>
|
||||
|
@ -20,7 +21,7 @@
|
|||
<executions>
|
||||
<execution>
|
||||
<id>unpack-dependencies</id>
|
||||
<phase>package</phase>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
</goals>
|
||||
|
@ -35,42 +36,46 @@
|
|||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins </groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>package</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>org.eclipse.jetty.runner.Runner</mainClass>
|
||||
</manifest>
|
||||
<manifestEntries>
|
||||
<mode>development</mode>
|
||||
<url>http://eclipse.org/jetty</url>
|
||||
<Built-By>${user.name}</Built-By>
|
||||
<package>org.eclipse.jetty.runner</package>
|
||||
<Bundle-Name>Jetty Runner</Bundle-Name>
|
||||
<Bundle-Vendor>Mort Bay Consulting</Bundle-Vendor>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Main-Class>org.eclipse.jetty.runner.Runner</Main-Class>
|
||||
<Import-Package>!*</Import-Package>
|
||||
<Export-Package />
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.neo4j.build.plugins</groupId>
|
||||
<artifactId>clirr-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- Clirr fails with "org.apache.tools.ant.Task not found" on this project -->
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
|
@ -99,10 +104,15 @@
|
|||
<artifactId>jetty-jndi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jsp</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>apache-jsp</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>apache-jstl</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-security</artifactId>
|
||||
|
@ -25,42 +25,13 @@
|
|||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",javax.security.cert,*</Import-Package>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",javax.security.cert,org.eclipse.jetty*;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))",*</Import-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!--
|
||||
Required for OSGI
|
||||
-->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
|
|
|
@ -1,184 +1,184 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.security;
|
||||
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.startsWith;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.jetty.http.HttpStatus;
|
||||
import org.eclipse.jetty.server.Connector;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.LocalConnector;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||
import org.eclipse.jetty.server.handler.DefaultHandler;
|
||||
import org.eclipse.jetty.server.handler.HandlerList;
|
||||
import org.eclipse.jetty.server.handler.ResourceHandler;
|
||||
import org.eclipse.jetty.server.session.SessionHandler;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.eclipse.jetty.util.security.Constraint;
|
||||
import org.eclipse.jetty.util.security.Password;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.junit.runners.Parameterized.Parameter;
|
||||
import org.junit.runners.Parameterized.Parameters;
|
||||
|
||||
/**
|
||||
* Some requests for static data that is served by ResourceHandler, but some is secured.
|
||||
* <p>
|
||||
* This is mainly here to test security bypass techniques using aliased names that should be caught.
|
||||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
public class AliasedConstraintTest
|
||||
{
|
||||
private static final String TEST_REALM = "TestRealm";
|
||||
private static Server server;
|
||||
private static LocalConnector connector;
|
||||
private static ConstraintSecurityHandler security;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void startServer() throws Exception
|
||||
{
|
||||
server = new Server();
|
||||
connector = new LocalConnector(server);
|
||||
server.setConnectors(new Connector[] { connector });
|
||||
|
||||
ContextHandler context = new ContextHandler();
|
||||
SessionHandler session = new SessionHandler();
|
||||
|
||||
TestLoginService loginService = new TestLoginService(TEST_REALM);
|
||||
|
||||
loginService.putUser("user0",new Password("password"),new String[] {});
|
||||
loginService.putUser("user",new Password("password"),new String[] { "user" });
|
||||
loginService.putUser("user2",new Password("password"),new String[] { "user" });
|
||||
loginService.putUser("admin",new Password("password"),new String[] { "user", "administrator" });
|
||||
loginService.putUser("user3",new Password("password"),new String[] { "foo" });
|
||||
|
||||
context.setContextPath("/ctx");
|
||||
context.setResourceBase(MavenTestingUtils.getTestResourceDir("docroot").getAbsolutePath());
|
||||
|
||||
HandlerList handlers = new HandlerList();
|
||||
handlers.setHandlers(new Handler[]{context,new DefaultHandler()});
|
||||
server.setHandler(handlers);
|
||||
context.setHandler(session);
|
||||
// context.addAliasCheck(new AllowSymLinkAliasChecker());
|
||||
|
||||
server.addBean(loginService);
|
||||
|
||||
security = new ConstraintSecurityHandler();
|
||||
session.setHandler(security);
|
||||
ResourceHandler handler = new ResourceHandler();
|
||||
security.setHandler(handler);
|
||||
|
||||
List<ConstraintMapping> constraints = new ArrayList<>();
|
||||
|
||||
Constraint constraint0 = new Constraint();
|
||||
constraint0.setAuthenticate(true);
|
||||
constraint0.setName("forbid");
|
||||
ConstraintMapping mapping0 = new ConstraintMapping();
|
||||
mapping0.setPathSpec("/forbid/*");
|
||||
mapping0.setConstraint(constraint0);
|
||||
constraints.add(mapping0);
|
||||
|
||||
Set<String> knownRoles = new HashSet<>();
|
||||
knownRoles.add("user");
|
||||
knownRoles.add("administrator");
|
||||
|
||||
security.setConstraintMappings(constraints,knownRoles);
|
||||
server.start();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void stopServer() throws Exception
|
||||
{
|
||||
server.stop();
|
||||
}
|
||||
|
||||
@Parameters(name = "{0}: {1}")
|
||||
public static Collection<Object[]> data()
|
||||
{
|
||||
List<Object[]> data = new ArrayList<>();
|
||||
|
||||
final String OPENCONTENT = "this is open content";
|
||||
|
||||
data.add(new Object[] { "/ctx/all/index.txt", HttpStatus.OK_200, OPENCONTENT });
|
||||
data.add(new Object[] { "/ctx/ALL/index.txt", HttpStatus.NOT_FOUND_404, null });
|
||||
data.add(new Object[] { "/ctx/ALL/Fred/../index.txt", HttpStatus.NOT_FOUND_404, null });
|
||||
data.add(new Object[] { "/ctx/../bar/../ctx/all/index.txt", HttpStatus.OK_200, OPENCONTENT });
|
||||
data.add(new Object[] { "/ctx/forbid/index.txt", HttpStatus.FORBIDDEN_403, null });
|
||||
data.add(new Object[] { "/ctx/all/../forbid/index.txt", HttpStatus.FORBIDDEN_403, null });
|
||||
data.add(new Object[] { "/ctx/FoRbId/index.txt", HttpStatus.NOT_FOUND_404, null });
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@Parameter(value = 0)
|
||||
public String uri;
|
||||
|
||||
@Parameter(value = 1)
|
||||
public int expectedStatusCode;
|
||||
|
||||
@Parameter(value = 2)
|
||||
public String expectedContent;
|
||||
|
||||
@Test
|
||||
public void testAccess() throws Exception
|
||||
{
|
||||
StringBuilder request = new StringBuilder();
|
||||
request.append("GET ").append(uri).append(" HTTP/1.1\r\n");
|
||||
request.append("Host: localhost\r\n");
|
||||
request.append("Connection: close\r\n");
|
||||
request.append("\r\n");
|
||||
|
||||
String response = connector.getResponse(request.toString());
|
||||
|
||||
switch (expectedStatusCode)
|
||||
{
|
||||
case 200:
|
||||
assertThat(response,startsWith("HTTP/1.1 200 OK"));
|
||||
break;
|
||||
case 403:
|
||||
assertThat(response,startsWith("HTTP/1.1 403 Forbidden"));
|
||||
break;
|
||||
case 404:
|
||||
assertThat(response,startsWith("HTTP/1.1 404 Not Found"));
|
||||
break;
|
||||
default:
|
||||
fail("Write a handler for response status code: " + expectedStatusCode);
|
||||
break;
|
||||
}
|
||||
|
||||
if (expectedContent != null)
|
||||
{
|
||||
assertThat(response,containsString("this is open content"));
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.security;
|
||||
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.startsWith;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.jetty.http.HttpStatus;
|
||||
import org.eclipse.jetty.server.Connector;
|
||||
import org.eclipse.jetty.server.Handler;
|
||||
import org.eclipse.jetty.server.LocalConnector;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||
import org.eclipse.jetty.server.handler.DefaultHandler;
|
||||
import org.eclipse.jetty.server.handler.HandlerList;
|
||||
import org.eclipse.jetty.server.handler.ResourceHandler;
|
||||
import org.eclipse.jetty.server.session.SessionHandler;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.eclipse.jetty.util.security.Constraint;
|
||||
import org.eclipse.jetty.util.security.Password;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.junit.runners.Parameterized.Parameter;
|
||||
import org.junit.runners.Parameterized.Parameters;
|
||||
|
||||
/**
|
||||
* Some requests for static data that is served by ResourceHandler, but some is secured.
|
||||
* <p>
|
||||
* This is mainly here to test security bypass techniques using aliased names that should be caught.
|
||||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
public class AliasedConstraintTest
|
||||
{
|
||||
private static final String TEST_REALM = "TestRealm";
|
||||
private static Server server;
|
||||
private static LocalConnector connector;
|
||||
private static ConstraintSecurityHandler security;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void startServer() throws Exception
|
||||
{
|
||||
server = new Server();
|
||||
connector = new LocalConnector(server);
|
||||
server.setConnectors(new Connector[] { connector });
|
||||
|
||||
ContextHandler context = new ContextHandler();
|
||||
SessionHandler session = new SessionHandler();
|
||||
|
||||
TestLoginService loginService = new TestLoginService(TEST_REALM);
|
||||
|
||||
loginService.putUser("user0",new Password("password"),new String[] {});
|
||||
loginService.putUser("user",new Password("password"),new String[] { "user" });
|
||||
loginService.putUser("user2",new Password("password"),new String[] { "user" });
|
||||
loginService.putUser("admin",new Password("password"),new String[] { "user", "administrator" });
|
||||
loginService.putUser("user3",new Password("password"),new String[] { "foo" });
|
||||
|
||||
context.setContextPath("/ctx");
|
||||
context.setResourceBase(MavenTestingUtils.getTestResourceDir("docroot").getAbsolutePath());
|
||||
|
||||
HandlerList handlers = new HandlerList();
|
||||
handlers.setHandlers(new Handler[]{context,new DefaultHandler()});
|
||||
server.setHandler(handlers);
|
||||
context.setHandler(session);
|
||||
// context.addAliasCheck(new AllowSymLinkAliasChecker());
|
||||
|
||||
server.addBean(loginService);
|
||||
|
||||
security = new ConstraintSecurityHandler();
|
||||
session.setHandler(security);
|
||||
ResourceHandler handler = new ResourceHandler();
|
||||
security.setHandler(handler);
|
||||
|
||||
List<ConstraintMapping> constraints = new ArrayList<>();
|
||||
|
||||
Constraint constraint0 = new Constraint();
|
||||
constraint0.setAuthenticate(true);
|
||||
constraint0.setName("forbid");
|
||||
ConstraintMapping mapping0 = new ConstraintMapping();
|
||||
mapping0.setPathSpec("/forbid/*");
|
||||
mapping0.setConstraint(constraint0);
|
||||
constraints.add(mapping0);
|
||||
|
||||
Set<String> knownRoles = new HashSet<>();
|
||||
knownRoles.add("user");
|
||||
knownRoles.add("administrator");
|
||||
|
||||
security.setConstraintMappings(constraints,knownRoles);
|
||||
server.start();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void stopServer() throws Exception
|
||||
{
|
||||
server.stop();
|
||||
}
|
||||
|
||||
@Parameters(name = "{0}: {1}")
|
||||
public static Collection<Object[]> data()
|
||||
{
|
||||
List<Object[]> data = new ArrayList<>();
|
||||
|
||||
final String OPENCONTENT = "this is open content";
|
||||
|
||||
data.add(new Object[] { "/ctx/all/index.txt", HttpStatus.OK_200, OPENCONTENT });
|
||||
data.add(new Object[] { "/ctx/ALL/index.txt", HttpStatus.NOT_FOUND_404, null });
|
||||
data.add(new Object[] { "/ctx/ALL/Fred/../index.txt", HttpStatus.NOT_FOUND_404, null });
|
||||
data.add(new Object[] { "/ctx/../bar/../ctx/all/index.txt", HttpStatus.OK_200, OPENCONTENT });
|
||||
data.add(new Object[] { "/ctx/forbid/index.txt", HttpStatus.FORBIDDEN_403, null });
|
||||
data.add(new Object[] { "/ctx/all/../forbid/index.txt", HttpStatus.FORBIDDEN_403, null });
|
||||
data.add(new Object[] { "/ctx/FoRbId/index.txt", HttpStatus.NOT_FOUND_404, null });
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@Parameter(value = 0)
|
||||
public String uri;
|
||||
|
||||
@Parameter(value = 1)
|
||||
public int expectedStatusCode;
|
||||
|
||||
@Parameter(value = 2)
|
||||
public String expectedContent;
|
||||
|
||||
@Test
|
||||
public void testAccess() throws Exception
|
||||
{
|
||||
StringBuilder request = new StringBuilder();
|
||||
request.append("GET ").append(uri).append(" HTTP/1.1\r\n");
|
||||
request.append("Host: localhost\r\n");
|
||||
request.append("Connection: close\r\n");
|
||||
request.append("\r\n");
|
||||
|
||||
String response = connector.getResponse(request.toString());
|
||||
|
||||
switch (expectedStatusCode)
|
||||
{
|
||||
case 200:
|
||||
assertThat(response,startsWith("HTTP/1.1 200 OK"));
|
||||
break;
|
||||
case 403:
|
||||
assertThat(response,startsWith("HTTP/1.1 403 Forbidden"));
|
||||
break;
|
||||
case 404:
|
||||
assertThat(response,startsWith("HTTP/1.1 404 Not Found"));
|
||||
break;
|
||||
default:
|
||||
fail("Write a handler for response status code: " + expectedStatusCode);
|
||||
break;
|
||||
}
|
||||
|
||||
if (expectedContent != null)
|
||||
{
|
||||
assertThat(response,containsString("this is open content"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
|
@ -14,35 +14,10 @@
|
|||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate-manifest</id>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",org.eclipse.jetty.jmx.*;version="9.1";resolution:=optional,*</Import-Package>
|
||||
<_nouses>true</_nouses>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>artifact-jar</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-jar</id>
|
||||
<goals>
|
||||
|
@ -50,28 +25,6 @@
|
|||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
|
@ -83,18 +36,9 @@
|
|||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-test-helper</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<!--
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>javax.servlet</artifactId>
|
||||
-->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
@ -119,9 +63,16 @@
|
|||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-test-helper</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-http</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -378,6 +378,16 @@ public class LocalConnector extends AbstractConnector
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remaining output ByteBuffer after calls to {@link #getResponse()} or {@link #waitForResponse(boolean, long, TimeUnit)}
|
||||
*
|
||||
* @return the remaining response data buffer
|
||||
*/
|
||||
public ByteBuffer getResponseData()
|
||||
{
|
||||
return _responseData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait for a response using a parser to detect the end of message
|
||||
|
@ -515,7 +525,7 @@ public class LocalConnector extends AbstractConnector
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (bout.getCount()==0 && isOutputShutdown())
|
||||
return null;
|
||||
return ByteBuffer.wrap(bout.getBuf(),0,bout.getCount());
|
||||
|
|
|
@ -57,17 +57,8 @@ import org.hamcrest.Matchers;
|
|||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hamcrest.Matchers.anyOf;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.greaterThan;
|
||||
import static org.hamcrest.Matchers.instanceOf;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.hamcrest.Matchers.notNullValue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class ServerConnectorTest
|
||||
{
|
||||
public static class ReuseInfoHandler extends AbstractHandler
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-servlet</artifactId>
|
||||
|
@ -16,34 +16,8 @@
|
|||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",org.eclipse.jetty.jmx.*;version="9.1";resolution:=optional,*</Import-Package>
|
||||
<_nouses>true</_nouses>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!--
|
||||
Required for OSGI
|
||||
-->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>tests</id>
|
||||
|
@ -53,23 +27,6 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
|
@ -96,5 +53,12 @@
|
|||
<artifactId>jetty-test-helper</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-http</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-servlets</artifactId>
|
||||
|
@ -15,52 +15,6 @@
|
|||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",*</Import-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!--
|
||||
Required for OSGI
|
||||
-->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
|
@ -108,6 +62,20 @@
|
|||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-http</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlet</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-test-helper</artifactId>
|
||||
|
|
|
@ -1,407 +1,407 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.servlets;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.SelectionKey;
|
||||
import java.nio.channels.SocketChannel;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.BrokenBarrierException;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.CyclicBarrier;
|
||||
import java.util.concurrent.Exchanger;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.eclipse.jetty.io.ChannelEndPoint;
|
||||
import org.eclipse.jetty.io.ManagedSelector;
|
||||
import org.eclipse.jetty.io.SocketChannelEndPoint;
|
||||
import org.eclipse.jetty.server.HttpChannel;
|
||||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.ServerConnector;
|
||||
import org.eclipse.jetty.server.handler.AbstractHandler;
|
||||
import org.eclipse.jetty.servlet.DefaultServlet;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.eclipse.jetty.toolchain.test.TestTracker;
|
||||
import org.eclipse.jetty.toolchain.test.annotation.Slow;
|
||||
import org.eclipse.jetty.util.log.StacklessLogging;
|
||||
import org.eclipse.jetty.util.thread.QueuedThreadPool;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
public class ThreadStarvationTest
|
||||
{
|
||||
@Rule
|
||||
public TestTracker tracker = new TestTracker();
|
||||
private Server _server;
|
||||
|
||||
@After
|
||||
public void dispose() throws Exception
|
||||
{
|
||||
if (_server != null)
|
||||
_server.stop();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Slow
|
||||
public void testDefaultServletSuccess() throws Exception
|
||||
{
|
||||
int maxThreads = 10;
|
||||
QueuedThreadPool threadPool = new QueuedThreadPool(maxThreads, maxThreads);
|
||||
threadPool.setDetailedDump(true);
|
||||
_server = new Server(threadPool);
|
||||
|
||||
// Prepare a big file to download.
|
||||
File directory = MavenTestingUtils.getTargetTestingDir();
|
||||
Files.createDirectories(directory.toPath());
|
||||
String resourceName = "resource.bin";
|
||||
Path resourcePath = Paths.get(directory.getPath(), resourceName);
|
||||
try (OutputStream output = Files.newOutputStream(resourcePath, StandardOpenOption.CREATE, StandardOpenOption.WRITE))
|
||||
{
|
||||
byte[] chunk = new byte[1024];
|
||||
Arrays.fill(chunk,(byte)'X');
|
||||
chunk[chunk.length-2]='\r';
|
||||
chunk[chunk.length-1]='\n';
|
||||
for (int i = 0; i < 256 * 1024; ++i)
|
||||
output.write(chunk);
|
||||
}
|
||||
|
||||
final CountDownLatch writePending = new CountDownLatch(1);
|
||||
ServerConnector connector = new ServerConnector(_server, 0, 1)
|
||||
{
|
||||
@Override
|
||||
protected ChannelEndPoint newEndPoint(SocketChannel channel, ManagedSelector selectSet, SelectionKey key) throws IOException
|
||||
{
|
||||
return new SocketChannelEndPoint(channel, selectSet, key, getScheduler())
|
||||
{
|
||||
@Override
|
||||
protected void onIncompleteFlush()
|
||||
{
|
||||
super.onIncompleteFlush();
|
||||
writePending.countDown();
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
connector.setIdleTimeout(Long.MAX_VALUE);
|
||||
_server.addConnector(connector);
|
||||
|
||||
ServletContextHandler context = new ServletContextHandler(_server, "/");
|
||||
context.setResourceBase(directory.toURI().toString());
|
||||
context.addServlet(DefaultServlet.class, "/*").setAsyncSupported(false);
|
||||
_server.setHandler(context);
|
||||
|
||||
_server.start();
|
||||
|
||||
List<Socket> sockets = new ArrayList<>();
|
||||
for (int i = 0; i < maxThreads*2; ++i)
|
||||
{
|
||||
Socket socket = new Socket("localhost", connector.getLocalPort());
|
||||
sockets.add(socket);
|
||||
OutputStream output = socket.getOutputStream();
|
||||
String request = "" +
|
||||
"GET /" + resourceName + " HTTP/1.1\r\n" +
|
||||
"Host: localhost\r\n" +
|
||||
"\r\n";
|
||||
output.write(request.getBytes(StandardCharsets.UTF_8));
|
||||
output.flush();
|
||||
Thread.sleep(100);
|
||||
}
|
||||
|
||||
// Wait for a the servlet to block.
|
||||
Assert.assertTrue(writePending.await(5, TimeUnit.SECONDS));
|
||||
|
||||
long expected = Files.size(resourcePath);
|
||||
byte[] buffer = new byte[48 * 1024];
|
||||
List<Exchanger<Long>> totals = new ArrayList<>();
|
||||
for (Socket socket : sockets)
|
||||
{
|
||||
final Exchanger<Long> x = new Exchanger<>();
|
||||
totals.add(x);
|
||||
final InputStream input = socket.getInputStream();
|
||||
|
||||
new Thread()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
long total=0;
|
||||
try
|
||||
{
|
||||
// look for CRLFCRLF
|
||||
StringBuilder header = new StringBuilder();
|
||||
int state=0;
|
||||
while (state<4 && header.length()<2048)
|
||||
{
|
||||
int ch=input.read();
|
||||
if (ch<0)
|
||||
break;
|
||||
header.append((char)ch);
|
||||
switch(state)
|
||||
{
|
||||
case 0:
|
||||
if (ch=='\r')
|
||||
state=1;
|
||||
break;
|
||||
case 1:
|
||||
if (ch=='\n')
|
||||
state=2;
|
||||
else
|
||||
state=0;
|
||||
break;
|
||||
case 2:
|
||||
if (ch=='\r')
|
||||
state=3;
|
||||
else
|
||||
state=0;
|
||||
break;
|
||||
case 3:
|
||||
if (ch=='\n')
|
||||
state=4;
|
||||
else
|
||||
state=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
while (total<expected)
|
||||
{
|
||||
int read=input.read(buffer);
|
||||
if (read<0)
|
||||
break;
|
||||
total+=read;
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
x.exchange(total);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
for (Exchanger<Long> x : totals)
|
||||
{
|
||||
Long total = x.exchange(-1L,10000,TimeUnit.SECONDS);
|
||||
Assert.assertEquals(expected,total.longValue());
|
||||
}
|
||||
|
||||
// We could read everything, good.
|
||||
for (Socket socket : sockets)
|
||||
socket.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailureStarvation() throws Exception
|
||||
{
|
||||
try (StacklessLogging stackless = new StacklessLogging(HttpChannel.class))
|
||||
{
|
||||
int acceptors = 0;
|
||||
int selectors = 1;
|
||||
int maxThreads = 10;
|
||||
final int barried=maxThreads-acceptors-selectors*2;
|
||||
final CyclicBarrier barrier = new CyclicBarrier(barried);
|
||||
|
||||
|
||||
QueuedThreadPool threadPool = new QueuedThreadPool(maxThreads, maxThreads);
|
||||
threadPool.setDetailedDump(true);
|
||||
_server = new Server(threadPool);
|
||||
|
||||
|
||||
ServerConnector connector = new ServerConnector(_server, acceptors, selectors)
|
||||
{
|
||||
@Override
|
||||
protected ChannelEndPoint newEndPoint(SocketChannel channel, ManagedSelector selectSet, SelectionKey key) throws IOException
|
||||
{
|
||||
return new SocketChannelEndPoint(channel, selectSet, key, getScheduler())
|
||||
{
|
||||
@Override
|
||||
public boolean flush(ByteBuffer... buffers) throws IOException
|
||||
{
|
||||
super.flush(buffers[0]);
|
||||
throw new IOException("TEST FAILURE");
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
connector.setIdleTimeout(Long.MAX_VALUE);
|
||||
_server.addConnector(connector);
|
||||
|
||||
final AtomicInteger count = new AtomicInteger(0);
|
||||
_server.setHandler(new AbstractHandler()
|
||||
{
|
||||
@Override
|
||||
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
|
||||
{
|
||||
int c=count.getAndIncrement();
|
||||
try
|
||||
{
|
||||
if (c<barried)
|
||||
{
|
||||
barrier.await(10,TimeUnit.SECONDS);
|
||||
}
|
||||
}
|
||||
catch (InterruptedException | BrokenBarrierException | TimeoutException e)
|
||||
{
|
||||
throw new ServletException(e);
|
||||
}
|
||||
baseRequest.setHandled(true);
|
||||
response.setStatus(200);
|
||||
response.setContentLength(13);
|
||||
response.getWriter().print("Hello World!\n");
|
||||
response.getWriter().flush();
|
||||
}
|
||||
});
|
||||
|
||||
_server.start();
|
||||
|
||||
List<Socket> sockets = new ArrayList<>();
|
||||
for (int i = 0; i < maxThreads*2; ++i)
|
||||
{
|
||||
Socket socket = new Socket("localhost", connector.getLocalPort());
|
||||
sockets.add(socket);
|
||||
OutputStream output = socket.getOutputStream();
|
||||
String request = "" +
|
||||
"GET / HTTP/1.1\r\n" +
|
||||
"Host: localhost\r\n" +
|
||||
// "Connection: close\r\n" +
|
||||
"\r\n";
|
||||
output.write(request.getBytes(StandardCharsets.UTF_8));
|
||||
output.flush();
|
||||
}
|
||||
|
||||
byte[] buffer = new byte[48 * 1024];
|
||||
List<Exchanger<Integer>> totals = new ArrayList<>();
|
||||
for (Socket socket : sockets)
|
||||
{
|
||||
final Exchanger<Integer> x = new Exchanger<>();
|
||||
totals.add(x);
|
||||
final InputStream input = socket.getInputStream();
|
||||
|
||||
new Thread()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
int read=0;
|
||||
try
|
||||
{
|
||||
// look for CRLFCRLF
|
||||
StringBuilder header = new StringBuilder();
|
||||
int state=0;
|
||||
while (state<4 && header.length()<2048)
|
||||
{
|
||||
int ch=input.read();
|
||||
if (ch<0)
|
||||
break;
|
||||
header.append((char)ch);
|
||||
switch(state)
|
||||
{
|
||||
case 0:
|
||||
if (ch=='\r')
|
||||
state=1;
|
||||
break;
|
||||
case 1:
|
||||
if (ch=='\n')
|
||||
state=2;
|
||||
else
|
||||
state=0;
|
||||
break;
|
||||
case 2:
|
||||
if (ch=='\r')
|
||||
state=3;
|
||||
else
|
||||
state=0;
|
||||
break;
|
||||
case 3:
|
||||
if (ch=='\n')
|
||||
state=4;
|
||||
else
|
||||
state=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
read=input.read(buffer);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
// e.printStackTrace();
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
x.exchange(read);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
for (Exchanger<Integer> x : totals)
|
||||
{
|
||||
Integer read = x.exchange(-1,10,TimeUnit.SECONDS);
|
||||
Assert.assertEquals(-1,read.intValue());
|
||||
}
|
||||
|
||||
// We could read everything, good.
|
||||
for (Socket socket : sockets)
|
||||
socket.close();
|
||||
|
||||
_server.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.servlets;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.SelectionKey;
|
||||
import java.nio.channels.SocketChannel;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.BrokenBarrierException;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.CyclicBarrier;
|
||||
import java.util.concurrent.Exchanger;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.eclipse.jetty.io.ChannelEndPoint;
|
||||
import org.eclipse.jetty.io.ManagedSelector;
|
||||
import org.eclipse.jetty.io.SocketChannelEndPoint;
|
||||
import org.eclipse.jetty.server.HttpChannel;
|
||||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.ServerConnector;
|
||||
import org.eclipse.jetty.server.handler.AbstractHandler;
|
||||
import org.eclipse.jetty.servlet.DefaultServlet;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.eclipse.jetty.toolchain.test.TestTracker;
|
||||
import org.eclipse.jetty.toolchain.test.annotation.Slow;
|
||||
import org.eclipse.jetty.util.log.StacklessLogging;
|
||||
import org.eclipse.jetty.util.thread.QueuedThreadPool;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
public class ThreadStarvationTest
|
||||
{
|
||||
@Rule
|
||||
public TestTracker tracker = new TestTracker();
|
||||
private Server _server;
|
||||
|
||||
@After
|
||||
public void dispose() throws Exception
|
||||
{
|
||||
if (_server != null)
|
||||
_server.stop();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Slow
|
||||
public void testDefaultServletSuccess() throws Exception
|
||||
{
|
||||
int maxThreads = 10;
|
||||
QueuedThreadPool threadPool = new QueuedThreadPool(maxThreads, maxThreads);
|
||||
threadPool.setDetailedDump(true);
|
||||
_server = new Server(threadPool);
|
||||
|
||||
// Prepare a big file to download.
|
||||
File directory = MavenTestingUtils.getTargetTestingDir();
|
||||
Files.createDirectories(directory.toPath());
|
||||
String resourceName = "resource.bin";
|
||||
Path resourcePath = Paths.get(directory.getPath(), resourceName);
|
||||
try (OutputStream output = Files.newOutputStream(resourcePath, StandardOpenOption.CREATE, StandardOpenOption.WRITE))
|
||||
{
|
||||
byte[] chunk = new byte[1024];
|
||||
Arrays.fill(chunk,(byte)'X');
|
||||
chunk[chunk.length-2]='\r';
|
||||
chunk[chunk.length-1]='\n';
|
||||
for (int i = 0; i < 256 * 1024; ++i)
|
||||
output.write(chunk);
|
||||
}
|
||||
|
||||
final CountDownLatch writePending = new CountDownLatch(1);
|
||||
ServerConnector connector = new ServerConnector(_server, 0, 1)
|
||||
{
|
||||
@Override
|
||||
protected ChannelEndPoint newEndPoint(SocketChannel channel, ManagedSelector selectSet, SelectionKey key) throws IOException
|
||||
{
|
||||
return new SocketChannelEndPoint(channel, selectSet, key, getScheduler())
|
||||
{
|
||||
@Override
|
||||
protected void onIncompleteFlush()
|
||||
{
|
||||
super.onIncompleteFlush();
|
||||
writePending.countDown();
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
connector.setIdleTimeout(Long.MAX_VALUE);
|
||||
_server.addConnector(connector);
|
||||
|
||||
ServletContextHandler context = new ServletContextHandler(_server, "/");
|
||||
context.setResourceBase(directory.toURI().toString());
|
||||
context.addServlet(DefaultServlet.class, "/*").setAsyncSupported(false);
|
||||
_server.setHandler(context);
|
||||
|
||||
_server.start();
|
||||
|
||||
List<Socket> sockets = new ArrayList<>();
|
||||
for (int i = 0; i < maxThreads*2; ++i)
|
||||
{
|
||||
Socket socket = new Socket("localhost", connector.getLocalPort());
|
||||
sockets.add(socket);
|
||||
OutputStream output = socket.getOutputStream();
|
||||
String request = "" +
|
||||
"GET /" + resourceName + " HTTP/1.1\r\n" +
|
||||
"Host: localhost\r\n" +
|
||||
"\r\n";
|
||||
output.write(request.getBytes(StandardCharsets.UTF_8));
|
||||
output.flush();
|
||||
Thread.sleep(100);
|
||||
}
|
||||
|
||||
// Wait for a the servlet to block.
|
||||
Assert.assertTrue(writePending.await(5, TimeUnit.SECONDS));
|
||||
|
||||
long expected = Files.size(resourcePath);
|
||||
byte[] buffer = new byte[48 * 1024];
|
||||
List<Exchanger<Long>> totals = new ArrayList<>();
|
||||
for (Socket socket : sockets)
|
||||
{
|
||||
final Exchanger<Long> x = new Exchanger<>();
|
||||
totals.add(x);
|
||||
final InputStream input = socket.getInputStream();
|
||||
|
||||
new Thread()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
long total=0;
|
||||
try
|
||||
{
|
||||
// look for CRLFCRLF
|
||||
StringBuilder header = new StringBuilder();
|
||||
int state=0;
|
||||
while (state<4 && header.length()<2048)
|
||||
{
|
||||
int ch=input.read();
|
||||
if (ch<0)
|
||||
break;
|
||||
header.append((char)ch);
|
||||
switch(state)
|
||||
{
|
||||
case 0:
|
||||
if (ch=='\r')
|
||||
state=1;
|
||||
break;
|
||||
case 1:
|
||||
if (ch=='\n')
|
||||
state=2;
|
||||
else
|
||||
state=0;
|
||||
break;
|
||||
case 2:
|
||||
if (ch=='\r')
|
||||
state=3;
|
||||
else
|
||||
state=0;
|
||||
break;
|
||||
case 3:
|
||||
if (ch=='\n')
|
||||
state=4;
|
||||
else
|
||||
state=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
while (total<expected)
|
||||
{
|
||||
int read=input.read(buffer);
|
||||
if (read<0)
|
||||
break;
|
||||
total+=read;
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
x.exchange(total);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
for (Exchanger<Long> x : totals)
|
||||
{
|
||||
Long total = x.exchange(-1L,10000,TimeUnit.SECONDS);
|
||||
Assert.assertEquals(expected,total.longValue());
|
||||
}
|
||||
|
||||
// We could read everything, good.
|
||||
for (Socket socket : sockets)
|
||||
socket.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailureStarvation() throws Exception
|
||||
{
|
||||
try (StacklessLogging stackless = new StacklessLogging(HttpChannel.class))
|
||||
{
|
||||
int acceptors = 0;
|
||||
int selectors = 1;
|
||||
int maxThreads = 10;
|
||||
final int barried=maxThreads-acceptors-selectors*2;
|
||||
final CyclicBarrier barrier = new CyclicBarrier(barried);
|
||||
|
||||
|
||||
QueuedThreadPool threadPool = new QueuedThreadPool(maxThreads, maxThreads);
|
||||
threadPool.setDetailedDump(true);
|
||||
_server = new Server(threadPool);
|
||||
|
||||
|
||||
ServerConnector connector = new ServerConnector(_server, acceptors, selectors)
|
||||
{
|
||||
@Override
|
||||
protected ChannelEndPoint newEndPoint(SocketChannel channel, ManagedSelector selectSet, SelectionKey key) throws IOException
|
||||
{
|
||||
return new SocketChannelEndPoint(channel, selectSet, key, getScheduler())
|
||||
{
|
||||
@Override
|
||||
public boolean flush(ByteBuffer... buffers) throws IOException
|
||||
{
|
||||
super.flush(buffers[0]);
|
||||
throw new IOException("TEST FAILURE");
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
connector.setIdleTimeout(Long.MAX_VALUE);
|
||||
_server.addConnector(connector);
|
||||
|
||||
final AtomicInteger count = new AtomicInteger(0);
|
||||
_server.setHandler(new AbstractHandler()
|
||||
{
|
||||
@Override
|
||||
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
|
||||
{
|
||||
int c=count.getAndIncrement();
|
||||
try
|
||||
{
|
||||
if (c<barried)
|
||||
{
|
||||
barrier.await(10,TimeUnit.SECONDS);
|
||||
}
|
||||
}
|
||||
catch (InterruptedException | BrokenBarrierException | TimeoutException e)
|
||||
{
|
||||
throw new ServletException(e);
|
||||
}
|
||||
baseRequest.setHandled(true);
|
||||
response.setStatus(200);
|
||||
response.setContentLength(13);
|
||||
response.getWriter().print("Hello World!\n");
|
||||
response.getWriter().flush();
|
||||
}
|
||||
});
|
||||
|
||||
_server.start();
|
||||
|
||||
List<Socket> sockets = new ArrayList<>();
|
||||
for (int i = 0; i < maxThreads*2; ++i)
|
||||
{
|
||||
Socket socket = new Socket("localhost", connector.getLocalPort());
|
||||
sockets.add(socket);
|
||||
OutputStream output = socket.getOutputStream();
|
||||
String request = "" +
|
||||
"GET / HTTP/1.1\r\n" +
|
||||
"Host: localhost\r\n" +
|
||||
// "Connection: close\r\n" +
|
||||
"\r\n";
|
||||
output.write(request.getBytes(StandardCharsets.UTF_8));
|
||||
output.flush();
|
||||
}
|
||||
|
||||
byte[] buffer = new byte[48 * 1024];
|
||||
List<Exchanger<Integer>> totals = new ArrayList<>();
|
||||
for (Socket socket : sockets)
|
||||
{
|
||||
final Exchanger<Integer> x = new Exchanger<>();
|
||||
totals.add(x);
|
||||
final InputStream input = socket.getInputStream();
|
||||
|
||||
new Thread()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
int read=0;
|
||||
try
|
||||
{
|
||||
// look for CRLFCRLF
|
||||
StringBuilder header = new StringBuilder();
|
||||
int state=0;
|
||||
while (state<4 && header.length()<2048)
|
||||
{
|
||||
int ch=input.read();
|
||||
if (ch<0)
|
||||
break;
|
||||
header.append((char)ch);
|
||||
switch(state)
|
||||
{
|
||||
case 0:
|
||||
if (ch=='\r')
|
||||
state=1;
|
||||
break;
|
||||
case 1:
|
||||
if (ch=='\n')
|
||||
state=2;
|
||||
else
|
||||
state=0;
|
||||
break;
|
||||
case 2:
|
||||
if (ch=='\r')
|
||||
state=3;
|
||||
else
|
||||
state=0;
|
||||
break;
|
||||
case 3:
|
||||
if (ch=='\n')
|
||||
state=4;
|
||||
else
|
||||
state=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
read=input.read(buffer);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
// e.printStackTrace();
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
x.exchange(read);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
for (Exchanger<Integer> x : totals)
|
||||
{
|
||||
Integer read = x.exchange(-1,10,TimeUnit.SECONDS);
|
||||
Assert.assertEquals(-1,read.intValue());
|
||||
}
|
||||
|
||||
// We could read everything, good.
|
||||
for (Socket socket : sockets)
|
||||
socket.close();
|
||||
|
||||
_server.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-spring</artifactId>
|
||||
|
@ -11,28 +11,12 @@
|
|||
<properties>
|
||||
<spring-version>3.2.8.RELEASE</spring-version>
|
||||
<dependencies>target/dependencies</dependencies>
|
||||
<bundle-symbolic-name>${project.groupId}.spring</bundle-symbolic-name>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<defaultGoal>install</defaultGoal>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
|
|
|
@ -2,13 +2,17 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-start</artifactId>
|
||||
<name>Jetty :: Start</name>
|
||||
<description>The start utility</description>
|
||||
<url>http://www.eclipse.org/jetty</url>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.start</bundle-symbolic-name>
|
||||
<start-jar-file-name>start.jar</start-jar-file-name>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
@ -30,9 +34,6 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<properties>
|
||||
<start-jar-file-name>start.jar</start-jar-file-name>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
|
|
|
@ -1,214 +1,214 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.start;
|
||||
|
||||
import static org.hamcrest.Matchers.containsInAnyOrder;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.notNullValue;
|
||||
import static org.hamcrest.Matchers.startsWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jetty.start.config.ConfigSources;
|
||||
import org.eclipse.jetty.start.config.JettyBaseConfigSource;
|
||||
import org.eclipse.jetty.start.config.JettyHomeConfigSource;
|
||||
import org.eclipse.jetty.toolchain.test.IO;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class BaseHomeTest
|
||||
{
|
||||
public static void assertPathList(BaseHome hb, String message, List<String> expected, PathFinder finder)
|
||||
{
|
||||
List<String> actual = new ArrayList<>();
|
||||
for (Path path : finder.getHits())
|
||||
{
|
||||
actual.add(hb.toShortForm(path.toFile()));
|
||||
}
|
||||
|
||||
if (actual.size() != expected.size())
|
||||
{
|
||||
System.out.printf("Actual Path(s): %,d hits%n",actual.size());
|
||||
for (String path : actual)
|
||||
{
|
||||
System.out.printf(" %s%n",path);
|
||||
}
|
||||
System.out.printf("Expected Path(s): %,d entries%n",expected.size());
|
||||
for (String path : expected)
|
||||
{
|
||||
System.out.printf(" %s%n",path);
|
||||
}
|
||||
}
|
||||
Assert.assertThat(message + ": " + Utils.join(actual,", "),actual,containsInAnyOrder(expected.toArray()));
|
||||
}
|
||||
|
||||
public static void assertPathList(BaseHome hb, String message, List<String> expected, List<Path> paths)
|
||||
{
|
||||
List<String> actual = new ArrayList<>();
|
||||
for (Path path : paths)
|
||||
{
|
||||
actual.add(hb.toShortForm(path.toFile()));
|
||||
}
|
||||
|
||||
if (actual.size() != expected.size())
|
||||
{
|
||||
System.out.printf("Actual Path(s): %,d hits%n",actual.size());
|
||||
for (String path : actual)
|
||||
{
|
||||
System.out.printf(" %s%n",path);
|
||||
}
|
||||
System.out.printf("Expected Path(s): %,d entries%n",expected.size());
|
||||
for (String path : expected)
|
||||
{
|
||||
System.out.printf(" %s%n",path);
|
||||
}
|
||||
}
|
||||
Assert.assertThat(message + ": " + Utils.join(actual,", "),actual,containsInAnyOrder(expected.toArray()));
|
||||
}
|
||||
|
||||
public static void assertFileList(BaseHome hb, String message, List<String> expected, List<File> files)
|
||||
{
|
||||
List<String> actual = new ArrayList<>();
|
||||
for (File file : files)
|
||||
{
|
||||
actual.add(hb.toShortForm(file));
|
||||
}
|
||||
Assert.assertThat(message + ": " + Utils.join(actual,", "),actual,containsInAnyOrder(expected.toArray()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetPath_OnlyHome() throws IOException
|
||||
{
|
||||
File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
|
||||
|
||||
ConfigSources config = new ConfigSources();
|
||||
config.add(new JettyHomeConfigSource(homeDir.toPath()));
|
||||
|
||||
BaseHome hb = new BaseHome(config);
|
||||
Path startIni = hb.getPath("start.ini");
|
||||
|
||||
String ref = hb.toShortForm(startIni);
|
||||
Assert.assertThat("Reference",ref,startsWith("${jetty.home}"));
|
||||
|
||||
String contents = IO.readToString(startIni.toFile());
|
||||
Assert.assertThat("Contents",contents,containsString("Home Ini"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetPaths_OnlyHome() throws IOException
|
||||
{
|
||||
File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
|
||||
|
||||
ConfigSources config = new ConfigSources();
|
||||
config.add(new JettyHomeConfigSource(homeDir.toPath()));
|
||||
|
||||
BaseHome hb = new BaseHome(config);
|
||||
List<Path> paths = hb.getPaths("start.d/*");
|
||||
|
||||
List<String> expected = new ArrayList<>();
|
||||
expected.add("${jetty.home}/start.d/jmx.ini");
|
||||
expected.add("${jetty.home}/start.d/jndi.ini");
|
||||
expected.add("${jetty.home}/start.d/jsp.ini");
|
||||
expected.add("${jetty.home}/start.d/logging.ini");
|
||||
expected.add("${jetty.home}/start.d/ssl.ini");
|
||||
FSTest.toOsSeparators(expected);
|
||||
|
||||
assertPathList(hb,"Paths found",expected,paths);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetPaths_OnlyHome_InisOnly() throws IOException
|
||||
{
|
||||
File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
|
||||
|
||||
ConfigSources config = new ConfigSources();
|
||||
config.add(new JettyHomeConfigSource(homeDir.toPath()));
|
||||
|
||||
BaseHome hb = new BaseHome(config);
|
||||
List<Path> paths = hb.getPaths("start.d/*.ini");
|
||||
|
||||
List<String> expected = new ArrayList<>();
|
||||
expected.add("${jetty.home}/start.d/jmx.ini");
|
||||
expected.add("${jetty.home}/start.d/jndi.ini");
|
||||
expected.add("${jetty.home}/start.d/jsp.ini");
|
||||
expected.add("${jetty.home}/start.d/logging.ini");
|
||||
expected.add("${jetty.home}/start.d/ssl.ini");
|
||||
FSTest.toOsSeparators(expected);
|
||||
|
||||
assertPathList(hb,"Paths found",expected,paths);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetPaths_Both() throws IOException
|
||||
{
|
||||
File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
|
||||
File baseDir = MavenTestingUtils.getTestResourceDir("hb.1/base");
|
||||
|
||||
ConfigSources config = new ConfigSources();
|
||||
config.add(new JettyBaseConfigSource(baseDir.toPath()));
|
||||
config.add(new JettyHomeConfigSource(homeDir.toPath()));
|
||||
|
||||
BaseHome hb = new BaseHome(config);
|
||||
List<Path> paths = hb.getPaths("start.d/*.ini");
|
||||
|
||||
List<String> expected = new ArrayList<>();
|
||||
expected.add("${jetty.base}/start.d/jmx.ini");
|
||||
expected.add("${jetty.home}/start.d/jndi.ini");
|
||||
expected.add("${jetty.home}/start.d/jsp.ini");
|
||||
expected.add("${jetty.base}/start.d/logging.ini");
|
||||
expected.add("${jetty.home}/start.d/ssl.ini");
|
||||
expected.add("${jetty.base}/start.d/myapp.ini");
|
||||
FSTest.toOsSeparators(expected);
|
||||
|
||||
assertPathList(hb,"Paths found",expected,paths);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefault() throws IOException
|
||||
{
|
||||
BaseHome bh = new BaseHome();
|
||||
Assert.assertThat("Home",bh.getHome(),notNullValue());
|
||||
Assert.assertThat("Base",bh.getBase(),notNullValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetPath_Both() throws IOException
|
||||
{
|
||||
File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
|
||||
File baseDir = MavenTestingUtils.getTestResourceDir("hb.1/base");
|
||||
|
||||
ConfigSources config = new ConfigSources();
|
||||
config.add(new JettyBaseConfigSource(baseDir.toPath()));
|
||||
config.add(new JettyHomeConfigSource(homeDir.toPath()));
|
||||
|
||||
BaseHome hb = new BaseHome(config);
|
||||
Path startIni = hb.getPath("start.ini");
|
||||
|
||||
String ref = hb.toShortForm(startIni);
|
||||
Assert.assertThat("Reference",ref,startsWith("${jetty.base}"));
|
||||
|
||||
String contents = IO.readToString(startIni.toFile());
|
||||
Assert.assertThat("Contents",contents,containsString("Base Ini"));
|
||||
}
|
||||
}
|
||||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.start;
|
||||
|
||||
import static org.hamcrest.Matchers.containsInAnyOrder;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.notNullValue;
|
||||
import static org.hamcrest.Matchers.startsWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jetty.start.config.ConfigSources;
|
||||
import org.eclipse.jetty.start.config.JettyBaseConfigSource;
|
||||
import org.eclipse.jetty.start.config.JettyHomeConfigSource;
|
||||
import org.eclipse.jetty.toolchain.test.IO;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class BaseHomeTest
|
||||
{
|
||||
public static void assertPathList(BaseHome hb, String message, List<String> expected, PathFinder finder)
|
||||
{
|
||||
List<String> actual = new ArrayList<>();
|
||||
for (Path path : finder.getHits())
|
||||
{
|
||||
actual.add(hb.toShortForm(path.toFile()));
|
||||
}
|
||||
|
||||
if (actual.size() != expected.size())
|
||||
{
|
||||
System.out.printf("Actual Path(s): %,d hits%n",actual.size());
|
||||
for (String path : actual)
|
||||
{
|
||||
System.out.printf(" %s%n",path);
|
||||
}
|
||||
System.out.printf("Expected Path(s): %,d entries%n",expected.size());
|
||||
for (String path : expected)
|
||||
{
|
||||
System.out.printf(" %s%n",path);
|
||||
}
|
||||
}
|
||||
Assert.assertThat(message + ": " + Utils.join(actual,", "),actual,containsInAnyOrder(expected.toArray()));
|
||||
}
|
||||
|
||||
public static void assertPathList(BaseHome hb, String message, List<String> expected, List<Path> paths)
|
||||
{
|
||||
List<String> actual = new ArrayList<>();
|
||||
for (Path path : paths)
|
||||
{
|
||||
actual.add(hb.toShortForm(path.toFile()));
|
||||
}
|
||||
|
||||
if (actual.size() != expected.size())
|
||||
{
|
||||
System.out.printf("Actual Path(s): %,d hits%n",actual.size());
|
||||
for (String path : actual)
|
||||
{
|
||||
System.out.printf(" %s%n",path);
|
||||
}
|
||||
System.out.printf("Expected Path(s): %,d entries%n",expected.size());
|
||||
for (String path : expected)
|
||||
{
|
||||
System.out.printf(" %s%n",path);
|
||||
}
|
||||
}
|
||||
Assert.assertThat(message + ": " + Utils.join(actual,", "),actual,containsInAnyOrder(expected.toArray()));
|
||||
}
|
||||
|
||||
public static void assertFileList(BaseHome hb, String message, List<String> expected, List<File> files)
|
||||
{
|
||||
List<String> actual = new ArrayList<>();
|
||||
for (File file : files)
|
||||
{
|
||||
actual.add(hb.toShortForm(file));
|
||||
}
|
||||
Assert.assertThat(message + ": " + Utils.join(actual,", "),actual,containsInAnyOrder(expected.toArray()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetPath_OnlyHome() throws IOException
|
||||
{
|
||||
File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
|
||||
|
||||
ConfigSources config = new ConfigSources();
|
||||
config.add(new JettyHomeConfigSource(homeDir.toPath()));
|
||||
|
||||
BaseHome hb = new BaseHome(config);
|
||||
Path startIni = hb.getPath("start.ini");
|
||||
|
||||
String ref = hb.toShortForm(startIni);
|
||||
Assert.assertThat("Reference",ref,startsWith("${jetty.home}"));
|
||||
|
||||
String contents = IO.readToString(startIni.toFile());
|
||||
Assert.assertThat("Contents",contents,containsString("Home Ini"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetPaths_OnlyHome() throws IOException
|
||||
{
|
||||
File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
|
||||
|
||||
ConfigSources config = new ConfigSources();
|
||||
config.add(new JettyHomeConfigSource(homeDir.toPath()));
|
||||
|
||||
BaseHome hb = new BaseHome(config);
|
||||
List<Path> paths = hb.getPaths("start.d/*");
|
||||
|
||||
List<String> expected = new ArrayList<>();
|
||||
expected.add("${jetty.home}/start.d/jmx.ini");
|
||||
expected.add("${jetty.home}/start.d/jndi.ini");
|
||||
expected.add("${jetty.home}/start.d/jsp.ini");
|
||||
expected.add("${jetty.home}/start.d/logging.ini");
|
||||
expected.add("${jetty.home}/start.d/ssl.ini");
|
||||
FSTest.toOsSeparators(expected);
|
||||
|
||||
assertPathList(hb,"Paths found",expected,paths);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetPaths_OnlyHome_InisOnly() throws IOException
|
||||
{
|
||||
File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
|
||||
|
||||
ConfigSources config = new ConfigSources();
|
||||
config.add(new JettyHomeConfigSource(homeDir.toPath()));
|
||||
|
||||
BaseHome hb = new BaseHome(config);
|
||||
List<Path> paths = hb.getPaths("start.d/*.ini");
|
||||
|
||||
List<String> expected = new ArrayList<>();
|
||||
expected.add("${jetty.home}/start.d/jmx.ini");
|
||||
expected.add("${jetty.home}/start.d/jndi.ini");
|
||||
expected.add("${jetty.home}/start.d/jsp.ini");
|
||||
expected.add("${jetty.home}/start.d/logging.ini");
|
||||
expected.add("${jetty.home}/start.d/ssl.ini");
|
||||
FSTest.toOsSeparators(expected);
|
||||
|
||||
assertPathList(hb,"Paths found",expected,paths);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetPaths_Both() throws IOException
|
||||
{
|
||||
File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
|
||||
File baseDir = MavenTestingUtils.getTestResourceDir("hb.1/base");
|
||||
|
||||
ConfigSources config = new ConfigSources();
|
||||
config.add(new JettyBaseConfigSource(baseDir.toPath()));
|
||||
config.add(new JettyHomeConfigSource(homeDir.toPath()));
|
||||
|
||||
BaseHome hb = new BaseHome(config);
|
||||
List<Path> paths = hb.getPaths("start.d/*.ini");
|
||||
|
||||
List<String> expected = new ArrayList<>();
|
||||
expected.add("${jetty.base}/start.d/jmx.ini");
|
||||
expected.add("${jetty.home}/start.d/jndi.ini");
|
||||
expected.add("${jetty.home}/start.d/jsp.ini");
|
||||
expected.add("${jetty.base}/start.d/logging.ini");
|
||||
expected.add("${jetty.home}/start.d/ssl.ini");
|
||||
expected.add("${jetty.base}/start.d/myapp.ini");
|
||||
FSTest.toOsSeparators(expected);
|
||||
|
||||
assertPathList(hb,"Paths found",expected,paths);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefault() throws IOException
|
||||
{
|
||||
BaseHome bh = new BaseHome();
|
||||
Assert.assertThat("Home",bh.getHome(),notNullValue());
|
||||
Assert.assertThat("Base",bh.getBase(),notNullValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetPath_Both() throws IOException
|
||||
{
|
||||
File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
|
||||
File baseDir = MavenTestingUtils.getTestResourceDir("hb.1/base");
|
||||
|
||||
ConfigSources config = new ConfigSources();
|
||||
config.add(new JettyBaseConfigSource(baseDir.toPath()));
|
||||
config.add(new JettyHomeConfigSource(homeDir.toPath()));
|
||||
|
||||
BaseHome hb = new BaseHome(config);
|
||||
Path startIni = hb.getPath("start.ini");
|
||||
|
||||
String ref = hb.toShortForm(startIni);
|
||||
Assert.assertThat("Reference",ref,startsWith("${jetty.base}"));
|
||||
|
||||
String contents = IO.readToString(startIni.toFile());
|
||||
Assert.assertThat("Contents",contents,containsString("Base Ini"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,271 +1,272 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.start;
|
||||
|
||||
import static org.hamcrest.Matchers.greaterThan;
|
||||
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.eclipse.jetty.start.Props.Prop;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.eclipse.jetty.toolchain.test.PathAssert;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class ConfigurationAssert
|
||||
{
|
||||
/**
|
||||
* Given a provided StartArgs, assert that the configuration it has determined is valid based on values in a assert text file.
|
||||
*
|
||||
* @param baseHome the BaseHome used. Access it via {@link Main#getBaseHome()}
|
||||
* @param args the StartArgs that has been processed via {@link Main#processCommandLine(String[])}
|
||||
* @param filename the filename of the assertion values
|
||||
* @throws FileNotFoundException if unable to find the configuration
|
||||
* @throws IOException if unable to process the configuration
|
||||
*/
|
||||
public static void assertConfiguration(BaseHome baseHome, StartArgs args, String filename) throws FileNotFoundException, IOException
|
||||
{
|
||||
assertConfiguration(baseHome, args, null, MavenTestingUtils.getTestResourceFile(filename));
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a provided StartArgs, assert that the configuration it has determined is valid based on values in a assert text file.
|
||||
*
|
||||
* @param baseHome the BaseHome used. Access it via {@link Main#getBaseHome()}
|
||||
* @param args the StartArgs that has been processed via {@link Main#processCommandLine(String[])}
|
||||
* @param output the captured output that you want to assert against
|
||||
* @param filename the filename of the assertion values
|
||||
* @throws FileNotFoundException if unable to find the configuration
|
||||
* @throws IOException if unable to process the configuration
|
||||
*/
|
||||
public static void assertConfiguration(BaseHome baseHome, StartArgs args, String output, String filename) throws FileNotFoundException, IOException
|
||||
{
|
||||
assertConfiguration(baseHome, args, output, MavenTestingUtils.getTestResourceFile(filename));
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a provided StartArgs, assert that the configuration it has determined is valid based on values in a assert text file.
|
||||
*
|
||||
* @param baseHome the BaseHome used. Access it via {@link Main#getBaseHome()}
|
||||
* @param args the StartArgs that has been processed via {@link Main#processCommandLine(String[])}
|
||||
* @param file the file of the assertion values
|
||||
* @throws FileNotFoundException if unable to find the configuration
|
||||
* @throws IOException if unable to process the configuration
|
||||
*/
|
||||
public static void assertConfiguration(BaseHome baseHome, StartArgs args, String output, File file) throws FileNotFoundException, IOException
|
||||
{
|
||||
if(output != null)
|
||||
{
|
||||
System.err.println(output);
|
||||
}
|
||||
Path testResourcesDir = MavenTestingUtils.getTestResourcesDir().toPath().toRealPath();
|
||||
TextFile textFile = new TextFile(file.toPath());
|
||||
|
||||
// Validate XMLs (order is important)
|
||||
List<String> expectedXmls = new ArrayList<>();
|
||||
for (String line : textFile)
|
||||
{
|
||||
if (line.startsWith("XML|"))
|
||||
{
|
||||
expectedXmls.add(FS.separators(getValue(line)));
|
||||
}
|
||||
}
|
||||
List<String> actualXmls = new ArrayList<>();
|
||||
for (Path xml : args.getXmlFiles())
|
||||
{
|
||||
actualXmls.add(shorten(baseHome, xml, testResourcesDir));
|
||||
}
|
||||
assertOrdered("XML Resolution Order", expectedXmls, actualXmls);
|
||||
|
||||
// Validate LIBs (order is not important)
|
||||
List<String> expectedLibs = new ArrayList<>();
|
||||
for (String line : textFile)
|
||||
{
|
||||
if (line.startsWith("LIB|"))
|
||||
{
|
||||
expectedLibs.add(FS.separators(getValue(line)));
|
||||
}
|
||||
}
|
||||
List<String> actualLibs = new ArrayList<>();
|
||||
for (File path : args.getClasspath())
|
||||
{
|
||||
actualLibs.add(shorten(baseHome, path.toPath(), testResourcesDir));
|
||||
}
|
||||
assertContainsUnordered("Libs", expectedLibs, actualLibs);
|
||||
|
||||
// Validate PROPERTIES (order is not important)
|
||||
Set<String> expectedProperties = new HashSet<>();
|
||||
for (String line : textFile)
|
||||
{
|
||||
if (line.startsWith("PROP|") || line.startsWith("SYS|"))
|
||||
{
|
||||
expectedProperties.add(getValue(line));
|
||||
}
|
||||
}
|
||||
List<String> actualProperties = new ArrayList<>();
|
||||
for (Prop prop : args.getProperties())
|
||||
{
|
||||
String name = prop.key;
|
||||
if ("jetty.home".equals(name) ||
|
||||
"jetty.base".equals(name) ||
|
||||
"jetty.home.uri".equals(name) ||
|
||||
"jetty.base.uri".equals(name) ||
|
||||
"user.dir".equals(name) ||
|
||||
prop.origin.equals(Props.ORIGIN_SYSPROP) ||
|
||||
name.startsWith("java."))
|
||||
{
|
||||
// strip these out from assertion, to make assertions easier.
|
||||
continue;
|
||||
}
|
||||
actualProperties.add(prop.key + "=" + args.getProperties().expand(prop.value));
|
||||
}
|
||||
assertContainsUnordered("Properties", expectedProperties, actualProperties);
|
||||
|
||||
// Validate PROPERTIES (order is not important)
|
||||
for (String line : textFile)
|
||||
{
|
||||
if (line.startsWith("SYS|"))
|
||||
{
|
||||
String[] expected = getValue(line).split("=",2);
|
||||
String actual = System.getProperty(expected[0]);
|
||||
assertThat("System property "+expected[0],actual,Matchers.equalTo(expected[1]));
|
||||
}
|
||||
}
|
||||
|
||||
// Validate Downloads
|
||||
List<String> expectedDownloads = new ArrayList<>();
|
||||
for (String line : textFile)
|
||||
{
|
||||
if (line.startsWith("DOWNLOAD|"))
|
||||
{
|
||||
expectedDownloads.add(getValue(line));
|
||||
}
|
||||
}
|
||||
List<String> actualDownloads = new ArrayList<>();
|
||||
for (FileArg darg : args.getFiles())
|
||||
{
|
||||
if (darg.uri != null)
|
||||
{
|
||||
actualDownloads.add(String.format("%s|%s", darg.uri, darg.location));
|
||||
}
|
||||
}
|
||||
assertContainsUnordered("Downloads", expectedDownloads, actualDownloads);
|
||||
|
||||
// File / Path Existence Checks
|
||||
streamOf(textFile, "EXISTS").forEach(f ->
|
||||
{
|
||||
Path path = baseHome.getPath(f);
|
||||
if (f.endsWith("/"))
|
||||
{
|
||||
PathAssert.assertDirExists("Required Directory", path);
|
||||
}
|
||||
else
|
||||
{
|
||||
PathAssert.assertFileExists("Required File", path);
|
||||
}
|
||||
});
|
||||
|
||||
// Output Validation
|
||||
streamOf(textFile, "OUTPUT").forEach(regex ->
|
||||
{
|
||||
Pattern pat = Pattern.compile(regex);
|
||||
Matcher mat = pat.matcher(output);
|
||||
assertTrue("Output [\n" + output + "]\nContains Regex Match: " + pat.pattern(), mat.find());
|
||||
});
|
||||
}
|
||||
|
||||
private static String shorten(BaseHome baseHome, Path path, Path testResourcesDir)
|
||||
{
|
||||
String value = baseHome.toShortForm(path);
|
||||
if (value.startsWith("${"))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
if (path.startsWith(testResourcesDir))
|
||||
{
|
||||
int len = testResourcesDir.toString().length();
|
||||
value = "${maven-test-resources}" + value.substring(len);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public static void assertContainsUnordered(String msg, Collection<String> expectedSet, Collection<String> actualSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
Assert.assertEquals(msg, expectedSet.size(), actualSet.size());
|
||||
if (!expectedSet.isEmpty())
|
||||
assertThat(msg, actualSet, Matchers.containsInAnyOrder(expectedSet.toArray()));
|
||||
}
|
||||
catch (AssertionError e)
|
||||
{
|
||||
System.err.println("Expected: " + expectedSet.stream().sorted().collect(Collectors.toList()));
|
||||
System.err.println("Actual : " + actualSet.stream().sorted().collect(Collectors.toList()));
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void assertOrdered(String msg, List<String> expectedList, List<String> actualList)
|
||||
{
|
||||
try
|
||||
{
|
||||
Assert.assertEquals(msg, expectedList.size(), actualList.size());
|
||||
if (!expectedList.isEmpty())
|
||||
assertThat(msg, actualList, Matchers.contains(expectedList.toArray()));
|
||||
}
|
||||
catch (AssertionError e)
|
||||
{
|
||||
System.err.println("Expected: " + expectedList);
|
||||
System.err.println("Actual : " + actualList);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
private static Stream<String> streamOf(TextFile textFile, String key)
|
||||
{
|
||||
return textFile.stream()
|
||||
.filter(s -> s.startsWith(key + "|")).map(f -> getValue(f));
|
||||
}
|
||||
|
||||
private static String getValue(String arg)
|
||||
{
|
||||
int idx = arg.indexOf('|');
|
||||
assertThat("Expecting '|' sign in [" + arg + "]", idx, greaterThanOrEqualTo(0));
|
||||
String value = arg.substring(idx + 1).trim();
|
||||
assertThat("Expecting Value after '|' in [" + arg + "]", value.length(), greaterThan(0));
|
||||
return value;
|
||||
}
|
||||
}
|
||||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.start;
|
||||
|
||||
import static org.hamcrest.Matchers.greaterThan;
|
||||
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.eclipse.jetty.start.Props.Prop;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.eclipse.jetty.toolchain.test.PathAssert;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class ConfigurationAssert
|
||||
{
|
||||
/**
|
||||
* Given a provided StartArgs, assert that the configuration it has determined is valid based on values in a assert text file.
|
||||
*
|
||||
* @param baseHome the BaseHome used. Access it via {@link Main#getBaseHome()}
|
||||
* @param args the StartArgs that has been processed via {@link Main#processCommandLine(String[])}
|
||||
* @param filename the filename of the assertion values
|
||||
* @throws FileNotFoundException if unable to find the configuration
|
||||
* @throws IOException if unable to process the configuration
|
||||
*/
|
||||
public static void assertConfiguration(BaseHome baseHome, StartArgs args, String filename) throws FileNotFoundException, IOException
|
||||
{
|
||||
assertConfiguration(baseHome, args, null, MavenTestingUtils.getTestResourceFile(filename));
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a provided StartArgs, assert that the configuration it has determined is valid based on values in a assert text file.
|
||||
*
|
||||
* @param baseHome the BaseHome used. Access it via {@link Main#getBaseHome()}
|
||||
* @param args the StartArgs that has been processed via {@link Main#processCommandLine(String[])}
|
||||
* @param output the captured output that you want to assert against
|
||||
* @param filename the filename of the assertion values
|
||||
* @throws FileNotFoundException if unable to find the configuration
|
||||
* @throws IOException if unable to process the configuration
|
||||
*/
|
||||
public static void assertConfiguration(BaseHome baseHome, StartArgs args, String output, String filename) throws FileNotFoundException, IOException
|
||||
{
|
||||
assertConfiguration(baseHome, args, output, MavenTestingUtils.getTestResourceFile(filename));
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a provided StartArgs, assert that the configuration it has determined is valid based on values in a assert text file.
|
||||
*
|
||||
* @param baseHome the BaseHome used. Access it via {@link Main#getBaseHome()}
|
||||
* @param args the StartArgs that has been processed via {@link Main#processCommandLine(String[])}
|
||||
* @param file the file of the assertion values
|
||||
* @throws FileNotFoundException if unable to find the configuration
|
||||
* @throws IOException if unable to process the configuration
|
||||
*/
|
||||
public static void assertConfiguration(BaseHome baseHome, StartArgs args, String output, File file) throws FileNotFoundException, IOException
|
||||
{
|
||||
if(output != null)
|
||||
{
|
||||
System.err.println(output);
|
||||
}
|
||||
Path testResourcesDir = MavenTestingUtils.getTestResourcesDir().toPath().toRealPath();
|
||||
TextFile textFile = new TextFile(file.toPath());
|
||||
|
||||
// Validate XMLs (order is important)
|
||||
List<String> expectedXmls = new ArrayList<>();
|
||||
for (String line : textFile)
|
||||
{
|
||||
if (line.startsWith("XML|"))
|
||||
{
|
||||
expectedXmls.add(FS.separators(getValue(line)));
|
||||
}
|
||||
}
|
||||
List<String> actualXmls = new ArrayList<>();
|
||||
for (Path xml : args.getXmlFiles())
|
||||
{
|
||||
actualXmls.add(shorten(baseHome, xml, testResourcesDir));
|
||||
}
|
||||
assertOrdered("XML Resolution Order", expectedXmls, actualXmls);
|
||||
|
||||
// Validate LIBs (order is not important)
|
||||
List<String> expectedLibs = new ArrayList<>();
|
||||
for (String line : textFile)
|
||||
{
|
||||
if (line.startsWith("LIB|"))
|
||||
{
|
||||
expectedLibs.add(FS.separators(getValue(line)));
|
||||
}
|
||||
}
|
||||
List<String> actualLibs = new ArrayList<>();
|
||||
for (File path : args.getClasspath())
|
||||
{
|
||||
actualLibs.add(shorten(baseHome, path.toPath(), testResourcesDir));
|
||||
}
|
||||
assertContainsUnordered("Libs", expectedLibs, actualLibs);
|
||||
|
||||
// Validate PROPERTIES (order is not important)
|
||||
Set<String> expectedProperties = new HashSet<>();
|
||||
for (String line : textFile)
|
||||
{
|
||||
if (line.startsWith("PROP|") || line.startsWith("SYS|"))
|
||||
{
|
||||
expectedProperties.add(getValue(line));
|
||||
}
|
||||
}
|
||||
List<String> actualProperties = new ArrayList<>();
|
||||
for (Prop prop : args.getProperties())
|
||||
{
|
||||
String name = prop.key;
|
||||
if ("jetty.home".equals(name) ||
|
||||
"jetty.base".equals(name) ||
|
||||
"jetty.home.uri".equals(name) ||
|
||||
"jetty.base.uri".equals(name) ||
|
||||
"user.dir".equals(name) ||
|
||||
prop.origin.equals(Props.ORIGIN_SYSPROP) ||
|
||||
name.startsWith("java."))
|
||||
{
|
||||
// strip these out from assertion, to make assertions easier.
|
||||
continue;
|
||||
}
|
||||
actualProperties.add(prop.key + "=" + args.getProperties().expand(prop.value));
|
||||
}
|
||||
assertContainsUnordered("Properties", expectedProperties, actualProperties);
|
||||
|
||||
// Validate PROPERTIES (order is not important)
|
||||
for (String line : textFile)
|
||||
{
|
||||
if (line.startsWith("SYS|"))
|
||||
{
|
||||
String[] expected = getValue(line).split("=",2);
|
||||
String actual = System.getProperty(expected[0]);
|
||||
assertThat("System property "+expected[0],actual,Matchers.equalTo(expected[1]));
|
||||
}
|
||||
}
|
||||
|
||||
// Validate Downloads
|
||||
List<String> expectedDownloads = new ArrayList<>();
|
||||
for (String line : textFile)
|
||||
{
|
||||
if (line.startsWith("DOWNLOAD|"))
|
||||
{
|
||||
expectedDownloads.add(getValue(line));
|
||||
}
|
||||
}
|
||||
List<String> actualDownloads = new ArrayList<>();
|
||||
for (FileArg darg : args.getFiles())
|
||||
{
|
||||
if (darg.uri != null)
|
||||
{
|
||||
actualDownloads.add(String.format("%s|%s", darg.uri, darg.location));
|
||||
}
|
||||
}
|
||||
assertContainsUnordered("Downloads", expectedDownloads, actualDownloads);
|
||||
|
||||
// File / Path Existence Checks
|
||||
streamOf(textFile, "EXISTS").forEach(f ->
|
||||
{
|
||||
Path path = baseHome.getPath(f);
|
||||
if (f.endsWith("/"))
|
||||
{
|
||||
PathAssert.assertDirExists("Required Directory", path);
|
||||
}
|
||||
else
|
||||
{
|
||||
PathAssert.assertFileExists("Required File", path);
|
||||
}
|
||||
});
|
||||
|
||||
// Output Validation
|
||||
streamOf(textFile, "OUTPUT").forEach(regex ->
|
||||
{
|
||||
Pattern pat = Pattern.compile(regex);
|
||||
Matcher mat = pat.matcher(output);
|
||||
assertTrue("Output [\n" + output + "]\nContains Regex Match: " + pat.pattern(), mat.find());
|
||||
});
|
||||
}
|
||||
|
||||
private static String shorten(BaseHome baseHome, Path path, Path testResourcesDir)
|
||||
{
|
||||
String value = baseHome.toShortForm(path);
|
||||
if (value.startsWith("${"))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
if (path.startsWith(testResourcesDir))
|
||||
{
|
||||
int len = testResourcesDir.toString().length();
|
||||
value = "${maven-test-resources}" + value.substring(len);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public static void assertContainsUnordered(String msg, Collection<String> expectedSet, Collection<String> actualSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
Assert.assertEquals(msg, expectedSet.size(), actualSet.size());
|
||||
if (!expectedSet.isEmpty())
|
||||
assertThat(msg, actualSet, Matchers.containsInAnyOrder(expectedSet.toArray()));
|
||||
}
|
||||
catch (AssertionError e)
|
||||
{
|
||||
System.err.println("Expected: " + expectedSet.stream().sorted().collect(Collectors.toList()));
|
||||
System.err.println("Actual : " + actualSet.stream().sorted().collect(Collectors.toList()));
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("Duplicates")
|
||||
public static void assertOrdered(String msg, List<String> expectedList, List<String> actualList)
|
||||
{
|
||||
try
|
||||
{
|
||||
Assert.assertEquals(msg, expectedList.size(), actualList.size());
|
||||
if (!expectedList.isEmpty())
|
||||
assertThat(msg, actualList, Matchers.contains(expectedList.toArray()));
|
||||
}
|
||||
catch (AssertionError e)
|
||||
{
|
||||
System.err.println("Expected: " + expectedList);
|
||||
System.err.println("Actual : " + actualList);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
private static Stream<String> streamOf(TextFile textFile, String key)
|
||||
{
|
||||
return textFile.stream()
|
||||
.filter(s -> s.startsWith(key + "|")).map(f -> getValue(f));
|
||||
}
|
||||
|
||||
private static String getValue(String arg)
|
||||
{
|
||||
int idx = arg.indexOf('|');
|
||||
assertThat("Expecting '|' sign in [" + arg + "]", idx, greaterThanOrEqualTo(0));
|
||||
String value = arg.substring(idx + 1).trim();
|
||||
assertThat("Expecting Value after '|' in [" + arg + "]", value.length(), greaterThan(0));
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
[name]
|
||||
alpn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
[name]
|
||||
alpn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-util-ajax</artifactId>
|
||||
|
@ -14,54 +14,6 @@
|
|||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",org.slf4j;version="[1.5,2.0)";resolution:=optional,org.slf4j.impl;version="[1.5,2.0)";resolution:=optional,*</Import-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!--
|
||||
Required for OSGI
|
||||
-->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!--
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
-->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-util</artifactId>
|
||||
|
@ -14,52 +14,6 @@
|
|||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",org.slf4j;version="[1.6,2.0)";resolution:=optional,org.slf4j.impl;version="[1.6,2.0)";resolution:=optional,*</Import-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!--
|
||||
Required for OSGI
|
||||
-->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
|
@ -68,6 +22,19 @@
|
|||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<systemPropertyVariables>
|
||||
<mavenRepoPath>${settings.localRepository}</mavenRepoPath>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
|
|
@ -24,7 +24,9 @@ import java.io.FilterOutputStream;
|
|||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
import java.util.Timer;
|
||||
|
@ -50,13 +52,12 @@ public class RolloverFileOutputStream extends FilterOutputStream
|
|||
final static String ROLLOVER_FILE_DATE_FORMAT = "yyyy_MM_dd";
|
||||
final static String ROLLOVER_FILE_BACKUP_FORMAT = "HHmmssSSS";
|
||||
final static int ROLLOVER_FILE_RETAIN_DAYS = 31;
|
||||
|
||||
|
||||
private RollTask _rollTask;
|
||||
private SimpleDateFormat _fileBackupFormat;
|
||||
private SimpleDateFormat _fileDateFormat;
|
||||
|
||||
private final TimeZone _timeZone;
|
||||
private final String _filename;
|
||||
|
||||
private String _filename;
|
||||
private File _file;
|
||||
private boolean _append;
|
||||
private int _retainDays;
|
||||
|
@ -117,7 +118,7 @@ public class RolloverFileOutputStream extends FilterOutputStream
|
|||
TimeZone zone)
|
||||
throws IOException
|
||||
{
|
||||
this(filename,append,retainDays,zone,null,null);
|
||||
this(filename,append,retainDays,zone,null,null,ZonedDateTime.now(zone.toZoneId()));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
|
@ -139,21 +140,20 @@ public class RolloverFileOutputStream extends FilterOutputStream
|
|||
String backupFormat)
|
||||
throws IOException
|
||||
{
|
||||
this(filename,append,retainDays,zone,dateFormat,backupFormat,Calendar.getInstance(zone));
|
||||
this(filename,append,retainDays,zone,dateFormat,backupFormat,ZonedDateTime.now(zone.toZoneId()));
|
||||
}
|
||||
|
||||
|
||||
RolloverFileOutputStream(String filename,
|
||||
boolean append,
|
||||
int retainDays,
|
||||
TimeZone zone,
|
||||
String dateFormat,
|
||||
String backupFormat,
|
||||
Calendar now)
|
||||
ZonedDateTime now)
|
||||
throws IOException
|
||||
{
|
||||
super(null);
|
||||
|
||||
_timeZone = zone;
|
||||
|
||||
if (dateFormat==null)
|
||||
dateFormat=ROLLOVER_FILE_DATE_FORMAT;
|
||||
|
@ -174,9 +174,8 @@ public class RolloverFileOutputStream extends FilterOutputStream
|
|||
}
|
||||
if (filename==null)
|
||||
throw new IllegalArgumentException("Invalid filename");
|
||||
|
||||
File testfile = new File(filename);
|
||||
_filename=testfile.getCanonicalPath();
|
||||
|
||||
_filename=filename;
|
||||
_append=append;
|
||||
_retainDays=retainDays;
|
||||
|
||||
|
@ -186,7 +185,7 @@ public class RolloverFileOutputStream extends FilterOutputStream
|
|||
__rollover=new Timer(RolloverFileOutputStream.class.getName(),true);
|
||||
|
||||
// Calculate Today's Midnight, based on Configured TimeZone (will be in past, even if by a few milliseconds)
|
||||
setFile(now);
|
||||
setFile(now);
|
||||
// This will schedule the rollover event to the next midnight
|
||||
scheduleNextRollover(now);
|
||||
}
|
||||
|
@ -196,32 +195,23 @@ public class RolloverFileOutputStream extends FilterOutputStream
|
|||
/**
|
||||
* Get the "start of day" for the provided DateTime at the zone specified.
|
||||
*
|
||||
* @param cal the date time to calculate from
|
||||
* @param now the date time to calculate from
|
||||
* @return start of the day of the date provided
|
||||
*/
|
||||
public static Calendar toMidnight(Calendar cal)
|
||||
public static ZonedDateTime toMidnight(ZonedDateTime now)
|
||||
{
|
||||
Calendar ret = Calendar.getInstance();
|
||||
ret.setTimeZone(cal.getTimeZone());
|
||||
ret.setTime(cal.getTime());
|
||||
ret.set(Calendar.HOUR_OF_DAY, 0);
|
||||
ret.set(Calendar.MINUTE, 0);
|
||||
ret.set(Calendar.SECOND, 0);
|
||||
ret.set(Calendar.MILLISECOND, 0);
|
||||
// next days midnight
|
||||
ret.add(Calendar.DAY_OF_MONTH, 1);
|
||||
return ret;
|
||||
return now.toLocalDate().atStartOfDay(now.getZone()).plus(1, ChronoUnit.DAYS);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
private void scheduleNextRollover(Calendar now)
|
||||
private void scheduleNextRollover(ZonedDateTime now)
|
||||
{
|
||||
_rollTask = new RollTask();
|
||||
// Establish next day's midnight of provided calendar
|
||||
Calendar midnight = toMidnight(now);
|
||||
// Get tomorrow's midnight based on Configured TimeZone
|
||||
ZonedDateTime midnight = toMidnight(now);
|
||||
|
||||
// Schedule next rollover event to occur, based on local machine's Unix Epoch milliseconds
|
||||
long delay = midnight.getTimeInMillis() - now.getTimeInMillis();
|
||||
long delay = midnight.toInstant().toEpochMilli() - now.toInstant().toEpochMilli();
|
||||
__rollover.schedule(_rollTask,delay);
|
||||
}
|
||||
|
||||
|
@ -246,11 +236,13 @@ public class RolloverFileOutputStream extends FilterOutputStream
|
|||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
synchronized void setFile(Calendar now)
|
||||
synchronized void setFile(ZonedDateTime now)
|
||||
throws IOException
|
||||
{
|
||||
// Check directory
|
||||
File file=new File(_filename);
|
||||
File file = new File(_filename);
|
||||
_filename=file.getCanonicalPath();
|
||||
file=new File(_filename);
|
||||
File dir= new File(file.getParent());
|
||||
if (!dir.isDirectory() || !dir.canWrite())
|
||||
throw new IOException("Cannot write log directory "+dir);
|
||||
|
@ -262,7 +254,7 @@ public class RolloverFileOutputStream extends FilterOutputStream
|
|||
{
|
||||
file=new File(dir,
|
||||
filename.substring(0,i)+
|
||||
_fileDateFormat.format(now.getTime()) +
|
||||
_fileDateFormat.format(new Date(now.toInstant().toEpochMilli()))+
|
||||
filename.substring(i+YYYY_MM_DD.length()));
|
||||
}
|
||||
|
||||
|
@ -275,7 +267,7 @@ public class RolloverFileOutputStream extends FilterOutputStream
|
|||
// Yep
|
||||
_file=file;
|
||||
if (!_append && file.exists())
|
||||
file.renameTo(new File(file.toString()+"."+_fileBackupFormat.format(now.getTime())));
|
||||
file.renameTo(new File(file.toString()+"."+_fileBackupFormat.format(new Date(now.toInstant().toEpochMilli()))));
|
||||
OutputStream oldOut=out;
|
||||
out=new FileOutputStream(file.toString(),_append);
|
||||
if (oldOut!=null)
|
||||
|
@ -285,13 +277,12 @@ public class RolloverFileOutputStream extends FilterOutputStream
|
|||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
void removeOldFiles(Calendar now)
|
||||
void removeOldFiles(ZonedDateTime now)
|
||||
{
|
||||
if (_retainDays>0)
|
||||
{
|
||||
// Establish expiration time, based on configured TimeZone
|
||||
now.add(Calendar.DAY_OF_MONTH, (-1)*_retainDays);
|
||||
long expired = now.getTimeInMillis();
|
||||
long expired = now.minus(_retainDays, ChronoUnit.DAYS).toInstant().toEpochMilli();
|
||||
|
||||
File file= new File(_filename);
|
||||
File dir = new File(file.getParent());
|
||||
|
@ -365,7 +356,7 @@ public class RolloverFileOutputStream extends FilterOutputStream
|
|||
{
|
||||
synchronized(RolloverFileOutputStream.class)
|
||||
{
|
||||
Calendar now = Calendar.getInstance(_timeZone);
|
||||
ZonedDateTime now = ZonedDateTime.now(_fileDateFormat.getTimeZone().toZoneId());
|
||||
RolloverFileOutputStream.this.setFile(now);
|
||||
RolloverFileOutputStream.this.scheduleNextRollover(now);
|
||||
RolloverFileOutputStream.this.removeOldFiles(now);
|
||||
|
|
|
@ -29,7 +29,6 @@ import java.util.concurrent.locks.ReentrantLock;
|
|||
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.thread.Invocable.InvocationType;
|
||||
|
||||
/**
|
||||
* Provides a reusable {@link Callback} that can block the thread
|
||||
|
@ -168,6 +167,7 @@ public class SharedBlockingCallback
|
|||
}
|
||||
else
|
||||
{
|
||||
cause.printStackTrace(System.err);
|
||||
throw new IllegalStateException(_state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,70 +26,87 @@ import java.io.FileReader;
|
|||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.attribute.FileTime;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.time.temporal.TemporalAccessor;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.jetty.toolchain.test.FS;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
public class RolloverFileOutputStreamTest
|
||||
{
|
||||
@Rule
|
||||
public TestingDir testingDir = new TestingDir();
|
||||
|
||||
private static TimeZone toZoneId(String timezoneId)
|
||||
private static ZoneId toZoneId(String timezoneId)
|
||||
{
|
||||
TimeZone zone = TimeZone.getTimeZone(timezoneId);
|
||||
// System.err.printf("toZoneId('%s'): displayName=%s, id=%s%n", timezoneId, zone.getDisplayName(), zone.getID());
|
||||
ZoneId zone = TimeZone.getTimeZone(timezoneId).toZoneId();
|
||||
// System.out.printf(".toZoneId(\"%s\") = [id=%s,normalized=%s]%n", timezoneId, zone.getId(), zone.normalized());
|
||||
return zone;
|
||||
}
|
||||
|
||||
private static Calendar toDateTime(String timendate, TimeZone zone) throws ParseException
|
||||
private static ZonedDateTime toDateTime(String timendate, ZoneId zone)
|
||||
{
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd-hh:mm:ss.S a z");
|
||||
formatter.setTimeZone(zone);
|
||||
Date parsed = formatter.parse(timendate);
|
||||
Calendar cal = Calendar.getInstance(zone);
|
||||
cal.setTime(parsed);
|
||||
return cal;
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.MM.dd-hh:mm:ss.S a z")
|
||||
.withZone(zone);
|
||||
return ZonedDateTime.parse(timendate, formatter);
|
||||
}
|
||||
|
||||
private static String toString(Calendar date)
|
||||
private static String toString(TemporalAccessor date)
|
||||
{
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd-hh:mm:ss.S a z");
|
||||
formatter.setTimeZone(date.getTimeZone());
|
||||
return formatter.format(date.getTime());
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.MM.dd-hh:mm:ss.S a z");
|
||||
return formatter.format(date);
|
||||
}
|
||||
|
||||
private void assertSequence(Calendar midnight, Object[][] expected)
|
||||
private void assertSequence(ZonedDateTime midnight, Object[][] expected)
|
||||
{
|
||||
Calendar nextEvent = midnight;
|
||||
ZonedDateTime nextEvent = midnight;
|
||||
|
||||
for (int i = 0; i < expected.length; i++)
|
||||
{
|
||||
long lastMs = nextEvent.getTimeInMillis();
|
||||
nextEvent = RolloverFileOutputStream.toMidnight(nextEvent);
|
||||
long currentMillis = nextEvent.toInstant().toEpochMilli();
|
||||
nextEvent = nextEvent.toLocalDate().plus(1, ChronoUnit.DAYS).atStartOfDay(nextEvent.getZone());
|
||||
assertThat("Next Event", toString(nextEvent), is(expected[i][0]));
|
||||
long duration = (nextEvent.getTimeInMillis() - lastMs);
|
||||
long duration = (nextEvent.toInstant().toEpochMilli() - currentMillis);
|
||||
assertThat("Duration to next event", duration, is((long) expected[i][1]));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <a href="Issue #1507">https://github.com/eclipse/jetty.project/issues/1507</a>
|
||||
*/
|
||||
@Test
|
||||
public void testMidnightRolloverCalc_PST_DST_Start() throws ParseException
|
||||
public void testMidnightRolloverCalc_PDT_Issue1507()
|
||||
{
|
||||
TimeZone zone = toZoneId("PST");
|
||||
Calendar initialDate = toDateTime("2016.03.10-01:23:45.0 PM PST", zone);
|
||||
ZoneId zone = toZoneId("PST");
|
||||
ZonedDateTime initialDate = toDateTime("2017.04.26-08:00:00.0 PM PDT", zone);
|
||||
|
||||
Calendar midnight = RolloverFileOutputStream.toMidnight(initialDate);
|
||||
ZonedDateTime midnight = RolloverFileOutputStream.toMidnight(initialDate);
|
||||
assertThat("Midnight", toString(midnight), is("2017.04.27-12:00:00.0 AM PDT"));
|
||||
|
||||
Object expected[][] = {
|
||||
{"2017.04.27-12:00:00.0 AM PDT", 14_400_000L},
|
||||
{"2017.04.28-12:00:00.0 AM PDT", 86_400_000L},
|
||||
{"2017.04.29-12:00:00.0 AM PDT", 86_400_000L},
|
||||
{"2017.04.30-12:00:00.0 AM PDT", 86_400_000L},
|
||||
{"2017.05.01-12:00:00.0 AM PDT", 86_400_000L},
|
||||
{"2017.05.02-12:00:00.0 AM PDT", 86_400_000L},
|
||||
};
|
||||
|
||||
assertSequence(initialDate, expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMidnightRolloverCalc_PST_DST_Start()
|
||||
{
|
||||
ZoneId zone = toZoneId("PST");
|
||||
ZonedDateTime initialDate = toDateTime("2016.03.10-01:23:45.0 PM PST", zone);
|
||||
|
||||
ZonedDateTime midnight = RolloverFileOutputStream.toMidnight(initialDate);
|
||||
assertThat("Midnight", toString(midnight), is("2016.03.11-12:00:00.0 AM PST"));
|
||||
|
||||
Object expected[][] = {
|
||||
|
@ -104,12 +121,12 @@ public class RolloverFileOutputStreamTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testMidnightRolloverCalc_PST_DST_End() throws ParseException
|
||||
public void testMidnightRolloverCalc_PST_DST_End()
|
||||
{
|
||||
TimeZone zone = toZoneId("PST");
|
||||
Calendar initialDate = toDateTime("2016.11.03-11:22:33.0 AM PDT", zone);
|
||||
ZoneId zone = toZoneId("PST");
|
||||
ZonedDateTime initialDate = toDateTime("2016.11.03-11:22:33.0 AM PDT", zone);
|
||||
|
||||
Calendar midnight = RolloverFileOutputStream.toMidnight(initialDate);
|
||||
ZonedDateTime midnight = RolloverFileOutputStream.toMidnight(initialDate);
|
||||
assertThat("Midnight", toString(midnight), is("2016.11.04-12:00:00.0 AM PDT"));
|
||||
|
||||
Object expected[][] = {
|
||||
|
@ -124,12 +141,12 @@ public class RolloverFileOutputStreamTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testMidnightRolloverCalc_Sydney_DST_Start() throws ParseException
|
||||
public void testMidnightRolloverCalc_Sydney_DST_Start()
|
||||
{
|
||||
TimeZone zone = toZoneId("Australia/Sydney");
|
||||
Calendar initialDate = toDateTime("2016.09.30-01:23:45.0 PM AEST", zone);
|
||||
ZoneId zone = toZoneId("Australia/Sydney");
|
||||
ZonedDateTime initialDate = toDateTime("2016.09.31-01:23:45.0 PM AEST", zone);
|
||||
|
||||
Calendar midnight = RolloverFileOutputStream.toMidnight(initialDate);
|
||||
ZonedDateTime midnight = RolloverFileOutputStream.toMidnight(initialDate);
|
||||
assertThat("Midnight", toString(midnight), is("2016.10.01-12:00:00.0 AM AEST"));
|
||||
|
||||
Object expected[][] = {
|
||||
|
@ -144,12 +161,12 @@ public class RolloverFileOutputStreamTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testMidnightRolloverCalc_Sydney_DST_End() throws ParseException
|
||||
public void testMidnightRolloverCalc_Sydney_DST_End()
|
||||
{
|
||||
TimeZone zone = toZoneId("Australia/Sydney");
|
||||
Calendar initialDate = toDateTime("2016.04.01-11:22:33.0 AM AEDT", zone);
|
||||
ZoneId zone = toZoneId("Australia/Sydney");
|
||||
ZonedDateTime initialDate = toDateTime("2016.04.01-11:22:33.0 AM AEDT", zone);
|
||||
|
||||
Calendar midnight = RolloverFileOutputStream.toMidnight(initialDate);
|
||||
ZonedDateTime midnight = RolloverFileOutputStream.toMidnight(initialDate);
|
||||
assertThat("Midnight", toString(midnight), is("2016.04.02-12:00:00.0 AM AEDT"));
|
||||
|
||||
Object expected[][] = {
|
||||
|
@ -169,23 +186,23 @@ public class RolloverFileOutputStreamTest
|
|||
File testDir = MavenTestingUtils.getTargetTestingDir(RolloverFileOutputStreamTest.class.getName() + "_testFileHandling");
|
||||
Path testPath = testDir.toPath();
|
||||
FS.ensureEmpty(testDir);
|
||||
|
||||
TimeZone zone = toZoneId("Australia/Sydney");
|
||||
Calendar now = toDateTime("2016.04.10-08:30:12.3 AM AEST", zone);
|
||||
|
||||
ZoneId zone = toZoneId("Australia/Sydney");
|
||||
ZonedDateTime now = toDateTime("2016.04.10-08:30:12.3 AM AEDT", zone);
|
||||
|
||||
File template = new File(testDir,"test-rofos-yyyy_mm_dd.log");
|
||||
|
||||
try (RolloverFileOutputStream rofos =
|
||||
new RolloverFileOutputStream(template.getAbsolutePath(),false,3,zone,null,null,now))
|
||||
new RolloverFileOutputStream(template.getAbsolutePath(),false,3,TimeZone.getTimeZone(zone),null,null,now))
|
||||
{
|
||||
rofos.write("TICK".getBytes());
|
||||
rofos.flush();
|
||||
}
|
||||
|
||||
now.add(Calendar.MINUTE, 5);
|
||||
now = now.plus(5,ChronoUnit.MINUTES);
|
||||
|
||||
try (RolloverFileOutputStream rofos =
|
||||
new RolloverFileOutputStream(template.getAbsolutePath(),false,3,zone,null,null,now))
|
||||
new RolloverFileOutputStream(template.getAbsolutePath(),false,3,TimeZone.getTimeZone(zone),null,null,now))
|
||||
{
|
||||
rofos.write("TOCK".getBytes());
|
||||
rofos.flush();
|
||||
|
@ -200,37 +217,32 @@ public class RolloverFileOutputStreamTest
|
|||
|
||||
assertThat(Arrays.asList(ls),Matchers.containsInAnyOrder(backup,"test-rofos-2016_04_10.log"));
|
||||
|
||||
Files.setLastModifiedTime(testPath.resolve(backup),FileTime.fromMillis(now.getTimeInMillis()));
|
||||
Files.setLastModifiedTime(testPath.resolve("test-rofos-2016_04_10.log"),FileTime.fromMillis(now.getTimeInMillis()));
|
||||
Files.setLastModifiedTime(testPath.resolve(backup),FileTime.from(now.toInstant()));
|
||||
Files.setLastModifiedTime(testPath.resolve("test-rofos-2016_04_10.log"),FileTime.from(now.toInstant()));
|
||||
|
||||
// Copy calendar (don't want to change "now")
|
||||
Calendar time = Calendar.getInstance();
|
||||
time.setTimeZone(now.getTimeZone());
|
||||
time.setTime(now.getTime());
|
||||
time.add(Calendar.DAY_OF_MONTH, -1);
|
||||
|
||||
ZonedDateTime time = now.minus(1,ChronoUnit.DAYS);
|
||||
for (int i=10;i-->5;)
|
||||
{
|
||||
String file = "test-rofos-2016_04_0"+i+".log";
|
||||
Path path = testPath.resolve(file);
|
||||
FS.touch(path);
|
||||
Files.setLastModifiedTime(path,FileTime.fromMillis(time.getTimeInMillis()));
|
||||
Files.setLastModifiedTime(path,FileTime.from(time.toInstant()));
|
||||
|
||||
if (i%2==0)
|
||||
{
|
||||
file = "test-rofos-2016_04_0"+i+".log.083512300";
|
||||
path = testPath.resolve(file);
|
||||
FS.touch(path);
|
||||
Files.setLastModifiedTime(path,FileTime.fromMillis(time.getTimeInMillis()));
|
||||
time.add(Calendar.DAY_OF_MONTH, -1);
|
||||
Files.setLastModifiedTime(path,FileTime.from(time.toInstant()));
|
||||
time = time.minus(1,ChronoUnit.DAYS);
|
||||
}
|
||||
|
||||
file = "unrelated-"+i;
|
||||
path = testPath.resolve(file);
|
||||
FS.touch(path);
|
||||
Files.setLastModifiedTime(path,FileTime.fromMillis(time.getTimeInMillis()));
|
||||
|
||||
time.add(Calendar.DAY_OF_MONTH, -1);
|
||||
Files.setLastModifiedTime(path,FileTime.from(time.toInstant()));
|
||||
|
||||
time = time.minus(1,ChronoUnit.DAYS);
|
||||
}
|
||||
|
||||
ls = testDir.list();
|
||||
|
@ -242,9 +254,9 @@ public class RolloverFileOutputStreamTest
|
|||
"test-rofos-2016_04_08.log",
|
||||
"test-rofos-2016_04_09.log",
|
||||
"test-rofos-2016_04_10.log",
|
||||
"test-rofos-2016_04_06.log.083512300",
|
||||
"test-rofos-2016_04_08.log.083512300",
|
||||
"test-rofos-2016_04_10.log.083512003",
|
||||
"test-rofos-2016_04_06.log.083512300",
|
||||
"test-rofos-2016_04_08.log.083512300",
|
||||
"test-rofos-2016_04_10.log.083512300",
|
||||
"unrelated-9",
|
||||
"unrelated-8",
|
||||
"unrelated-7",
|
||||
|
@ -260,7 +272,7 @@ public class RolloverFileOutputStreamTest
|
|||
"test-rofos-2016_04_09.log",
|
||||
"test-rofos-2016_04_10.log",
|
||||
"test-rofos-2016_04_08.log.083512300",
|
||||
"test-rofos-2016_04_10.log.083512003",
|
||||
"test-rofos-2016_04_10.log.083512300",
|
||||
"unrelated-9",
|
||||
"unrelated-8",
|
||||
"unrelated-7",
|
||||
|
@ -279,14 +291,14 @@ public class RolloverFileOutputStreamTest
|
|||
{
|
||||
File testDir = MavenTestingUtils.getTargetTestingDir(RolloverFileOutputStreamTest.class.getName() + "_testRollover");
|
||||
FS.ensureEmpty(testDir);
|
||||
|
||||
TimeZone zone = toZoneId("Australia/Sydney");
|
||||
Calendar now = toDateTime("2016.04.10-11:59:58.0 PM AEST", zone);
|
||||
|
||||
ZoneId zone = toZoneId("Australia/Sydney");
|
||||
ZonedDateTime now = toDateTime("2016.04.10-11:59:55.0 PM AEDT", zone);
|
||||
|
||||
File template = new File(testDir,"test-rofos-yyyy_mm_dd.log");
|
||||
|
||||
try (RolloverFileOutputStream rofos =
|
||||
new RolloverFileOutputStream(template.getAbsolutePath(),false,0,zone,null,null,now))
|
||||
new RolloverFileOutputStream(template.getAbsolutePath(),false,0,TimeZone.getTimeZone(zone),null,null,now))
|
||||
{
|
||||
rofos.write("BEFORE".getBytes());
|
||||
rofos.flush();
|
||||
|
@ -294,7 +306,7 @@ public class RolloverFileOutputStreamTest
|
|||
assertThat(ls.length,is(1));
|
||||
assertThat(ls[0],is("test-rofos-2016_04_10.log"));
|
||||
|
||||
TimeUnit.SECONDS.sleep(5);
|
||||
TimeUnit.SECONDS.sleep(10);
|
||||
rofos.write("AFTER".getBytes());
|
||||
ls = testDir.list();
|
||||
assertThat(ls.length,is(2));
|
||||
|
|
|
@ -1,135 +1,135 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.util;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
|
||||
@RunWith(Parameterized.class)
|
||||
public class URIUtilCanonicalPathTest
|
||||
{
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
public static List<String[]> data()
|
||||
{
|
||||
String[][] canonical =
|
||||
{
|
||||
// Basic examples (no changes expected)
|
||||
{"/hello.html", "/hello.html"},
|
||||
{"/css/main.css", "/css/main.css"},
|
||||
{"/", "/"},
|
||||
{"", ""},
|
||||
{"/aaa/bbb/", "/aaa/bbb/"},
|
||||
{"/aaa/bbb", "/aaa/bbb"},
|
||||
{"aaa/bbb", "aaa/bbb"},
|
||||
{"aaa/", "aaa/"},
|
||||
{"aaa", "aaa"},
|
||||
{"a", "a"},
|
||||
{"a/", "a/"},
|
||||
|
||||
// Extra slashes
|
||||
{"/aaa//bbb/", "/aaa//bbb/"},
|
||||
{"/aaa//bbb", "/aaa//bbb"},
|
||||
{"/aaa///bbb/", "/aaa///bbb/"},
|
||||
|
||||
// Path traversal with current references "./"
|
||||
{"/aaa/./bbb/", "/aaa/bbb/"},
|
||||
{"/aaa/./bbb", "/aaa/bbb"},
|
||||
{"./bbb/", "bbb/"},
|
||||
{"./aaa/../bbb/", "bbb/"},
|
||||
{"/foo/.", "/foo/"},
|
||||
{"./", ""},
|
||||
{".", ""},
|
||||
{".//", "/"},
|
||||
{".///", "//"},
|
||||
{"/.", "/"},
|
||||
{"//.", "//"},
|
||||
{"///.", "///"},
|
||||
|
||||
// Path traversal directory (but not past root)
|
||||
{"/aaa/../bbb/", "/bbb/"},
|
||||
{"/aaa/../bbb", "/bbb"},
|
||||
{"/aaa..bbb/", "/aaa..bbb/"},
|
||||
{"/aaa..bbb", "/aaa..bbb"},
|
||||
{"/aaa/..bbb/", "/aaa/..bbb/"},
|
||||
{"/aaa/..bbb", "/aaa/..bbb"},
|
||||
{"/aaa/./../bbb/", "/bbb/"},
|
||||
{"/aaa/./../bbb", "/bbb"},
|
||||
{"/aaa/bbb/ccc/../../ddd/", "/aaa/ddd/"},
|
||||
{"/aaa/bbb/ccc/../../ddd", "/aaa/ddd"},
|
||||
{"/foo/../bar//", "/bar//"},
|
||||
{"/ctx/../bar/../ctx/all/index.txt", "/ctx/all/index.txt"},
|
||||
{"/down/.././index.html", "/index.html"},
|
||||
|
||||
// Path traversal up past root
|
||||
{"..", null},
|
||||
{"./..", null},
|
||||
{"aaa/../..", null},
|
||||
{"/foo/bar/../../..", null},
|
||||
{"/../foo", null},
|
||||
{"a/.", "a/"},
|
||||
{"a/..", ""},
|
||||
{"a/../..", null},
|
||||
{"/foo/../../bar", null},
|
||||
|
||||
// Query parameter specifics
|
||||
{"/ctx/dir?/../index.html", "/ctx/index.html"},
|
||||
{"/get-files?file=/etc/passwd", "/get-files?file=/etc/passwd"},
|
||||
{"/get-files?file=../../../../../passwd", null},
|
||||
|
||||
// Known windows shell quirks
|
||||
{"file.txt ", "file.txt "}, // with spaces
|
||||
{"file.txt...", "file.txt..."}, // extra dots ignored by windows
|
||||
// BREAKS Jenkins: {"file.txt\u0000", "file.txt\u0000"}, // null terminated is ignored by windows
|
||||
{"file.txt\r", "file.txt\r"}, // CR terminated is ignored by windows
|
||||
{"file.txt\n", "file.txt\n"}, // LF terminated is ignored by windows
|
||||
{"file.txt\"\"\"\"", "file.txt\"\"\"\""}, // extra quotes ignored by windows
|
||||
{"file.txt<<<>>><", "file.txt<<<>>><"}, // angle brackets at end of path ignored by windows
|
||||
{"././././././file.txt", "file.txt"},
|
||||
|
||||
// Oddball requests that look like path traversal, but are not
|
||||
{"/....", "/...."},
|
||||
{"/..../ctx/..../blah/logo.jpg", "/..../ctx/..../blah/logo.jpg"},
|
||||
|
||||
// paths with encoded segments should remain encoded
|
||||
// canonicalPath() is not responsible for decoding characters
|
||||
{"%2e%2e/", "%2e%2e/"},
|
||||
};
|
||||
return Arrays.asList(canonical);
|
||||
}
|
||||
|
||||
@Parameterized.Parameter(0)
|
||||
public String input;
|
||||
|
||||
@Parameterized.Parameter(1)
|
||||
public String expectedResult;
|
||||
|
||||
@Test
|
||||
public void testCanonicalPath()
|
||||
{
|
||||
assertThat("Canonical", URIUtil.canonicalPath(input), is(expectedResult));
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.util;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
|
||||
@RunWith(Parameterized.class)
|
||||
public class URIUtilCanonicalPathTest
|
||||
{
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
public static List<String[]> data()
|
||||
{
|
||||
String[][] canonical =
|
||||
{
|
||||
// Basic examples (no changes expected)
|
||||
{"/hello.html", "/hello.html"},
|
||||
{"/css/main.css", "/css/main.css"},
|
||||
{"/", "/"},
|
||||
{"", ""},
|
||||
{"/aaa/bbb/", "/aaa/bbb/"},
|
||||
{"/aaa/bbb", "/aaa/bbb"},
|
||||
{"aaa/bbb", "aaa/bbb"},
|
||||
{"aaa/", "aaa/"},
|
||||
{"aaa", "aaa"},
|
||||
{"a", "a"},
|
||||
{"a/", "a/"},
|
||||
|
||||
// Extra slashes
|
||||
{"/aaa//bbb/", "/aaa//bbb/"},
|
||||
{"/aaa//bbb", "/aaa//bbb"},
|
||||
{"/aaa///bbb/", "/aaa///bbb/"},
|
||||
|
||||
// Path traversal with current references "./"
|
||||
{"/aaa/./bbb/", "/aaa/bbb/"},
|
||||
{"/aaa/./bbb", "/aaa/bbb"},
|
||||
{"./bbb/", "bbb/"},
|
||||
{"./aaa/../bbb/", "bbb/"},
|
||||
{"/foo/.", "/foo/"},
|
||||
{"./", ""},
|
||||
{".", ""},
|
||||
{".//", "/"},
|
||||
{".///", "//"},
|
||||
{"/.", "/"},
|
||||
{"//.", "//"},
|
||||
{"///.", "///"},
|
||||
|
||||
// Path traversal directory (but not past root)
|
||||
{"/aaa/../bbb/", "/bbb/"},
|
||||
{"/aaa/../bbb", "/bbb"},
|
||||
{"/aaa..bbb/", "/aaa..bbb/"},
|
||||
{"/aaa..bbb", "/aaa..bbb"},
|
||||
{"/aaa/..bbb/", "/aaa/..bbb/"},
|
||||
{"/aaa/..bbb", "/aaa/..bbb"},
|
||||
{"/aaa/./../bbb/", "/bbb/"},
|
||||
{"/aaa/./../bbb", "/bbb"},
|
||||
{"/aaa/bbb/ccc/../../ddd/", "/aaa/ddd/"},
|
||||
{"/aaa/bbb/ccc/../../ddd", "/aaa/ddd"},
|
||||
{"/foo/../bar//", "/bar//"},
|
||||
{"/ctx/../bar/../ctx/all/index.txt", "/ctx/all/index.txt"},
|
||||
{"/down/.././index.html", "/index.html"},
|
||||
|
||||
// Path traversal up past root
|
||||
{"..", null},
|
||||
{"./..", null},
|
||||
{"aaa/../..", null},
|
||||
{"/foo/bar/../../..", null},
|
||||
{"/../foo", null},
|
||||
{"a/.", "a/"},
|
||||
{"a/..", ""},
|
||||
{"a/../..", null},
|
||||
{"/foo/../../bar", null},
|
||||
|
||||
// Query parameter specifics
|
||||
{"/ctx/dir?/../index.html", "/ctx/index.html"},
|
||||
{"/get-files?file=/etc/passwd", "/get-files?file=/etc/passwd"},
|
||||
{"/get-files?file=../../../../../passwd", null},
|
||||
|
||||
// Known windows shell quirks
|
||||
{"file.txt ", "file.txt "}, // with spaces
|
||||
{"file.txt...", "file.txt..."}, // extra dots ignored by windows
|
||||
// BREAKS Jenkins: {"file.txt\u0000", "file.txt\u0000"}, // null terminated is ignored by windows
|
||||
{"file.txt\r", "file.txt\r"}, // CR terminated is ignored by windows
|
||||
{"file.txt\n", "file.txt\n"}, // LF terminated is ignored by windows
|
||||
{"file.txt\"\"\"\"", "file.txt\"\"\"\""}, // extra quotes ignored by windows
|
||||
{"file.txt<<<>>><", "file.txt<<<>>><"}, // angle brackets at end of path ignored by windows
|
||||
{"././././././file.txt", "file.txt"},
|
||||
|
||||
// Oddball requests that look like path traversal, but are not
|
||||
{"/....", "/...."},
|
||||
{"/..../ctx/..../blah/logo.jpg", "/..../ctx/..../blah/logo.jpg"},
|
||||
|
||||
// paths with encoded segments should remain encoded
|
||||
// canonicalPath() is not responsible for decoding characters
|
||||
{"%2e%2e/", "%2e%2e/"},
|
||||
};
|
||||
return Arrays.asList(canonical);
|
||||
}
|
||||
|
||||
@Parameterized.Parameter(0)
|
||||
public String input;
|
||||
|
||||
@Parameterized.Parameter(1)
|
||||
public String expectedResult;
|
||||
|
||||
@Test
|
||||
public void testCanonicalPath()
|
||||
{
|
||||
assertThat("Canonical", URIUtil.canonicalPath(input), is(expectedResult));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-webapp</artifactId>
|
||||
|
@ -27,54 +27,6 @@
|
|||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>config</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2]",*</Import-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!--
|
||||
Required for OSGI
|
||||
-->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>
|
||||
${project.build.outputDirectory}/META-INF/MANIFEST.MF
|
||||
</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
|
@ -82,6 +34,17 @@
|
|||
<onlyAnalyze>org.eclipse.jetty.webapp.*</onlyAnalyze>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>org.eclipse.jetty.webapp.WebAppClassLoaderUrlStreamTest</exclude>
|
||||
</excludes>
|
||||
<forkCount>1</forkCount>
|
||||
<reuseForks>false</reuseForks>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
|
|
|
@ -1,78 +1,78 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.webapp;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.net.URL;
|
||||
import java.net.URLStreamHandlerFactory;
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
|
||||
public final class URLStreamHandlerUtil
|
||||
{
|
||||
public static void setFactory(URLStreamHandlerFactory factory)
|
||||
{
|
||||
try
|
||||
{
|
||||
// First, reset the factory field
|
||||
Field factoryField = getURLStreamHandlerFactoryField();
|
||||
factoryField.setAccessible(true);
|
||||
factoryField.set(null, null);
|
||||
|
||||
if(factory != null)
|
||||
{
|
||||
// Next, set the factory
|
||||
URL.setURLStreamHandlerFactory(factory);
|
||||
}
|
||||
}
|
||||
catch(Throwable ignore)
|
||||
{
|
||||
// ignore.printStackTrace(System.err);
|
||||
}
|
||||
}
|
||||
|
||||
public static URLStreamHandlerFactory getFactory()
|
||||
{
|
||||
try
|
||||
{
|
||||
// First, reset the factory field
|
||||
Field factoryField = getURLStreamHandlerFactoryField();
|
||||
factoryField.setAccessible(true);
|
||||
return (URLStreamHandlerFactory) factoryField.get(null);
|
||||
}
|
||||
catch(Throwable ignore)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static Field getURLStreamHandlerFactoryField()
|
||||
{
|
||||
Optional<Field> optFactoryField = Arrays.stream(URL.class.getDeclaredFields())
|
||||
.filter((f) -> Modifier.isStatic(f.getModifiers()) &&
|
||||
f.getType().equals(URLStreamHandlerFactory.class))
|
||||
.findFirst();
|
||||
|
||||
if(optFactoryField.isPresent())
|
||||
return optFactoryField.get();
|
||||
|
||||
throw new RuntimeException( "Cannot find URLStreamHandlerFactory field in " + URL.class.getName() );
|
||||
}
|
||||
}
|
||||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.webapp;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.net.URL;
|
||||
import java.net.URLStreamHandlerFactory;
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
|
||||
public final class URLStreamHandlerUtil
|
||||
{
|
||||
public static void setFactory(URLStreamHandlerFactory factory)
|
||||
{
|
||||
try
|
||||
{
|
||||
// First, reset the factory field
|
||||
Field factoryField = getURLStreamHandlerFactoryField();
|
||||
factoryField.setAccessible(true);
|
||||
factoryField.set(null, null);
|
||||
|
||||
if(factory != null)
|
||||
{
|
||||
// Next, set the factory
|
||||
URL.setURLStreamHandlerFactory(factory);
|
||||
}
|
||||
}
|
||||
catch(Throwable ignore)
|
||||
{
|
||||
// ignore.printStackTrace(System.err);
|
||||
}
|
||||
}
|
||||
|
||||
public static URLStreamHandlerFactory getFactory()
|
||||
{
|
||||
try
|
||||
{
|
||||
// First, reset the factory field
|
||||
Field factoryField = getURLStreamHandlerFactoryField();
|
||||
factoryField.setAccessible(true);
|
||||
return (URLStreamHandlerFactory) factoryField.get(null);
|
||||
}
|
||||
catch(Throwable ignore)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static Field getURLStreamHandlerFactoryField()
|
||||
{
|
||||
Optional<Field> optFactoryField = Arrays.stream(URL.class.getDeclaredFields())
|
||||
.filter((f) -> Modifier.isStatic(f.getModifiers()) &&
|
||||
f.getType().equals(URLStreamHandlerFactory.class))
|
||||
.findFirst();
|
||||
|
||||
if(optFactoryField.isPresent())
|
||||
return optFactoryField.get();
|
||||
|
||||
throw new RuntimeException( "Cannot find URLStreamHandlerFactory field in " + URL.class.getName() );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jetty-xml</artifactId>
|
||||
|
@ -14,30 +14,6 @@
|
|||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!--
|
||||
Required for OSGI
|
||||
-->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
|
|
103
pom.xml
103
pom.xml
|
@ -6,7 +6,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.3.20-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
<name>Jetty :: Project</name>
|
||||
<description>The Eclipse Jetty Project</description>
|
||||
<packaging>pom</packaging>
|
||||
|
@ -861,92 +861,6 @@
|
|||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jxr-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<configuration>
|
||||
<maxmemory>512m</maxmemory>
|
||||
<docfilessubdirs>true</docfilessubdirs>
|
||||
<detectLinks>true</detectLinks>
|
||||
<detectJavaApiLink>true</detectJavaApiLink>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
<configuration>
|
||||
<targetJdk>1.7</targetJdk>
|
||||
<rulesets>
|
||||
<ruleset>jetty/pmd_ruleset.xml</ruleset>
|
||||
</rulesets>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
<modules>
|
||||
<module>jetty-ant</module>
|
||||
<module>jetty-util</module>
|
||||
<module>jetty-jmx</module>
|
||||
<module>jetty-io</module>
|
||||
<module>jetty-http</module>
|
||||
<module>jetty-http2</module>
|
||||
<module>jetty-continuation</module>
|
||||
<module>jetty-server</module>
|
||||
<module>jetty-xml</module>
|
||||
<module>jetty-security</module>
|
||||
<module>jetty-servlet</module>
|
||||
<module>jetty-webapp</module>
|
||||
<module>jetty-fcgi</module>
|
||||
<module>jetty-websocket</module>
|
||||
<module>jetty-servlets</module>
|
||||
<module>jetty-util-ajax</module>
|
||||
<module>apache-jsp</module>
|
||||
<module>apache-jstl</module>
|
||||
<module>jetty-maven-plugin</module>
|
||||
<module>jetty-jspc-maven-plugin</module>
|
||||
<module>jetty-deploy</module>
|
||||
<module>jetty-start</module>
|
||||
<module>jetty-plus</module>
|
||||
<module>jetty-annotations</module>
|
||||
<module>jetty-jndi</module>
|
||||
<module>jetty-jaas</module>
|
||||
<module>jetty-cdi</module>
|
||||
<module>jetty-spring</module>
|
||||
<module>jetty-client</module>
|
||||
<module>jetty-proxy</module>
|
||||
<module>jetty-jaspi</module>
|
||||
<module>jetty-rewrite</module>
|
||||
<module>jetty-nosql</module>
|
||||
<module>jetty-infinispan</module>
|
||||
<module>jetty-hazelcast</module>
|
||||
<module>jetty-gcloud</module>
|
||||
<module>tests</module>
|
||||
<module>examples</module>
|
||||
<module>jetty-quickstart</module>
|
||||
<module>jetty-distribution</module>
|
||||
<module>jetty-runner</module>
|
||||
<module>jetty-monitor</module>
|
||||
<module>jetty-http-spi</module>
|
||||
<module>jetty-osgi</module>
|
||||
<module>jetty-alpn</module>
|
||||
<module>jetty-bom</module>
|
||||
<module>jetty-documentation</module>
|
||||
<!-- modules that need fixed and added back, or simply dropped and not maintained -->
|
||||
<!--<module>jetty-rhttp</module>-->
|
||||
<!--<module>jetty-overlay-deployer</module>-->
|
||||
</modules>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -957,7 +871,7 @@
|
|||
<dependency>
|
||||
<groupId>javax.websocket</groupId>
|
||||
<artifactId>javax.websocket-api</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.annotation</groupId>
|
||||
|
@ -1033,7 +947,7 @@
|
|||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-test-helper</artifactId>
|
||||
<version>4.0</version>
|
||||
<version>4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
|
@ -1665,6 +1579,17 @@
|
|||
<url>https://webtide.com</url>
|
||||
</organization>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jetty-snapshots</id>
|
||||
<name>jetty-snapshots</name>
|
||||
<url>http://oss.sonatype.org/content/repositories/jetty-snapshots</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>oss.sonatype.org</id>
|
||||
|
|
|
@ -1,27 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
// ========================================================================
|
||||
// Copyright (c) Webtide LLC
|
||||
//
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0.txt
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-project</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
|
@ -75,5 +58,6 @@
|
|||
<module>test-integration</module>
|
||||
<module>test-quickstart</module>
|
||||
<module>test-jmx</module>
|
||||
<module>test-http-client-transport</module>
|
||||
</modules>
|
||||
</project>
|
||||
|
|
|
@ -1,26 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
// ========================================================================
|
||||
// Copyright (c) Webtide LLC
|
||||
//
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0.txt
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>tests-parent</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -28,6 +11,9 @@
|
|||
<packaging>jar</packaging>
|
||||
<name>Test :: Continuation</name>
|
||||
<description>Asynchronous API</description>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.continuation</bundle-symbolic-name>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
@ -42,11 +28,11 @@
|
|||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlet</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-continuation</artifactId>
|
||||
|
@ -57,6 +43,6 @@
|
|||
<artifactId>jetty-test-helper</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -1,26 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
// ========================================================================
|
||||
// Copyright (c) Webtide LLC
|
||||
//
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0.txt
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>tests-parent</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>test-integration</artifactId>
|
||||
|
@ -31,6 +14,8 @@
|
|||
<test-wars-dir>${project.build.directory}/test-wars</test-wars-dir>
|
||||
<test-libs-dir>${project.build.directory}/test-libs</test-libs-dir>
|
||||
<test-dist-dir>${project.build.directory}/test-dist</test-dist-dir>
|
||||
<bundle-symbolic-name>${project.groupId}.integrations</bundle-symbolic-name>
|
||||
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
|
@ -116,6 +101,13 @@
|
|||
<version>${project.version}</version>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-http</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-test-helper</artifactId>
|
||||
|
@ -123,7 +115,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jsp</artifactId>
|
||||
<artifactId>apache-jsp</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -133,5 +125,17 @@
|
|||
<type>war</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.alpn</groupId>
|
||||
<artifactId>alpn-api</artifactId>
|
||||
<version>${alpn.api.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-alpn-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -1,26 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
// ========================================================================
|
||||
// Copyright (c) Webtide LLC
|
||||
//
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0.txt
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-jmx-parent</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jmx-webapp-it</artifactId>
|
||||
|
@ -31,17 +14,18 @@
|
|||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<bundle-symbolic-name>${project.groupId}.jmx.webapp.it</bundle-symbolic-name>
|
||||
<scripts-dir>${project.basedir}/src/test/scripts</scripts-dir>
|
||||
<test-base-dir>${project.build.directory}/test-base</test-base-dir>
|
||||
<test-home-dir>${project.build.directory}/test-home</test-home-dir>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-distribution</artifactId>
|
||||
<artifactId>jetty-annotations</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-jmx</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>zip</type>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
|
@ -72,136 +56,14 @@
|
|||
<includeArtifactIds>jmx-webapp</includeArtifactIds>
|
||||
<includeScope>runtime</includeScope>
|
||||
<includeTypes>war</includeTypes>
|
||||
<overwriteSnapshots>true</overwriteSnapshots>
|
||||
<overwriteReleases>true</overwriteReleases>
|
||||
<overWriteSnapshots>true</overWriteSnapshots>
|
||||
<overWriteReleases>true</overWriteReleases>
|
||||
<stripVersion>true</stripVersion>
|
||||
<outputDirectory>${test-base-dir}/webapps</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>unpack-jetty-distro</id>
|
||||
<phase>process-test-resources</phase>
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeArtifactIds>jetty-distribution</includeArtifactIds>
|
||||
<includeScope>runtime</includeScope>
|
||||
<includeTypes>zip</includeTypes>
|
||||
<outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
|
||||
<outputDirectory>${test-home-dir}</outputDirectory>
|
||||
<overWriteSnapshots>true</overWriteSnapshots>
|
||||
<overWriteIfNewer>true</overWriteIfNewer>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>2.17</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>integration-test</goal>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>1.7</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>start-jetty</id>
|
||||
<phase>pre-integration-test</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<property name="jetty.jmx.home" location="${test-home-dir}/jetty-distribution-${project.version}" />
|
||||
<property name="jetty.jmx.base" location="${test-base-dir}" />
|
||||
<echo>Integration Test : Setup Jetty</echo>
|
||||
<exec executable="${run.command}" dir="${scripts-dir}" spawn="false">
|
||||
<arg value="${run.command.xtra}" />
|
||||
<arg value="${setup.script}" />
|
||||
<arg file="${java.home}" />
|
||||
<arg file="${jetty.jmx.home}" />
|
||||
<arg file="${jetty.jmx.base}" />
|
||||
</exec>
|
||||
|
||||
<echo>Integration Test : Starting Jetty ...</echo>
|
||||
<exec executable="${run.command}" dir="${scripts-dir}" spawn="true">
|
||||
<arg value="${run.command.xtra}" />
|
||||
<arg value="${start.script}" />
|
||||
<arg file="${java.home}" />
|
||||
<arg file="${jetty.jmx.home}" />
|
||||
<arg file="${jetty.jmx.base}" />
|
||||
</exec>
|
||||
<waitfor maxwait="5" maxwaitunit="second" checkevery="500" checkeveryunit="millisecond">
|
||||
<http url="http://localhost:58080/jmx-webapp/" />
|
||||
</waitfor>
|
||||
<echo>Integration Test : Jetty is now available</echo>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>stop-jetty</id>
|
||||
<phase>post-integration-test</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<property name="jetty.jmx.home" location="${test-home-dir}/jetty-distribution-${project.version}" />
|
||||
<property name="jetty.jmx.base" location="${test-base-dir}" />
|
||||
<echo>Integration Test : Stop Jetty</echo>
|
||||
<exec executable="${run.command}" dir="${scripts-dir}" spawn="false">
|
||||
<arg value="${run.command.xtra}" />
|
||||
<arg value="${stop.script}" />
|
||||
<arg file="${java.home}" />
|
||||
<arg file="${jetty.jmx.home}" />
|
||||
<arg file="${jetty.jmx.base}" />
|
||||
</exec>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>it-windows</id>
|
||||
<activation>
|
||||
<os>
|
||||
<family>Windows</family>
|
||||
</os>
|
||||
</activation>
|
||||
<properties>
|
||||
<run.command>cmd</run.command>
|
||||
<run.command.xtra>/c</run.command.xtra>
|
||||
<start.script>start-jetty.bat</start.script>
|
||||
<stop.script>stop-jetty.bat</stop.script>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>it-unix</id>
|
||||
<activation>
|
||||
<os>
|
||||
<family>unix</family>
|
||||
</os>
|
||||
</activation>
|
||||
<properties>
|
||||
<run.command>sh</run.command>
|
||||
<run.command.xtra>--</run.command.xtra>
|
||||
<setup.script>setup-jetty.sh</setup.script>
|
||||
<start.script>start-jetty.sh</start.script>
|
||||
<stop.script>stop-jetty.sh</stop.script>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
|
|
@ -1,27 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
// ========================================================================
|
||||
// Copyright (c) Webtide LLC
|
||||
//
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0.txt
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-jmx-parent</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>jmx-webapp</artifactId>
|
||||
<packaging>war</packaging>
|
||||
|
@ -54,12 +37,6 @@
|
|||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<configuration>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -1,26 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
// ========================================================================
|
||||
// Copyright (c) Webtide LLC
|
||||
//
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0.txt
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>tests-parent</artifactId>
|
||||
<version>9.2.23-SNAPSHOT</version>
|
||||
<version>9.4.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>test-jmx-parent</artifactId>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue