You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2017/10/25 14:46:05 UTC

svn commit: r1813305 - /uima/uimaj/trunk/uimaj-eclipse-update-site/pom.xml

Author: schor
Date: Wed Oct 25 14:46:05 2017
New Revision: 1813305

URL: http://svn.apache.org/viewvc?rev=1813305&view=rev
Log:
[UIMA-5285] [UIMA-5613] support jar signing, 5285 backport from uv3 (wasn't causing a problem because of no hyphen in version like -alpha)

Modified:
    uima/uimaj/trunk/uimaj-eclipse-update-site/pom.xml

Modified: uima/uimaj/trunk/uimaj-eclipse-update-site/pom.xml
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-eclipse-update-site/pom.xml?rev=1813305&r1=1813304&r2=1813305&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-eclipse-update-site/pom.xml (original)
+++ uima/uimaj/trunk/uimaj-eclipse-update-site/pom.xml Wed Oct 25 14:46:05 2017
@@ -17,7 +17,7 @@
    specific language governing permissions and limitations
    under the License.
 -->
-<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/maven-v4_0_0.xsd">
+<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
   <parent>
@@ -59,6 +59,15 @@
 
   <build>
 
+    <pluginManagement>
+      <plugins>
+        <plugin>
+            <artifactId>maven-release-plugin</artifactId>
+            <version>2.5.3</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
@@ -76,14 +85,14 @@
                             Name must be the same as the ID for the plugin or feature
                 ======================================================================= -->
               <artifactItems>
-                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-ep-cas-editor</artifactId>    <version>${project.version}</version><destFileName>org.apache.uima.caseditor_${project.version}.jar    </destFileName></artifactItem>
-                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-ep-cas-editor-ide</artifactId><version>${project.version}</version><destFileName>org.apache.uima.caseditor.ide_${project.version}.jar</destFileName></artifactItem>
-                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-ep-configurator</artifactId>  <version>${project.version}</version><destFileName>org.apache.uima.desceditor_${project.version}.jar   </destFileName></artifactItem>
-                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-ep-debug</artifactId>         <version>${project.version}</version><destFileName>org.apache.uima.debug_${project.version}.jar        </destFileName></artifactItem>
-                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-ep-jcasgen</artifactId>       <version>${project.version}</version><destFileName>org.apache.uima.jcas.jcasgenp_${project.version}.jar</destFileName></artifactItem>
-                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-ep-pear-packager</artifactId> <version>${project.version}</version><destFileName>org.apache.uima.pear_${project.version}.jar         </destFileName></artifactItem>
-                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-ep-runtime</artifactId>       <version>${project.version}</version><destFileName>org.apache.uima.runtime_${project.version}.jar      </destFileName></artifactItem>
-                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-ep-launcher</artifactId>      <version>${project.version}</version><destFileName>org.apache.uima.launcher_${project.version}.jar     </destFileName></artifactItem>
+                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-ep-cas-editor</artifactId>    <version>${project.version}</version><destFileName>org.apache.uima.caseditor_${parsedVersion.osgiVersion}.jar    </destFileName></artifactItem>
+                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-ep-cas-editor-ide</artifactId><version>${project.version}</version><destFileName>org.apache.uima.caseditor.ide_${parsedVersion.osgiVersion}.jar</destFileName></artifactItem>
+                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-ep-configurator</artifactId>  <version>${project.version}</version><destFileName>org.apache.uima.desceditor_${parsedVersion.osgiVersion}.jar   </destFileName></artifactItem>
+                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-ep-debug</artifactId>         <version>${project.version}</version><destFileName>org.apache.uima.debug_${parsedVersion.osgiVersion}.jar        </destFileName></artifactItem>
+                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-ep-jcasgen</artifactId>       <version>${project.version}</version><destFileName>org.apache.uima.jcas.jcasgenp_${parsedVersion.osgiVersion}.jar</destFileName></artifactItem>
+                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-ep-pear-packager</artifactId> <version>${project.version}</version><destFileName>org.apache.uima.pear_${parsedVersion.osgiVersion}.jar         </destFileName></artifactItem>
+                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-ep-runtime</artifactId>       <version>${project.version}</version><destFileName>org.apache.uima.runtime_${parsedVersion.osgiVersion}.jar      </destFileName></artifactItem>
+                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-ep-launcher</artifactId>      <version>${project.version}</version><destFileName>org.apache.uima.launcher_${parsedVersion.osgiVersion}.jar     </destFileName></artifactItem>
               </artifactItems>
               <outputDirectory>${toBePacked}</outputDirectory>
             </configuration>
@@ -102,15 +111,357 @@
                             Name must be the same as the ID for the plugin or feature
                 ======================================================================= -->
               <artifactItems>
-                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-eclipse-feature-runtime</artifactId><version>${project.version}</version><destFileName>org.apache.uima.runtime_${project.version}.jar</destFileName></artifactItem>
-                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-eclipse-feature-tools</artifactId>  <version>${project.version}</version><destFileName>org.apache.uima.tools_${project.version}.jar  </destFileName></artifactItem>
+                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-eclipse-feature-runtime</artifactId><version>${project.version}</version><destFileName>org.apache.uima.runtime_${parsedVersion.osgiVersion}.jar</destFileName></artifactItem>
+                <artifactItem><groupId>org.apache.uima</groupId><artifactId>uimaj-eclipse-feature-tools</artifactId>  <version>${project.version}</version><destFileName>org.apache.uima.tools_${parsedVersion.osgiVersion}.jar  </destFileName></artifactItem>
               </artifactItems>
-              <outputDirectory>${project.build.directory}/eus-work/features</outputDirectory>
+              <outputDirectory>${eusWork}/features</outputDirectory>
             </configuration>
           </execution>
         </executions>
       </plugin>
 
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.7</version>
+        <executions>
+          <execution>
+            <id>make-subsite-after-signing</id>
+            <configuration>
+              <target>
+                <taskdef classname="net.sf.antcontrib.logic.IfTask" name="if" />
+                <!-- if the property uima-maven-build-eclipse-home is set, use it, otherwise don't -->
+                <condition property="eclipse.home" value="${uima-maven-build-eclipse-home}">
+                  <not>
+                    <equals arg1="${uima-maven-build-eclipse-home}" arg2="$${uima-maven-build-eclipse-home}" />
+                  </not>
+                </condition>
+
+                <property environment="envVar" />
+                <condition property="eclipse.home" value="${envVar.ECLIPSE_HOME}">
+                  <isset property="envVar.ECLIPSE_HOME" />
+                </condition>
+                
+                <echo>deleting previous version of packed files from work</echo>
+                <echo>---------------------------------------------------</echo>
+                <delete verbose="true">
+                  <fileset dir="${eusWork}/plugins" includes="*.pack.gz" />
+                </delete>
+                
+                <echo> </echo>
+                <echo>Compressing signed plugin Jars using pack200 - this may take a minute or 2</echo>
+                <echo>==========================================================================</echo>
+                <java jar="${uima-eclipse-jar-processor}" fork="true" failonerror="true" maxmemory="256m">
+                  <arg line="-pack" />
+                  <arg line="-verbose" />
+                  <arg line="-outputDir ${eusWork}/plugins" />
+                  <arg line="${eusWork}/plugins" />
+                </java>
+                
+                <echo> </echo>
+                <echo>Resetting the content and artifacts for the site</echo>
+                <echo>------------------------------------------------</echo>
+                
+                <delete verbose="true">
+                  <fileset dir="${eclipseUpdateSubSite}" includes="content.jar,artifacts.jar" />
+                </delete>
+                <copy todir="${eclipseUpdateSubSite}" failonerror="false">
+                  <fileset dir="${project.build.directory}/saved" includes="content.jar,artifacts.jar" />
+                </copy>
+
+                <echo> </echo>
+                <echo>Generate the p2 metadata and publish new artifacts</echo>
+                <echo>--------------------------------------------------</echo>
+                <!-- Append is needed because category info is incremental with each additional release -->
+                <!-- publishArtifacts is needed to generate p2 metadata for the pack.gz forms -->
+                <!--   - tried and failed: using ANT to copy artifacts to the target - doesn't update metadata
+                         for pack.gz form ! if you don't publish artifacts
+                         - doesn't update artifacts.jar 
+                       - deleting SNAPSHOT jars in the eclipse update subsite 
+                         - fails because the previous metadata has info about those jars  
+                           and that isn't deleted, and continues to be used
+                -->
+                <java jar="${eclipse-equinox-launcher}" fork="true" failonerror="true" maxmemory="256m">
+                  <arg line="-application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher" />
+                  <arg line="-metadataRepository file:///${eclipseUpdateSubSite}" />
+                  <arg line="-artifactRepository file:///${eclipseUpdateSubSite}" />
+                  <arg line="-source ${eusWork}" />
+                  <arg line="-configs ANY.ANY.ANY" />
+                  <arg line="-publishArtifacts" />
+                  <arg line="-reusePack200Files" />
+                  <arg line="-compress" />
+                  <arg line="-append" />     
+                </java>
+                
+                <echo> </echo>
+                <echo>Augment p2 metadata with category information</echo>
+                <echo>---------------------------------------------</echo>
+                <java jar="${eclipse-equinox-launcher}" fork="true" failonerror="true" maxmemory="256m">
+                  <arg line="-application org.eclipse.equinox.p2.publisher.CategoryPublisher" />
+                  <arg line="-metadataRepository file:///${eclipseUpdateSubSite}" />
+                  <arg line="-categoryDefinition file:///${basedir}/category.xml" />
+                  <arg line="-categoryQualifier apache-uima" />
+                  <arg line="-compress" />
+                </java>  
+      
+                <echo> </echo>
+                <echo>Clearing previous checksums and signatures for eusWork plugins</echo>
+                <delete dir="${eusWork}">
+                  <include name="**/*.sha1" />
+                  <include name="**/*.md5" />
+                  <include name="**/*.asc" />
+                </delete>
+      
+                <echo message="Generating checksums for signed plugins" />
+                <checksum algorithm="sha1" format="MD5SUM">
+                  <fileset dir="${eusWork}">
+                    <include name="**/*.gz" />
+                    <include name="**/*.jar" />
+                  </fileset>
+                </checksum>
+                <checksum algorithm="md5" format="MD5SUM">
+                  <fileset dir="${eusWork}">
+                    <include name="**/*.gz" />
+                    <include name="**/*.jar" />
+                  </fileset>
+                </checksum>
+
+                <echo message="Generating gpg signatures for new features and plugins" />
+                <apply executable="gpg" dir="${eusWork}" failonerror="true"> 
+                  <arg value="--detach-sign" />
+                  <arg value="--armor" />
+                  <!-- batch flag needed to avoid gpg hang up -->
+                  <arg value="--batch" />
+                  <fileset dir="${eusWork}">
+                    <include name="**/*.jar" />
+                    <include name="**/*.jar.pack.gz" />
+                  </fileset>
+                </apply> 
+                
+                <echo message="Copying the checksums and signatures to the update subsite" />
+                <copy todir="${eclipseUpdateSubSite}" failonerror="true" overwrite="true">
+                  <fileset dir="${eusWork}">
+                    <include name="**/*.asc" />
+                    <include name="**/*.md5" />
+                    <include name="**/*.sha1" />
+                  </fileset>
+                </copy>
+
+                <echo> </echo>
+                <echo message="Clearing previous checksums and signatures for update artifacts.jar and content.jar" />
+                <delete dir="${eclipseUpdateSubSite}">
+                  <include name="*.sha1" />
+                  <include name="*.md5" />
+                  <include name="*.asc" />
+                </delete> 
+                                  
+                <echo message="Generating checksums for updated artifacts.jar and content.jar" />
+                <checksum algorithm="sha1" format="MD5SUM">
+                  <fileset dir="${eclipseUpdateSubSite}">
+                     <include name="*.jar" />
+                  </fileset>
+                </checksum>
+
+                <checksum algorithm="md5" format="MD5SUM">
+                  <fileset dir="${eclipseUpdateSubSite}">
+                    <include name="*.jar" />
+                  </fileset>
+                </checksum>
+
+                <echo message="Generating gpg signatures for artifacts.jar and content.jar" />
+                <apply executable="gpg" dir="${eclipseUpdateSubSite}" failonerror="true"> 
+                  <arg value="--detach-sign" />
+                  <arg value="--armor" />
+                  <!-- batch flag needed to avoid gpg hang up -->
+                  <arg value="--batch" />
+                  <fileset dir="${eclipseUpdateSubSite}">
+                    <include name="*.jar" />
+                  </fileset>
+                </apply> 
+              </target>
+            </configuration>
+          </execution>
+          <execution>
+            <id>BuildUpdateSite-pack-svnget-buildMetadata-commit-to-dev</id>
+            <phase>package</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration combine.self="override">
+              <target>
+                <taskdef classname="net.sf.antcontrib.logic.IfTask" name="if" />
+                
+                <condition property="eclipse.home" value="${uima-maven-build-eclipse-home}">
+                  <not>
+                    <equals arg1="${uima-maven-build-eclipse-home}" arg2="$${uima-maven-build-eclipse-home}" />
+                  </not>
+                </condition>
+
+                <property environment="envVar" />
+                <condition property="eclipse.home" value="${envVar.ECLIPSE_HOME}">
+                  <isset property="envVar.ECLIPSE_HOME" />
+                </condition>
+                
+                <fail unless="eclipse.home" message="********** Please set up and use an ant property eclipse.home set to an Eclipse installation at level 3.3 or later, e.g. c:/eclipses/3.3/eclipse" />
+                <fail unless="uima-eclipse-jar-processor" message="********** Please add to your settings.xml file the property uima-eclipse-jar-processor, point to this within an Eclipse installation at level 4.2 or later, e.g. \$\{uima-maven-build-eclipse-home\}/plugins/org.eclipse.equinox.p2.jarprocessor_1.0.200.v20110808-1657.jar" />
+                <!--  skip this for pre-production, only want latest there
+                <if>
+                  <equals arg2="true" arg1="${isApacheRelease}" />
+                  <then>
+                    
+                    <echo>checking out eclipse update subsite uimaj-v3-pre-production from dist ...release...</echo>
+                    <delete quiet="true" dir="${eclipseUpdateSubSite}" />
+                    <exec failonerror="true" executable="svn">
+                      <arg value="checkout" />
+                      <arg value="https://dist.apache.org/repos/dist/release/uima/eclipse-update-site/uimaj-v3-pre-production" />
+                      <arg value="${eclipseUpdateSubSite}" />
+                    </exec>
+                    
+                    <echo>Saving original content and artifacts for the site</echo>
+                    <copy todir="${project.build.directory}/saved" failonerror="true"> 
+                      <fileset dir="${eclipseUpdateSubSite}" includes="content.jar,artifacts.jar" />
+                    </copy>
+                    
+                  </then>
+                  <else>
+                    <echo>skipping checkout of current svn dist release (because not apache-release)</echo>
+                    <delete quiet="true" dir="${eclipseUpdateSubSite}" />
+                  </else>
+                </if>
+                   -->
+                    
+                <echo>Compress plugin Jars using pack200 - this may take a minute or 2</echo>
+                <java fork="true" maxmemory="256m" jar="${uima-eclipse-jar-processor}" failonerror="true">
+                  <arg line="-processAll" />
+                  <arg line="-repack" />
+                  <arg line="-pack" />
+                  <arg line="-verbose" />
+                  <arg line="-outputDir ${eusWork}/plugins" />
+                  <arg line="${toBePacked}" />
+                </java>
+                
+                <echo>Save conditioned Jars prior to signing, in case of redo</echo>
+                <echo>-------------------------------------------------------</echo> 
+                <copy todir="${project.build.directory}/saved/features" failonerror="true">
+                  <fileset dir="${eusWork}/features" includes="*.jar" />                 
+                </copy>
+                <copy todir="${project.build.directory}/saved/plugins" failonerror="true">
+                   <fileset dir="${eusWork}/plugins" includes="*.jar" />                 
+                </copy>
+                
+                <echo>Generate the p2 metadata and publish new artifacts</echo>
+                <java fork="true" maxmemory="256m" jar="${eclipse-equinox-launcher}" failonerror="true">
+                  <arg line="-application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher" />
+                  <arg line="-metadataRepository file:///${eclipseUpdateSubSite}" />
+                  <arg line="-artifactRepository file:///${eclipseUpdateSubSite}" />
+                  <arg line="-source ${eusWork}" />
+                  <arg line="-configs ANY.ANY.ANY" />
+                  <arg line="-publishArtifacts" />
+                  <arg line="-reusePack200Files" />
+                  <arg line="-compress" />
+                  <arg line="-append" />
+                </java>
+                <echo>Augment p2 metadata with category information</echo>
+                <java fork="true" maxmemory="256m" jar="${eclipse-equinox-launcher}" failonerror="true">
+                  <arg line="-application org.eclipse.equinox.p2.publisher.CategoryPublisher" />
+                  <arg line="-metadataRepository file:///${eclipseUpdateSubSite}" />
+                  <arg line="-categoryDefinition file:///${basedir}/category.xml" />
+                  <arg line="-categoryQualifier apache-uima" />
+                  <arg line="-compress" />
+                </java>
+                <if>
+                  <equals arg2="true" arg1="${isApacheRelease}" />
+                  <then>
+                    <echo message="Generating checksums for new features and plugins" />
+                    <checksum format="MD5SUM" algorithm="sha1">
+                      <fileset dir="${eusWork}">
+                        <include name="**/*.gz" />
+                        <include name="**/*.jar" />
+                      </fileset>
+                    </checksum>
+                    <checksum format="MD5SUM" algorithm="md5">
+                      <fileset dir="${eusWork}">
+                        <include name="**/*.gz" />
+                        <include name="**/*.jar" />
+                      </fileset>
+                    </checksum>
+                    <echo message="Generating gpg signatures for new features and plugins" />
+                    <apply failonerror="true" dir="${eusWork}" executable="gpg">
+                      <arg value="--detach-sign" />
+                      <arg value="--armor" />
+                      <arg value="--batch" />
+                      <fileset dir="${eusWork}">
+                        <include name="**/*.jar" />
+                        <include name="**/*.jar.pack.gz" />
+                      </fileset>
+                    </apply>
+                    <echo message="Copying the checksums and signatures to the update subsite" />
+                    <copy todir="${eclipseUpdateSubSite}" failonerror="true">
+                      <fileset dir="${eusWork}">
+                        <include name="**/*.asc" />
+                        <include name="**/*.md5" />
+                        <include name="**/*.sha1" />
+                      </fileset>
+                    </copy>
+                    <echo message="Clearing previous checksums and signatures for update artifacts.jar and content.jar" />
+                    <delete dir="${eclipseUpdateSubSite}">
+                      <include name="*.sha1" />
+                      <include name="*.md5" />
+                      <include name="*.asc" />
+                    </delete>
+                    <echo message="Generating checksums for updated artifacts.jar and content.jar" />
+                    <checksum format="MD5SUM" algorithm="sha1">
+                      <fileset dir="${eclipseUpdateSubSite}">
+                        <include name="*.jar" />
+                      </fileset>
+                    </checksum>
+                    <checksum format="MD5SUM" algorithm="md5">
+                      <fileset dir="${eclipseUpdateSubSite}">
+                        <include name="*.jar" />
+                      </fileset>
+                    </checksum>
+                    <echo message="Generating gpg signatures for artifacts.jar and content.jar" />
+                    <apply failonerror="true" dir="${eclipseUpdateSubSite}" executable="gpg">
+                      <arg value="--detach-sign" />
+                      <arg value="--armor" />
+                      <arg value="--batch" />
+                      <fileset dir="${eclipseUpdateSubSite}">
+                        <include name="*.jar" />
+                      </fileset>
+                    </apply>
+                  </then>
+                </if>
+              </target>
+            </configuration>
+          </execution>
+        </executions>
+        <dependencies>
+          <dependency>
+            <groupId>ant-contrib</groupId>
+            <artifactId>ant-contrib</artifactId>
+            <version>1.0b3</version>
+            <scope>runtime</scope>
+            <exclusions>
+              <exclusion>
+                <artifactId>ant</artifactId>
+                <groupId>ant</groupId>
+              </exclusion>
+            </exclusions>
+          </dependency>
+          <dependency>
+            <groupId>org.apache.ant</groupId>
+            <artifactId>ant-apache-regexp</artifactId>
+            <version>1.9.2</version>
+            <scope>compile</scope>
+          </dependency>
+          <dependency>
+            <groupId>jakarta-regexp</groupId>
+            <artifactId>jakarta-regexp</artifactId>
+            <version>1.4</version>
+            <scope>compile</scope>
+          </dependency>
+        </dependencies>
+      </plugin>
+
    </plugins>
   </build>