Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 6. Using a BOM
To explicitly specify the Thorntail fractions your application uses, instead of relying on auto-detection, Thorntail includes a set of BOMs (bill of materials) which you can use instead of having to track and update Maven artifact versions in several places.
6.1. Thorntail product BOM types Copier lienLien copié sur presse-papiers!
Thorntail is described as just enough app-server, which means it consists of multiple pieces. Your application includes only the pieces it needs.
When using the Thorntail product, you can specify the following Maven BOMs:
- bom
- All fractions available in the product.
- bom-certified
-
All community fractions that have been certified against the product. Any fraction used from
bom-certifiedis unsupported.
6.2. Specifying a BOM for in your application Copier lienLien copié sur presse-papiers!
Importing a specific BOM in the pom.xml file in your application allows you to track all your application dependencies in one place.
One shortcoming of importing a Maven BOM import is that it does not handle the configuration on the level of <pluginManagement>. When you use the Thorntail Maven Plugin, you must specify the version of the plugin to use.
Thanks to the property you use in your pom.xml file, you can easily ensure that your plugin usage matches the release of Thorntail that you are targeting with the BOM import.
Prerequisites
-
Your application as a Maven-based project with a
pom.xmlfile.
Procedure
Include a
bomartifact in yourpom.xml.Tracking the current version of Thorntail through a property in your
pom.xmlis recommended.<properties> <version.thorntail>{version}</version.thorntail> </properties><properties> <version.thorntail>{version}</version.thorntail> </properties>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Import BOMs in the
<dependencyManagement>section. Specify the<type>pom</type>and<scope>import</scope>.Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the example above, the
bomartifact is imported to ensure that only stable fractions are available.By including the BOMs of your choice in the
<dependencyManagement>section, you have:- Provided version-management for any Thorntail artifacts you subsequently choose to use.
-
Provided support to your IDE for auto-completing known artifacts when you edit your the
pom.xmlfile of your application.
Include Thorntail dependencies.
Even though you imported the Thorntail BOMs in the
<dependencyManagement>section, your application still has no dependencies on Thorntail artifacts.To include Thorntail artifact dependencies based on the capabilities your application, enter the relevant artifacts as
<dependency>elements:NoteYou do not have to specify the version of the artifacts because the BOM imported in
<dependencyManagement>handles that.Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the example above, we include explicit dependencies on the
jaxrsanddatasourcesfractions, which will provide transitive inclusion of others, for exampleundertow.