/** * Analyzer has an empty default but the builder has a * as default. * * @return */ protected String getImportPackages() { return getProperty(IMPORT_PACKAGE); }
/** * Answer the bundle version. * * @return */ public String getVersion() { String version = getProperty(BUNDLE_VERSION); if (version == null) version = "0.0.0"; return version; }
/** * Analyzer has an empty default but the builder has a * as default. * * @return */ protected String getImportPackages() { return getProperty(IMPORT_PACKAGE); }
public String getVersionPolicy() { return getProperty(VERSIONPOLICY, "${version;==;${@}}"); }
/** * * @return */ boolean isResourceOnly() { return getProperty(RESOURCEONLY, "false").equalsIgnoreCase("true"); }
protected List<XMLType> getTypes(Analyzer analyzer) throws Exception { List<XMLType> types = new ArrayList<XMLType>(); String header = analyzer.getProperty("Bundle-Blueprint", "META-INF/blueprint"); process(types,"extract.xsl", header, ".*\\.xml"); header = analyzer.getProperty("Spring-Context", "META-INF/spring"); process(types,"extract.xsl", header, ".*\\.xml"); return types; }
@Override protected List<XMLType> getTypes(Analyzer analyzer) throws Exception { List<XMLType> types = new ArrayList<XMLType>(); try { String header = analyzer.getProperty("Spring-Context", "META-INF/spring"); process(types,"activemq.xsl", header, ".*\\.xml"); } catch (Exception e) { LOGGER.warn("Error while adding bundle imports for ActiveMQ Spring namespace elements", e); } return types; }
@Override protected List<XMLType> getTypes(Analyzer analyzer) throws Exception { List<XMLType> types = new ArrayList<XMLType>(); try { String header = analyzer.getProperty("Spring-Context", "META-INF/spring"); process(types,"cxf.xsl", header, ".*\\.xml"); } catch (Exception e) { LOGGER.warn("Error while adding bundle imports for CXF namespace elements", e); } return types; }
@Override protected List<XMLType> getTypes(Analyzer analyzer) throws Exception { List<XMLType> types = new ArrayList<XMLType>(); try { String header = analyzer.getProperty("Spring-Context", "META-INF/spring"); process(types,"imports.xsl", header, ".*\\.xml"); } catch (Exception e) { LOGGER.warn("Error while adding bundle imports for Spring <import/> elements", e); } return types; }
/** * * @return */ boolean isResourceOnly() { return isTrue(getProperty(RESOURCEONLY)); }
@Override protected List<XMLType> getTypes(Analyzer analyzer) throws Exception { List<XMLType> types = new ArrayList<XMLType>(); try { String header = analyzer.getProperty("Spring-Context", "META-INF/spring"); process(types,"activemq.xsl", header, ".*\\.xml"); } catch (Exception e) { LOGGER.warn("Error while adding bundle imports for ActiveMQ Spring namespace elements", e); } return types; }
@Override protected List<XMLType> getTypes(Analyzer analyzer) throws Exception { List<XMLType> types = new ArrayList<XMLType>(); try { String header = analyzer.getProperty("Spring-Context", "META-INF/spring"); process(types,"imports.xsl", header, ".*\\.xml"); } catch (Exception e) { LOGGER.warn("Error while adding bundle imports for Spring <import/> elements", e); } return types; }
@Override protected List<XMLType> getTypes(Analyzer analyzer) throws Exception { List<XMLType> types = new ArrayList<XMLType>(); try { String header = analyzer.getProperty("Spring-Context", "META-INF/spring"); process(types,"cxf.xsl", header, ".*\\.xml"); } catch (Exception e) { LOGGER.warn("Error while adding bundle imports for CXF namespace elements", e); } return types; }
public boolean isNoBundle() { return isTrue(getProperty(RESOURCEONLY)) || isTrue(getProperty(NOMANIFEST)); }
/** * Add the uses clauses. This method iterates over the exports and cal * * @param exports * @param uses * @throws MojoExecutionException */ void doUses(Map<String, Map<String, String>> exports, Map<String, Set<String>> uses, Map<String, Map<String, String>> imports) { if ("true".equalsIgnoreCase(getProperty(NOUSES))) return; for (Iterator<String> i = exports.keySet().iterator(); i.hasNext();) { String packageName = i.next(); setProperty(CURRENT_PACKAGE, packageName); try { doUses(packageName, exports, uses, imports); } finally { unsetProperty(CURRENT_PACKAGE); } } }
public List<Jar> getClasspath() { if (firstUse) { firstUse = false; String cp = getProperty(CLASSPATH); if (cp != null) for (String s : split(cp)) { Jar jar = getJarFromName(s, "getting classpath"); if (jar != null) addClasspath(jar); } } return classpath; }
public boolean analyzeJar(Analyzer analyzer) throws Exception { Map<String, Map<String, String>> map = analyzer.parseHeader(analyzer .getProperty(Constants.METATYPE)); Jar jar = analyzer.getJar(); for (String name : map.keySet()) { Collection<Clazz> metatypes = analyzer.getClasses("", QUERY.ANNOTATION.toString(), Meta.OCD.class.getName(), // QUERY.NAMED.toString(), name // ); for (Clazz c : metatypes) { jar.putResource("OSGI-INF/metatype/" + c.getFQN() + ".xml", new MetaTypeReader(c, analyzer)); } } return false; } }
/** * Ensure that we are running on the correct bnd. */ void doRequireBnd() { Map<String, String> require = OSGiHeader.parseProperties(getProperty(REQUIRE_BND)); if (require == null || require.isEmpty()) return; Hashtable<String, String> map = new Hashtable<String, String>(); map.put(Constants.VERSION_FILTER, getBndVersion()); for (String filter : require.keySet()) { try { Filter f = new Filter(filter); if (f.match(map)) continue; error("%s fails %s", REQUIRE_BND, require.get(filter)); } catch (Exception t) { error("%s with value %s throws exception", t, REQUIRE_BND, require); } } }
protected void begin() { super.begin(); updateModified(getBndLastModified(), "bnd last modified"); String doNotCopy = getProperty(DONOTCOPY); if (doNotCopy != null) Analyzer.doNotCopy = Pattern.compile(doNotCopy); verifyManifestHeadersCase(getProperties()); }
public List<Jar> getClasspath() { if (firstUse) { firstUse = false; String cp = getProperty(CLASSPATH); if (cp != null) for (String s : split(cp)) { Jar jar = getJarFromName(s, "getting classpath"); if (jar != null) addClasspath(jar); else warning("Cannot find entry on -classpath: %s", s); } } return classpath; }