Package org.codehaus.plexus.archiver.jar

Examples of org.codehaus.plexus.archiver.jar.Manifest


            file = FileUtils.createTempFile("cxf-codegen", ".jar");

            JarArchiver jar = new JarArchiver();
            jar.setDestFile(file.getAbsoluteFile());

            Manifest manifest = new Manifest();
            Attribute attr = new Attribute();
            attr.setName("Class-Path");
            StringBuilder b = new StringBuilder(8000);
            for (URI cp : classPath) {
                b.append(cp.toURL().toExternalForm()).append(' ');
            }
            attr.setValue(b.toString());
            manifest.getMainSection().addConfiguredAttribute(attr);

            attr = new Attribute();
            attr.setName("Main-Class");
            attr.setValue(mainClassName);
            manifest.getMainSection().addConfiguredAttribute(attr);

            jar.addConfiguredManifest(manifest);
            jar.createArchive();

            cmd.createArg().setValue("-jar");
View Full Code Here


            file = FileUtils.createTempFile("cxf-codegen", ".jar");

            JarArchiver jar = new JarArchiver();
            jar.setDestFile(file.getAbsoluteFile());
           
            Manifest manifest = new Manifest();
            Attribute attr = new Attribute();
            attr.setName("Class-Path");
            StringBuilder b = new StringBuilder(8000);
            for (URI cp : classPath) {
                b.append(cp.toURL().toExternalForm()).append(' ');
            }
            attr.setValue(b.toString());
            manifest.getMainSection().addConfiguredAttribute(attr);
           
            attr = new Attribute();
            attr.setName("Main-Class");
            attr.setValue(cls.getName());
            manifest.getMainSection().addConfiguredAttribute(attr);

            jar.addConfiguredManifest(manifest);
            jar.createArchive();
           
            cmd.createArg().setValue("-jar");
View Full Code Here

            IOUtils.copy(is, aos);
            aos.closeArchiveEntry();
          }
        }

        Manifest manifest = new Manifest();

        Manifest.Attribute mainClassAtt = new Manifest.Attribute();
        mainClassAtt.setName("Main-Class");
        mainClassAtt.setValue(Runner.class.getName());
        manifest.addConfiguredAttribute(mainClassAtt);

        aos.putArchiveEntry(new JarArchiveEntry("META-INF/MANIFEST.MF"));
        manifest.write(aos);
        aos.closeArchiveEntry();

        aos.putArchiveEntry(new JarArchiveEntry(Runner.TIMESTAMP_FILENAME));
        aos.write(String.valueOf(System.currentTimeMillis()).getBytes(StandardCharsets.UTF_8));
        aos.closeArchiveEntry();
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.archiver.jar.Manifest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.