Bug 484004: Start publishing Eclipse platform artifacts to Maven central
- uploading for pde
diff --git a/releng/EnrichPoms/pde-pom.xml b/releng/EnrichPoms/pde-pom.xml
new file mode 100644
index 0000000..aa58f4c
--- /dev/null
+++ b/releng/EnrichPoms/pde-pom.xml
@@ -0,0 +1,47 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.eclipse.cbi</groupId>
+  <artifactId>org.eclipse.pde.publish2maven</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  
+  <properties>
+  	<gpg.key.id>86085154</gpg.key.id>
+  </properties>
+
+  <distributionManagement>
+    <snapshotRepository>
+      <id>ossrh</id>
+      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+    </snapshotRepository>
+  </distributionManagement>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-gpg-plugin</artifactId>
+        <version>1.6</version>
+        <configuration>
+          <gpgArguments>
+            <arg>--default-key</arg>
+            <arg>${gpg.key.id}</arg>
+          </gpgArguments>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.sonatype.plugins</groupId>
+        <artifactId>nexus-staging-maven-plugin</artifactId>
+        <version>1.1</version>
+        <extensions>true</extensions>
+        <configuration>
+        <!-- The Base URL of Nexus instance where we want to stage -->
+          <nexusUrl>https://oss.sonatype.org/service/local/staging/deploy/maven2/</nexusUrl>
+          <!-- The server "id" element from settings to use authentication from -->
+          <serverId>ossrh</serverId>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/releng/EnrichPoms/publishPDE.sh b/releng/EnrichPoms/publishPDE.sh
new file mode 100644
index 0000000..7015794
--- /dev/null
+++ b/releng/EnrichPoms/publishPDE.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+#*******************************************************************************
+# Copyright (c) 2017 GK Software AG and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#     Stephan Herrmann - initial API and implementation
+#********************************************************************************
+
+REPO_BASE=${WORKSPACE}/../../CBIaggregator/workspace
+REPO=${REPO_BASE}/repo-${REPO_ID}
+PDE=org/eclipse/pde
+
+if [ ! -d ${REPO} ]
+then
+	echo "No repo at ${REPO}"
+	exit 1
+fi
+
+echo "==== Copy artifacts from ${REPO}/${PDE} ===="
+
+mkdir -p ${PDE}
+cp -r ${REPO}/${PDE}/* ${PDE}/
+
+
+echo "==== UPLOAD ===="
+
+URL=https://oss.sonatype.org/service/local/staging/deploy/maven2/
+REPO=ossrh
+SETTINGS=/opt/public/hipp/homes/genie.releng/.m2/settings-deploy-ossrh-pde.xml
+MVN=/shared/common/apache-maven-latest/bin/mvn
+
+/bin/mkdir .log
+
+for pomFile in org/eclipse/pde/*/*/*.pom
+do
+  file=`echo $pomFile | sed -e "s|\(.*\)\.pom|\1.jar|"`
+  sourcesFile=`echo $pomFile | sed -e "s|\(.*\)\.pom|\1-sources.jar|"`
+  javadocFile=`echo $pomFile | sed -e "s|\(.*\)\.pom|\1-javadoc.jar|"`
+
+  echo "${MVN} -f pde-pom.xml -s ${SETTINGS} gpg:sign-and-deploy-file -Durl=${URL} -DrepositoryId=${REPO} -Dfile=${file} -DpomFile=${pomFile}"
+  
+  ${MVN} -f pde-pom.xml -s ${SETTINGS} gpg:sign-and-deploy-file \
+     -Durl=${URL} -DrepositoryId=${REPO} \
+     -Dfile=${file} -DpomFile=${pomFile} \
+     >> .log/artifact-upload.txt
+     
+  echo -e "\t${sourcesFile}"
+  ${MVN} -f pde-pom.xml -s ${SETTINGS} gpg:sign-and-deploy-file \
+     -Durl=${URL} -DrepositoryId=${REPO} \
+     -Dfile=${sourcesFile} -DpomFile=${pomFile} -Dclassifier=sources \
+     >> .log/sources-upload.txt
+  
+  echo -e "\t${javadocFile}"
+  ${MVN} -f pde-pom.xml -s ${SETTINGS} gpg:sign-and-deploy-file \
+     -Durl=${URL} -DrepositoryId=${REPO} \
+     -Dfile=${javadocFile} -DpomFile=${pomFile} -Dclassifier=javadoc \
+     >> .log/javadoc-upload.txt
+
+done
+
+/bin/ls -la .log
+
+/bin/grep -i fail .log/*
+