Bug 499019: Publish JDT Core Batch Compiler ecj to Maven Central
- special treatment for metadata of ecj
- more robust way to read Manifest from jar/zip
diff --git a/releng/EnrichPoms/src/org/eclipse/cbi/p2repo/aggregator/maven/pom/ArtifactInfo.java b/releng/EnrichPoms/src/org/eclipse/cbi/p2repo/aggregator/maven/pom/ArtifactInfo.java
index cc8509f..289238a 100644
--- a/releng/EnrichPoms/src/org/eclipse/cbi/p2repo/aggregator/maven/pom/ArtifactInfo.java
+++ b/releng/EnrichPoms/src/org/eclipse/cbi/p2repo/aggregator/maven/pom/ArtifactInfo.java
@@ -91,7 +91,11 @@
private void fixData() {
if (this.scmConnection == null) {
- if (this.bsn.startsWith("org.eclipse.emf")) {
+ if (this.bsn.equals("org.eclipse.jdt.core.compiler.batch")) {
+ // not a regular OSGi bundle, scm info missing:
+ this.scmConnection = "scm:git:git://git.eclipse.org/gitroot/jdt/eclipse.jdt.core.git;path=\"org.eclipse.jdt.core\"";
+ System.out.println("Fixed scmUrl for "+this.bsn);
+ } else if (this.bsn.startsWith("org.eclipse.emf")) {
this.scmConnection = "scm:git:https://git.eclipse.org/r/emf/org.eclipse.emf";
System.out.println("Fixed scmUrl for "+this.bsn);
} else if (this.bsn.startsWith("org.eclipse.ecf")) {
diff --git a/releng/EnrichPoms/src/org/eclipse/cbi/p2repo/aggregator/maven/pom/ManifestReader.java b/releng/EnrichPoms/src/org/eclipse/cbi/p2repo/aggregator/maven/pom/ManifestReader.java
index 59e741f..24a2516 100644
--- a/releng/EnrichPoms/src/org/eclipse/cbi/p2repo/aggregator/maven/pom/ManifestReader.java
+++ b/releng/EnrichPoms/src/org/eclipse/cbi/p2repo/aggregator/maven/pom/ManifestReader.java
@@ -11,7 +11,6 @@
package org.eclipse.cbi.p2repo.aggregator.maven.pom;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Path;
@@ -19,12 +18,13 @@
import java.util.Properties;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
-import java.util.jar.JarInputStream;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
public class ManifestReader {
+ private static final String MANIFEST_MF = "META-INF/MANIFEST.MF";
// Eclipse headers in MANIFEST.MF:
private static final String BUNDLE_SYMBOLIC_NAME = "Bundle-SymbolicName";
private static final String BUNDLE_NAME = "Bundle-Name";
@@ -37,8 +37,9 @@
public static ArtifactInfo read(Path path) throws FileNotFoundException, IOException {
File file = path.toFile();
- try (JarInputStream jInput = new JarInputStream(new FileInputStream(file))) {
- Manifest mf = jInput.getManifest();
+ try (ZipFile zip = new ZipFile(file)) {
+ ZipEntry entry = zip.getEntry(MANIFEST_MF);
+ Manifest mf = new Manifest(zip.getInputStream(entry));
Attributes mainAttributes = mf.getMainAttributes();
// printAllMainAttributes(mainAttributes);