Package io.quarkus.deployment.pkg.jar
Class AbstractJarBuilder<T extends io.quarkus.builder.item.BuildItem>
java.lang.Object
io.quarkus.deployment.pkg.jar.AbstractJarBuilder<T>
- All Implemented Interfaces:
JarBuilder<T>
- Direct Known Subclasses:
AbstractFastJarBuilder,AbstractLegacyThinJarBuilder,UberJarBuilder
public abstract class AbstractJarBuilder<T extends io.quarkus.builder.item.BuildItem>
extends Object
implements JarBuilder<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ApplicationArchivesBuildItemprotected final ApplicationInfoBuildItemprotected final CurateOutcomeBuildItemprotected final ExecutorServiceprotected final List<GeneratedClassBuildItem> protected final List<GeneratedResourceBuildItem> protected final List<GeneratedServiceProviderBuildItem> protected final ResolvedJVMRequirementsprotected final MainClassBuildItemprotected final OutputTargetBuildItemprotected final PackageConfigprotected final Set<io.quarkus.maven.dependency.ArtifactKey> protected final TransformedClassesBuildItemFields inherited from interface io.quarkus.deployment.pkg.jar.JarBuilder
DOT_JAR -
Constructor Summary
ConstructorsConstructorDescriptionAbstractJarBuilder(CurateOutcomeBuildItem curateOutcome, OutputTargetBuildItem outputTarget, ApplicationInfoBuildItem applicationInfo, PackageConfig packageConfig, MainClassBuildItem mainClass, ApplicationArchivesBuildItem applicationArchives, TransformedClassesBuildItem transformedClasses, List<GeneratedClassBuildItem> generatedClasses, List<GeneratedResourceBuildItem> generatedResources, List<GeneratedServiceProviderBuildItem> generatedServiceProviders, Set<io.quarkus.maven.dependency.ArtifactKey> removedArtifactKeys, ExecutorService executorService, ResolvedJVMRequirements jvmRequirements) -
Method Summary
Modifier and TypeMethodDescriptionprotected static ManifestattachRunnerMetadata(Manifest manifest, String mainClassName, String classPath, ResolvedJVMRequirements jvmRequirements) protected voidcopyApplicationContent(ArchiveCreator archiveCreator, Map<String, List<byte[]>> concatenatedEntries, Predicate<String> ignoredEntriesPredicate) Copy application content to the archive.protected static voidcopyFiles(ApplicationArchive archive, ArchiveCreator archiveCreator, Map<String, List<byte[]>> services, Predicate<String> ignoredEntriesPredicate) Copy files fromarchivetofs, filtering out service providers into the given map.protected static ManifestcreateManifest(PackageConfig config, io.quarkus.maven.dependency.ResolvedDependency appArtifact, ApplicationInfoBuildItem applicationInfo) protected static booleanincludeAppDependency(io.quarkus.maven.dependency.ResolvedDependency appDep, Optional<Set<io.quarkus.maven.dependency.ArtifactKey>> optionalDependencies, Set<io.quarkus.maven.dependency.ArtifactKey> removedArtifacts) Indicates whether the given dependency should be included or not.protected static StringsuffixToClassifier(String suffix) protected static Stringprotected static voidwriteConcatenatedEntries(ArchiveCreator archiveCreator, Map<String, List<byte[]>> concatenatedEntries) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.quarkus.deployment.pkg.jar.JarBuilder
build
-
Field Details
-
curateOutcome
-
outputTarget
-
applicationInfo
-
packageConfig
-
mainClass
-
applicationArchives
-
transformedClasses
-
generatedClasses
-
generatedResources
-
generatedServiceProviders
-
removedArtifactKeys
-
executorService
-
jvmRequirements
-
-
Constructor Details
-
AbstractJarBuilder
public AbstractJarBuilder(CurateOutcomeBuildItem curateOutcome, OutputTargetBuildItem outputTarget, ApplicationInfoBuildItem applicationInfo, PackageConfig packageConfig, MainClassBuildItem mainClass, ApplicationArchivesBuildItem applicationArchives, TransformedClassesBuildItem transformedClasses, List<GeneratedClassBuildItem> generatedClasses, List<GeneratedResourceBuildItem> generatedResources, List<GeneratedServiceProviderBuildItem> generatedServiceProviders, Set<io.quarkus.maven.dependency.ArtifactKey> removedArtifactKeys, ExecutorService executorService, ResolvedJVMRequirements jvmRequirements)
-
-
Method Details
-
copyFiles
protected static void copyFiles(ApplicationArchive archive, ArchiveCreator archiveCreator, Map<String, List<byte[]>> services, Predicate<String> ignoredEntriesPredicate) throws IOExceptionCopy files fromarchivetofs, filtering out service providers into the given map.- Parameters:
archive- the root application archivearchiveCreator- the archive creatorservices- the services map- Throws:
IOException- if an error occurs
-
copyApplicationContent
protected void copyApplicationContent(ArchiveCreator archiveCreator, Map<String, List<byte[]>> concatenatedEntries, Predicate<String> ignoredEntriesPredicate) throws IOExceptionCopy application content to the archive.The order of operations is important here: higher priority content is added first so that it takes precedence over lower priority content (first-write-wins in the archive creator).
Note: concatenated entries (services, etc.) are collected into a map but NOT written to the archive. Callers are responsible for writing them after all sources have been collected (see
writeConcatenatedEntries(ArchiveCreator, Map)).- Throws:
IOException
-
writeConcatenatedEntries
protected static void writeConcatenatedEntries(ArchiveCreator archiveCreator, Map<String, List<byte[]>> concatenatedEntries) throws IOException- Throws:
IOException
-
createManifest
protected static Manifest createManifest(PackageConfig config, io.quarkus.maven.dependency.ResolvedDependency appArtifact, ApplicationInfoBuildItem applicationInfo) -
attachRunnerMetadata
protected static Manifest attachRunnerMetadata(Manifest manifest, String mainClassName, String classPath, ResolvedJVMRequirements jvmRequirements) -
includeAppDependency
protected static boolean includeAppDependency(io.quarkus.maven.dependency.ResolvedDependency appDep, Optional<Set<io.quarkus.maven.dependency.ArtifactKey>> optionalDependencies, Set<io.quarkus.maven.dependency.ArtifactKey> removedArtifacts) Indicates whether the given dependency should be included or not.A dependency should be included if it is a jar file and:
- The dependency is not optional or
- The dependency is part of the optional dependencies to include or
- The optional dependencies to include are absent
- Parameters:
appDep- the dependency to test.optionalDependencies- the optional dependencies to include into the final package.- Returns:
trueif the dependency should be included,falseotherwise.
-
suffixToClassifier
-
toUri
-