private void logIgnored(Bundle bundle) { getLog().warn("Ignoring jar without BundleSymbolicName: " + bundle.getLocation()); }
private void logIgnored(Bundle bundle) { getLog().warn("Ignoring jar without BundleSymbolicName: " + bundle.getLocation()); }
private Attributes getManifest(Bundle bundle) throws MojoExecutionException { Attributes attributes = manifests.get(bundle.getLocation()); if (attributes == null) { Artifact artifact = resourceToArtifact(bundle.getLocation(), skipNonMavenProtocols); if (artifact.getFile() == null) { resolveArtifact(artifact, remoteRepos); } try (JarInputStream jis = new JarInputStream(new FileInputStream(artifact.getFile()))) { Manifest manifest = jis.getManifest(); if (manifest != null) { attributes = manifest.getMainAttributes(); } else { attributes = new Attributes(); } manifests.put(bundle.getLocation(), attributes); } catch (IOException e) { throw new MojoExecutionException("Error reading bundle manifest from " + bundle.getLocation(), e); } } return attributes; }
private Attributes getManifest(Bundle bundle) throws MojoExecutionException { Attributes attributes = manifests.get(bundle.getLocation()); if (attributes == null) { Artifact artifact = resourceToArtifact(bundle.getLocation(), skipNonMavenProtocols); if (artifact.getFile() == null) { resolveArtifact(artifact, remoteRepos); } try (JarInputStream jis = new JarInputStream(new FileInputStream(artifact.getFile()))) { Manifest manifest = jis.getManifest(); if (manifest != null) { attributes = manifest.getMainAttributes(); } else { attributes = new Attributes(); } manifests.put(bundle.getLocation(), attributes); } catch (IOException e) { throw new MojoExecutionException("Error reading bundle manifest from " + bundle.getLocation(), e); } } return attributes; }
private void copyBundlesToDestRepository(List<? extends Bundle> artifactRefs) throws MojoExecutionException { for (Bundle artifactRef : artifactRefs) { Artifact artifact = resourceToArtifact(artifactRef.getLocation(), skipNonMavenProtocols); // Avoid getting NPE on artifact.getFile in some cases resolveArtifact(artifact, remoteRepos); if (artifact != null) { copy(artifact, repository); } } }
private void copyBundlesToDestRepository(List<? extends Bundle> artifactRefs) throws MojoExecutionException { for (Bundle artifactRef : artifactRefs) { Artifact artifact = resourceToArtifact(artifactRef.getLocation(), skipNonMavenProtocols); // Avoid getting NPE on artifact.getFile in some cases resolveArtifact(artifact, remoteRepos); if (artifact != null) { copy(artifact, repository); } } }
feature.getBundle().forEach(bundle -> { bundle2featureId.computeIfAbsent(bundle.getLocation().trim(), k -> new TreeSet<>()).add(feature.getId()); }); feature.getConditional().forEach(cond -> {
bundle2featureId.computeIfAbsent(bundle.getLocation().trim(), k -> new TreeSet<>()).add(feature.getId());
String loc = bi.getLocation(); String nloc = null; if (loc.contains("file:")) {
String loc = bi.getLocation(); String nloc = null; if (loc.contains("file:")) {
for (Bundle b : f.getBundle()) { Bundle bundle = objectFactory.createBundle(); bundle.setLocation(b.getLocation()); feature.getBundle().add(bundle);
for (Bundle b : f.getBundle()) { Bundle bundle = objectFactory.createBundle(); bundle.setLocation(b.getLocation()); feature.getBundle().add(bundle);
try { for (Bundle bundle : feature.getBundle()) { resolveArtifact(bundle.getLocation());
try { for (Bundle bundle : feature.getBundle()) { resolveArtifact(bundle.getLocation());
private void processBundles(List<Bundle> bundles, boolean allBlacklisted, Boolean forceDependency) { for (Bundle bundle : bundles) { boolean bundleBlacklisted = allBlacklisted || isBundleBlacklisted(bundle.getLocation()); if (bundleBlacklisted) { // blacklisting has higher priority bundle.setBlacklisted(true); } else { // if not blacklisted, it may be overriden staticOverrideBundle(bundle); // and may have dependency flag altered if (forceDependency != null) { // set at feature level bundle.setDependency(forceDependency); } else { // may have dependency overriden at bundle level for (OverrideBundleDependency.OverrideDependency overrideBundleDependency : getInstructions().getOverrideBundleDependency().getBundles()) { LocationPattern pattern = new LocationPattern(overrideBundleDependency.getUri()); if (pattern.matches(bundle.getLocation())) { bundle.setDependency(overrideBundleDependency.isDependency()); } } } } } }
/** * Processes {@link Bundle bundle definition} and (according to override instructions) maybe sets different target * location and {@link BundleInfo#isOverriden()} flag. */ private void staticOverrideBundle(Bundle bundle) { bundle.setOverriden(BundleInfo.BundleOverrideMode.NONE); for (BundleReplacements.OverrideBundle override : this.getInstructions().getBundleReplacements().getOverrideBundles()) { String originalLocation = bundle.getLocation(); if (override.getOriginalUriPattern().matches(originalLocation)) { LOG.debug("Overriding bundle location \"" + originalLocation + "\" with \"" + override.getReplacement() + "\""); bundle.setOriginalLocation(originalLocation); if (override.getMode() == BundleReplacements.BundleOverrideMode.MAVEN) { bundle.setOverriden(BundleInfo.BundleOverrideMode.MAVEN); } else { bundle.setOverriden(BundleInfo.BundleOverrideMode.OSGI); } bundle.setLocation(override.getReplacement()); // TOCHECK: last rule wins - no break!!! //break; } } }
if (bundleName.equals(b.getLocation())) { bundle = b; break;
if (bundleName.equals(b.getLocation())) { bundle = b; break;