Skip to content

Commit

Permalink
Catch OsgiManifestParserException in maven artifact provider
Browse files Browse the repository at this point in the history
Maven artifacts are not required to be valid bundles, in such case a
OsgiManifestParserException can be thrown when query for the package
version that then fails the build.

This now catches OsgiManifestParserException to prevent the issue from
happening.

(cherry picked from commit ffbcbae)
  • Loading branch information
laeubi authored and eclipse-tycho-bot committed Jan 21, 2025
1 parent f4514ab commit 057dd12
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.eclipse.tycho.artifacts.ArtifactVersionProvider;
import org.eclipse.tycho.core.osgitools.BundleReader;
import org.eclipse.tycho.core.osgitools.OsgiManifest;
import org.eclipse.tycho.core.osgitools.OsgiManifestParserException;
import org.osgi.framework.BundleException;
import org.osgi.framework.VersionRange;
import org.osgi.framework.namespace.PackageNamespace;
Expand Down Expand Up @@ -165,10 +166,10 @@ public String getProvider() {

private ModuleRevisionBuilder readOSGiInfo(Path path) {
if (path != null) {
OsgiManifest manifest = bundleReader.loadManifest(path.toFile());
try {
OsgiManifest manifest = bundleReader.loadManifest(path.toFile());
return OSGiManifestBuilderFactory.createBuilder(manifest.getHeaders());
} catch (BundleException e) {
} catch (BundleException | OsgiManifestParserException e) {
}
}
return null;
Expand Down

0 comments on commit 057dd12

Please sign in to comment.