commit | a853a2fc6d06ad393071b3df48bbfc8d9a01ebec | [log] [tgz] |
---|---|---|
author | Steve Lawrence <slawrence@apache.org> | Tue Apr 23 09:14:51 2024 -0400 |
committer | Steve Lawrence <slawrence@apache.org> | Tue Apr 23 10:57:12 2024 -0400 |
tree | 986def2e4280786aa50cad337f0e2434692b52e2 | |
parent | d0bb41c2ded3c67a2b77970d8a9232eb688cfd77 [diff] |
Add support for nested jars Daffodil supports resolving schemaLocations relative to a jar URI, which only looks for the schemaLocation in that same jar. Such jar URI's usually look like this: jar:file:/path/to/some.jar!/path/to/schema.dfdl.xsd To resolve a path relative to this, we split this into its components: a jar part and the resource path part inside that jar and resolve the schemaLocation relative to the path part. Although Java does not support loading resources within nested jars, tools like Spring Boot have added such support. This can result in jar URIs that look like this: jar:file:/path/to/outer.jar!/path/to/inner.jar!/path/to/schema.dfdl.xsd This breaks our current code because we expect there to only be two components, but we end up with three because of the multiple exclamation points. To fix this and to support nested jars, this changes the logic to only split on the last exclamation point. Everything before that is considered the jar component and everything after is considered the path component in that jar, which could be a nested jar. We then resolve relative paths to this path component as usual and look for the result to be in that same jar component. DAFFODIL-2892
Apache Daffodil is an open-source implementation of the DFDL specification that uses DFDL data descriptions to parse fixed format data into an infoset. This infoset is commonly converted into XML or JSON to enable the use of well-established XML or JSON technologies and libraries to consume, inspect, and manipulate fixed format data in existing solutions. Daffodil is also capable of serializing or “unparsing” data back to the original data format. The DFDL infoset can also be converted directly to/from the data structures carried by data processing frameworks so as to bypass any XML/JSON overheads.
For more information about Daffodil, see https://daffodil.apache.org/.
See BUILD.md for more details and DEVELOP.md for a developer guide.
sbt is the officially supported tool to build Daffodil. Below are some of the more commonly used commands for Daffodil development.
Compile source code:
sbt compile
Check all unit tests pass:
sbt test
Check all integration tests pass:
sbt daffodil-test-integration/test
Check format of source and sbt files:
sbt scalafmtCheckAll scalafmtSbtCheck
Reformat source and sbt files if necessary:
sbt scalafmtAll scalafmtSbt
Build the Daffodil command line interface (Linux and Windows shell scripts in daffodil-cli/target/universal/stage/bin/
; see the Command Line Interface documentation for details on their usage):
sbt daffodil-cli/stage
Publish the Daffodil jars to a Maven repository (for Java projects) or Ivy repository (for Scala or schema projects).
Maven (for Java or mvn):
sbt publishM2
Ivy (for Scala or sbt):
sbt publishLocal
Run Apache RAT (license audit report in target/rat.txt
and error if any unapproved licenses are found):
sbt ratCheck
Run sbt-scoverage (report in target/scala-ver/scoverage-report/
):
sbt clean coverage test daffodil-test-integration/test sbt coverageAggregate
You can ask questions on the dev@daffodil.apache.org or users@daffodil.apache.org mailing lists. You can report bugs via the Daffodil JIRA.
Apache Daffodil is licensed under the Apache License, v2.0.