Class Jar

  • All Implemented Interfaces:
    IVilType

    public class Jar
    extends java.lang.Object
    implements IVilType
    Creates JAR files.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • Jar

        public Jar()
    • Method Detail

      • jar

        public static Set<FileArtifact> jar​(Path base,
                                            Collection<FileArtifact> artifacts,
                                            Path jar)
                                     throws VilException
        Packs source files into target. Manifest files is assumed to be the default (empty) one.
        Parameters:
        base - the base path used to make the paths of the artifacts relative, may be the source or target project
        artifacts - the artifacts to be handled
        jar - the target jar file
        Returns:
        the created artifacts
        Throws:
        VilException - in case that processing the JAR file fails for some reason
      • jar

        public static Set<FileArtifact> jar​(Path base,
                                            Collection<FileArtifact> artifacts,
                                            Path jar,
                                            Path manifest)
                                     throws VilException
        Packs source files into target.
        Parameters:
        base - the base path used to make the paths of the artifacts relative, may be the source or target project
        artifacts - the artifacts to be handled
        jar - the target jar file
        manifest - the manifest file
        Returns:
        the created artifacts
        Throws:
        VilException - in case that processing the JAR file fails for some reason
      • jar

        public static Set<FileArtifact> jar​(Path base,
                                            Path artifacts,
                                            Path jar,
                                            Path manifest)
                                     throws VilException
        Packs source files into target.
        Parameters:
        base - the base path used to make the paths of the artifacts relative, may be the source or target project
        artifacts - the artifacts to be handled
        jar - the target jar file
        manifest - the manifest file (may be null, default)
        Returns:
        the created artifacts
        Throws:
        VilException - in case that processing the JAR file fails for some reason
      • createJarHandler

        private static JarHandler createJarHandler​(Path manifest)
        Creates the JarHandler for creating a new JAR archive.
        Parameters:
        manifest - A path for a manifest file which shall be included in the jar. Maybe null, than a default manifest file will be created.
        Returns:
        A JarHandler which will use the given manifest file or create a new one if manifest was null.