Commit Graph

142 Commits

Author SHA1 Message Date
Ludovic Orban cb348c8d15 rename of() -> combine()
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 13:06:32 +02:00
Ludovic Orban fb0290c88a replace ROOT references with root()
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 12:51:57 +02:00
Ludovic Orban b3dbfad97d move newSystemResource to ResourceFactory
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 12:43:08 +02:00
Ludovic Orban f943d095f4 rework ResourceFactory and Resource according to redux3 prototype
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-03 11:32:21 +02:00
Joakim Erdfelt 4e4d516952
Fixing compilation 2022-08-02 16:07:39 -05:00
Joakim Erdfelt e848dd0852
Fixing missing XML entities
+ Adding missing core XML entities
  to jetty-xml project
  * datatypes.dtd
  * xml.xsd
  * XMLSchema.dtd
+ registering core XML entities
  in XmlParser itself
+ adding new tests
+ Descriptor now catches SAXException
+ WebDescriptor doesn't worry about
  core XML entities
2022-08-01 21:48:09 -05:00
Joakim Erdfelt 84f6dc7f4c
Review of Resource throwables 2022-08-01 21:48:08 -05:00
Joakim Erdfelt e1ebef2ca6
Changing contract of Resource.resolve(String)
No longer throws IOException
2022-08-01 21:48:07 -05:00
Joakim Erdfelt 98fa52ef30
Updating FileID.isTld(Path) 2022-08-01 21:48:07 -05:00
Joakim Erdfelt dd7dda2c53
Move FileID from deploy to util
+ Move static methods from other
  places to FileID or URIUtil
  - MultiReleaseJarFile
  - Resource
  - MetaInfConfiguration
+ Improve testing of URIUtil and FileID
2022-08-01 21:48:00 -05:00
Joakim Erdfelt caff1b036b
Jetty 12 - Cleanup MultiReleaseJarFile to use newFileSystem behaviors built into JVM (#8328)
* Cleanup MultiReleaseJarFile to use newFileSystem behaviors built into JVM
* Adding more testing to MultiReleaseJarFile
* Updating AnnotationParser and MetaInfConfiguration
* Created URIUtil.streamOf(URLClassLoader) to aid
  in proper conversion of URLClassLoader.toURLs to URIs
* Introduce URIUtil.fixBadJavaIoFileUrl
  Addresses bad java.io.File.toURL().toURI() issues
  file:/path to file:///path
* Better URI pool/key behaviors in FileSystemPool
* no arg AnnotationParser uses ASM_VERSION
2022-07-29 10:08:32 -05:00
Joakim Erdfelt c6c0eb0313
Jetty-12 : Immutable ResourceCollection and Context based mount management (#8337)
* Immutable ResourceCollection with mount management.

* Internal List<Resource> is now immutable so that .getResources() cannot be modified.
* Improved Resource.toJarFileUri implementation that keeps the deep archive references
* Introducing Resource.mountCollection() methods
  + ResourceCollection is now a private class
  + Resource.mountCollection() returns a Mount
  + Places that use this technique are now putting the Mount in the context's beans for the context to close those mounts.
* Cleanup names/comments in FileSystemResourceTest
* Adding missing test of attempting to create a Resource from a URI `jar:file:foo.jar!/` while not mounted.
* Reworked ResourceCollection behaviors based on feedback.
  + Eliminated all Resource.mountCollection() methods except the Collection<URI> one.
* Eliminated Resource.mountIfNeeded(Resource)
* Eliminated Resource.fromList implementations
* Introduced @gregw Resource.of() implementations
* Introduced Resource.split() to honor old split logic from Jetty 9/10/11, with glob support, but now it only converts to List<URI>
* Remove IOException from Mount.root() method
* ResourceCollection now flattens and uniques any nested ResourceCollection entries it encounters
* Expanded ResourceCollectionTest to cover more code paths
* Add ResourceTest for new split() method
* Fixing testcase to use a directory that exists on setExtraClasspath
* Increase reliability of WebAppContextTests
* Updates for working with webapp.extraClasspath
* Introduced Resource.unwrapContainer to help in servlet cases where the raw JAR path should be represented in a ServletContext attribute.
* Made FileSystemPool.containerUri just use new Resource.unwrapContainer
* webapp MetaData updated to use URIs references to Libs (not File objects)
* jetty-ee#-maven-plugin use URIs for its classpath tracking to aid in mounting issues later
* webapp extraClasspath supports raw JAR references as well as glob now, supported by Resource.split(String)
2022-07-28 08:59:17 -05:00
Ludovic Orban b1d5f908a6 fix mounting/unmounting lifecycle of TLD resources
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-07-28 10:16:02 +02:00
Ludovic Orban 905352816d make sure TLD file actually is a file
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-07-28 10:16:02 +02:00
Ludovic Orban a84a86d820 handle review comments
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-07-28 10:16:02 +02:00
Ludovic Orban 9f0463b545 remove old Resource defaultUseCache mechanism
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-07-28 10:16:02 +02:00
Ludovic Orban 0c0c333970 get rid of EmptyResource
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-07-27 16:04:22 +02:00
Ludovic Orban 4856a7d065 keep, un-deprecate and rename Resource.getReadableByteChannel() and Resource.getInputStream()
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-07-27 16:04:22 +02:00
Greg Wilkins 2275e1c2c6
Refactored MultiException into ExceptionUtil (#8340) 2022-07-27 18:07:57 +10:00
Greg Wilkins 9b1cb302b6
Cleanup Resource.Mount (#8284)
* Introduced the `mountIfNeeded` method to cleanup mount code and reduce checks for "jar:"
 * Fixed Quickstart mounting close.
 * Improved error message
 * Fixed tests for mount cleanup
 * More forgiving newResource(URI) implementation
 * Even more forgiving newResource(URI) implementation
2022-07-13 09:25:14 +10:00
Ludovic Orban 23a0203547 rework Resource API (#8106)
* remove Resource.getFile() and replace its usages with Resource.getPath()
* remove all public PathResource ctors + add non-leaky FS mounting mechanism + interpret string as Path when not a schemed URI
* rename Resource.getResource to Resource.resolve, specifying that the subpath is URI-path-interpreted
* remove useless API methods + deprecate all path-related API
* make subpaths beginning with / resolved as relative to the given uri
* introduce filesystem pooling and generalize resource resolving code
* remove URLResource
* remove unneeded factory method
* both file: and jrt: should not be pooled
* move deprecated impls from PathResource down to Resource + fix some tests
* handle Resource's pointing to non-existent jar files
* Force Resource URIs to end with "/" when the resource is a directory
* Produce warning if attempting to release a mounted filesystem uri that doesn't exist in the pool.

Co-authored-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2022-07-12 10:10:30 +10:00
Jan Bartel 8f853f7fb6 Fix pattern to scan for container jars to match servlet api 2022-07-05 11:03:51 +10:00
Greg Wilkins 8ecb4b8669 Fixed merge 2022-07-04 12:34:53 +10:00
Greg Wilkins e8f09cb3e0 restored ee10 test
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2022-07-04 11:43:02 +10:00
Greg Wilkins fd5ae09449 move ee10 test back to ee9
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2022-07-04 11:38:22 +10:00
Greg Wilkins fe83ea87dc Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-07-04 11:32:33 +10:00
Greg Wilkins ea5bedf072
Jetty 12.0.x deployment (#8208)
Deploy webapps for different environments from the same webapps directory.
The maximal environment known to the AppProviders is used as the default environment.
An explicit environment can be set in a properties file for an application, which is also used for property substitution in any context xml file.
2022-06-30 09:51:19 +10:00
Jan Bartel 5c267ce7ed
Jetty 12.0.x eex jettymavenplugin (#8200)
* Fix ee9/10 jetty maven plugin and refactor it tests
2022-06-29 17:18:18 +10:00
Jan Bartel bfaf0facb5 Reenable ee10 MetaInfConfigurationTest. 2022-06-28 14:09:49 +10:00
Jan Bartel f8ae3837c4 Fix resourceBase in MetaInfConfiguration; fix typo in ee10-demo-jetty.xml 2022-06-06 11:32:36 +10:00
Jan Bartel 3b99c8c4e7 WebAppContext and ServletContextHandler must share ServletApiContext instance. 2022-06-01 16:26:36 +10:00
Jan Bartel d69202f3d8 Fix ee10 jsp module 2022-05-31 11:20:24 +10:00
Jan Bartel 43c662a3ac Fix more ee10 modules. 2022-05-30 18:50:23 +10:00
Jan Bartel eea3a11dd7 WIP deploy ee10 and ee9 webapps. 2022-05-25 17:35:52 +10:00
Greg Wilkins 8677f5fac5 Jetty-12 Deploy
Cleanup dump and environment invocation
2022-05-21 09:56:01 +10:00
Greg Wilkins 315600184d Jetty-12 Deploy
hacky fix to dumping attributes
2022-05-20 17:25:21 +10:00
Greg Wilkins 22c1a2e901 Fixed webdefault-eeX.xml references 2022-05-13 10:16:06 +02:00
Simone Bordet bfcd7845eb
Fixed references to webdefault.xml that now are webdefault-ee9.xml and webdefault-ee10.xml.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-05-12 17:01:42 +02:00
Greg Wilkins f90e73ddb5 WIP deploying webapps 2022-05-10 00:02:06 +02:00
Greg Wilkins 85af234ed6 WIP for deployer 2022-05-04 19:41:38 +02:00
Greg Wilkins 428a9d568f Reverted to use Resource as BaseResource 2022-05-03 19:28:53 +02:00
Greg Wilkins 0a32147e89 Jetty-12 Restructure
Copied ee10 from hackathon branch

Co-authored-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim@webtide.com>
Co-authored-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: Ludovic Orban <lorban@webtide.com>
Co-authored-by: Olivier Lamy <olamy@webtide.com>
Co-authored-by: Simone Bordet <sbordet@webtide.com>
2022-05-03 15:52:44 +02:00