private static void setInstructions(Analyzer analyzer, ArtifactBundlerInstructions instructions) { if (!instructions.getInstructions().isEmpty()) { analyzer.setProperties(BundleUtils.transformDirectivesToProperties(instructions.getInstructions())); } }
/** * Specifically for Maven * * @param properties * the properties */ public static Properties getManifest(File dirOrJar) throws Exception { Analyzer analyzer = new Analyzer(); try { analyzer.setJar(dirOrJar); Properties properties = new Properties(); properties.put(IMPORT_PACKAGE, "*"); properties.put(EXPORT_PACKAGE, "*"); analyzer.setProperties(properties); Manifest m = analyzer.calcManifest(); Properties result = new Properties(); for (Iterator<Object> i = m.getMainAttributes().keySet().iterator(); i.hasNext();) { Attributes.Name name = (Attributes.Name) i.next(); result.put(name.toString(), m.getMainAttributes().getValue(name)); } return result; } finally { analyzer.close(); } }
/** * Specifically for Maven */ public static Properties getManifest(File dirOrJar) throws Exception { try (Analyzer analyzer = new Analyzer()) { analyzer.setJar(dirOrJar); Properties properties = new UTF8Properties(); properties.put(IMPORT_PACKAGE, "*"); properties.put(EXPORT_PACKAGE, "*"); analyzer.setProperties(properties); Manifest m = analyzer.calcManifest(); Properties result = new UTF8Properties(); for (Iterator<Object> i = m.getMainAttributes() .keySet() .iterator(); i.hasNext();) { Attributes.Name name = (Attributes.Name) i.next(); result.put(name.toString(), m.getMainAttributes() .getValue(name)); } return result; } }
/** * Specifically for Maven */ public static Properties getManifest(File dirOrJar) throws Exception { try (Analyzer analyzer = new Analyzer()) { analyzer.setJar(dirOrJar); Properties properties = new UTF8Properties(); properties.put(IMPORT_PACKAGE, "*"); properties.put(EXPORT_PACKAGE, "*"); analyzer.setProperties(properties); Manifest m = analyzer.calcManifest(); Properties result = new UTF8Properties(); for (Iterator<Object> i = m.getMainAttributes() .keySet() .iterator(); i.hasNext();) { Attributes.Name name = (Attributes.Name) i.next(); result.put(name.toString(), m.getMainAttributes() .getValue(name)); } return result; } }
/** * Specifically for Maven * * @param properties * the properties */ public static Properties getManifest(File dirOrJar) throws Exception { Analyzer analyzer = new Analyzer(); try { analyzer.setJar(dirOrJar); Properties properties = new UTF8Properties(); properties.put(IMPORT_PACKAGE, "*"); properties.put(EXPORT_PACKAGE, "*"); analyzer.setProperties(properties); Manifest m = analyzer.calcManifest(); Properties result = new UTF8Properties(); for (Iterator<Object> i = m.getMainAttributes().keySet().iterator(); i.hasNext();) { Attributes.Name name = (Attributes.Name) i.next(); result.put(name.toString(), m.getMainAttributes().getValue(name)); } return result; } finally { analyzer.close(); } }
/** * Specifically for Maven * * @param properties * the properties */ public static Properties getManifest(File dirOrJar) throws Exception { Analyzer analyzer = new Analyzer(); try { analyzer.setJar(dirOrJar); Properties properties = new UTF8Properties(); properties.put(IMPORT_PACKAGE, "*"); properties.put(EXPORT_PACKAGE, "*"); analyzer.setProperties(properties); Manifest m = analyzer.calcManifest(); Properties result = new UTF8Properties(); for (Iterator<Object> i = m.getMainAttributes().keySet().iterator(); i.hasNext();) { Attributes.Name name = (Attributes.Name) i.next(); result.put(name.toString(), m.getMainAttributes().getValue(name)); } return result; } finally { analyzer.close(); } }
analyzer.setProperties( properties ); if( manifest != null && OverwriteMode.MERGE == overwriteMode )
wrapper.setProperties(properties);
analyzer.setProperties(analyzerProperties);
wrapper.setProperties(p); else { error("No valid property file: %s", p);