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:
AbstractLegacyThinJarBuilder,FastJarBuilder,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 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, Set<io.quarkus.maven.dependency.ArtifactKey> removedArtifactKeys, ExecutorService executorService, ResolvedJVMRequirements jvmRequirements) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcopyCommonContent(ArchiveCreator archiveCreator, Map<String, List<byte[]>> concatenatedEntries, Predicate<String> ignoredEntriesPredicate) 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 voidgenerateManifest(ArchiveCreator archiveCreator, String classPath, PackageConfig config, io.quarkus.maven.dependency.ResolvedDependency appArtifact, ResolvedJVMRequirements jvmRequirements, String mainClassName, ApplicationInfoBuildItem applicationInfo) Manifest generation is quite simple : we just have to push some attributes in manifest.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 StringMethods 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
-
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, 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
-
copyCommonContent
protected void copyCommonContent(ArchiveCreator archiveCreator, Map<String, List<byte[]>> concatenatedEntries, Predicate<String> ignoredEntriesPredicate) throws IOException- Throws:
IOException
-
generateManifest
protected static void generateManifest(ArchiveCreator archiveCreator, String classPath, PackageConfig config, io.quarkus.maven.dependency.ResolvedDependency appArtifact, ResolvedJVMRequirements jvmRequirements, String mainClassName, ApplicationInfoBuildItem applicationInfo) throws IOException Manifest generation is quite simple : we just have to push some attributes in manifest. However, it gets a little more complex if the manifest preexists. So we first try to see if a manifest exists, and otherwise create a new one. BEWARE this method should be invoked after file copy from target/classes and so on. Otherwise, this manifest manipulation will be useless.- Throws:
IOException
-
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
-