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 Details

  • Constructor Details

  • Method Details

    • copyFiles

      protected static void copyFiles(ApplicationArchive archive, ArchiveCreator archiveCreator, Map<String,List<byte[]>> services, Predicate<String> ignoredEntriesPredicate) throws IOException
      Copy files from archive to fs, filtering out service providers into the given map.
      Parameters:
      archive - the root application archive
      archiveCreator - the archive creator
      services - 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, 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:
      true if the dependency should be included, false otherwise.
    • suffixToClassifier

      protected static String suffixToClassifier(String suffix)
    • toUri

      protected static String toUri(Path path)