@Retention(value=RUNTIME) @Target(value=METHOD) public @interface BuildStep
Build steps are run concurrently at augmentation time to augment the application. They use a producer/consumer model, where a step is guaranteed not to be run until all items that it is consuming have been created.
Producing and consuming is done via injection. This can be done via field injection, method parameter injection, or constructor parameter injection.
The following types are eligible for injection into a build step:
SimpleBuildItemList of any concrete subclass of MultiBuildItemConsumer of any concrete subclass of BuildItemSupplier of any concrete subclass of SimpleBuildItemOptional instances whose value type is a subclass of SimpleBuildItemRecorder (method parameters only, if the method is annotated
Record)BytecodeRecorderImpl (method parameters only, if the method is annotated Record)SimpleBuildItem or a List of MultiBuildItem makes this step a consumer of
these items, and as such will not be run until all producers of the relevant items has been run.
Injecting a BuildProducer makes this class a producer of this item. Alternatively items can be produced
by simply returning them from the method.
If field injection is used then every BuildStep method on the class will be a producer/consumer of these
items, while method parameter injection is specific to an individual build step. In general method parameter injection
should be the preferred approach as it is more fine grained.
Note that a BuildStep will only be run if there is a consumer for items it produces. If nothing is
interested in the produced item then it will not be run. A consequence of this is that it must be capable of producing
at least one item (it does not actually have to produce anything, but it must have the ability to). A build step that
cannot produce anything will never be run.
BuildItem instances must be immutable, as the producer/consumer model does not allow for mutating
artifacts. Injecting a build item and modifying it is a bug waiting to happen, as this operation would not be accounted
for in the dependency graph.
Record| Modifier and Type | Optional Element and Description |
|---|---|
String[] |
applicationArchiveMarkers
Deprecated.
|
boolean |
loadsApplicationClasses
Deprecated.
|
Class<? extends BooleanSupplier>[] |
onlyIf
Only include this build step if the given supplier class(es) return
true. |
Class<? extends BooleanSupplier>[] |
onlyIfNot
Only include this build step if the given supplier class(es) return
false. |
String[] |
providesCapabilities
Deprecated.
|
@Deprecated public abstract String[] providesCapabilities
CapabilityBuildItem should just be produced
directly instead.
This method will be removed at some point post Quarkus 1.1.@Deprecated public abstract String[] applicationArchiveMarkers
AdditionalApplicationArchiveMarkerBuildItem
should just be produced directly instead.
This method will be removed at some point post Quarkus 1.1.public abstract Class<? extends BooleanSupplier>[] onlyIf
true.public abstract Class<? extends BooleanSupplier>[] onlyIfNot
false.@Deprecated public abstract boolean loadsApplicationClasses
Copyright © 2021 JBoss by Red Hat. All rights reserved.