Move appendix subsections under appendix section

This involved a small code change to the generated configuration
properties snippets. The section id has to start with
'appendix.', otherwise the section-id asciidoctor extension
complains. To ensure that the anchors that are derived from the
section IDs remain backwards compatible, the anchor-rewrite
properties have been updated.

See gh-29667
This commit is contained in:
Moritz Halbritter
2022-02-07 11:09:53 +01:00
committed by Andy Wilkinson
parent 48fe1513fe
commit 52d9ba58d8
38 changed files with 237 additions and 166 deletions

View File

@@ -1,4 +1,4 @@
[[executable-jar.alternatives]]
[[appendix.executable-jar.alternatives]]
== Alternative Single Jar Solutions
If the preceding restrictions mean that you cannot use Spring Boot Loader, consider the following alternatives:

View File

@@ -1,4 +1,4 @@
[[executable-jar.jarfile-class]]
[[appendix.executable-jar.jarfile-class]]
== Spring Boot's "`JarFile`" Class
The core class used to support loading nested jars is `org.springframework.boot.loader.jar.JarFile`.
It lets you load jar content from a standard jar file or from nested child jar data.
@@ -25,7 +25,7 @@ We do not need to unpack the archive, and we do not need to read all entry data
[[executable-jar.jarfile-class.compatibility]]
[[appendix.executable-jar.jarfile-class.compatibility]]
=== Compatibility with the Standard Java "`JarFile`"
Spring Boot Loader strives to remain compatible with existing code and libraries.
`org.springframework.boot.loader.jar.JarFile` extends from `java.util.jar.JarFile` and should work as a drop-in replacement.

View File

@@ -1,4 +1,4 @@
[[executable-jar.launching]]
[[appendix.executable-jar.launching]]
== Launching Executable Jars
The `org.springframework.boot.loader.Launcher` class is a special bootstrap class that is used as an executable jar's main entry point.
It is the actual `Main-Class` in your jar file, and it is used to setup an appropriate `URLClassLoader` and ultimately call your `main()` method.
@@ -13,7 +13,7 @@ You can add additional locations by setting an environment variable called `LOAD
[[executable-jar.launching.manifest]]
[[appendix.executable-jar.launching.manifest]]
=== Launcher Manifest
You need to specify an appropriate `Launcher` as the `Main-Class` attribute of `META-INF/MANIFEST.MF`.
The actual class that you want to launch (that is, the class that contains a `main` method) should be specified in the `Start-Class` attribute.

View File

@@ -1,4 +1,4 @@
[[executable-jar.nested-jars]]
[[appendix.executable-jar.nested-jars]]
== Nested JARs
Java does not provide any standard way to load nested jar files (that is, jar files that are themselves contained within a jar).
This can be problematic if you need to distribute a self-contained application that can be run from the command line without unpacking.
@@ -11,7 +11,7 @@ Spring Boot takes a different approach and lets you actually nest jars directly.
[[executable-jar.nested-jars.jar-structure]]
[[appendix.executable-jar.nested-jars.jar-structure]]
=== The Executable Jar File Structure
Spring Boot Loader-compatible jar files should be structured in the following way:
@@ -41,7 +41,7 @@ Dependencies should be placed in a nested `BOOT-INF/lib` directory.
[[executable-jar.nested-jars.war-structure]]
[[appendix.executable-jar.nested-jars.war-structure]]
=== The Executable War File Structure
Spring Boot Loader-compatible war files should be structured in the following way:
@@ -75,7 +75,7 @@ Any dependencies that are required when running embedded but are not required wh
[[executable-jar.nested-jars.index-files]]
[[appendix.executable-jar.nested-jars.index-files]]
=== Index Files
Spring Boot Loader-compatible jar and war archives can include additional index files under the `BOOT-INF/` directory.
A `classpath.idx` file can be provided for both jars and wars, and it provides the ordering that jars should be added to the classpath.
@@ -86,7 +86,7 @@ These files, however, are _not_ parsed internally as YAML and they must be writt
[[executable-jar.nested-jars.classpath-index]]
[[appendix.executable-jar.nested-jars.classpath-index]]
=== Classpath Index
The classpath index file can be provided in `BOOT-INF/classpath.idx`.
It provides a list of jar names (including the directory) in the order that they should be added to the classpath.
@@ -118,7 +118,7 @@ The index file would look like this:
[[executable-jar.nested-jars.layer-index]]
[[appendix.executable-jar.nested-jars.layer-index]]
=== Layer Index
The layers index file can be provided in `BOOT-INF/layers.idx`.
It provides a list of layers and the parts of the jar that should be contained within them.

View File

@@ -1,4 +1,4 @@
[[executable-jar.property-launcher]]
[[appendix.executable-jar.property-launcher]]
== PropertiesLauncher Features
`PropertiesLauncher` has a few special features that can be enabled with external properties (System properties, environment variables, manifest entries, or `loader.properties`).
The following table describes these properties:

View File

@@ -1,10 +1,10 @@
[[executable-jar.restrictions]]
[[appendix.executable-jar.restrictions]]
== Executable Jar Restrictions
You need to consider the following restrictions when working with a Spring Boot Loader packaged application:
[[executable-jar-zip-entry-compression]]
[[appendix.executable-jar-zip-entry-compression]]
* Zip entry compression:
The `ZipEntry` for a nested jar must be saved by using the `ZipEntry.STORED` method.
This is required so that we can seek directly to individual content within the nested jar.
@@ -12,7 +12,7 @@ The content of the nested jar file itself can still be compressed, as can any ot
[[executable-jar-system-classloader]]
[[appendix.executable-jar-system-classloader]]
* System classLoader:
Launched applications should use `Thread.getContextClassLoader()` when loading classes (most libraries and frameworks do so by default).
Trying to load nested jar classes with `ClassLoader.getSystemClassLoader()` fails.