[jboss-cvs] JBossAS SVN: r103734 - in trunk: build and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Apr 9 03:02:45 EDT 2010


Author: ALRubinger
Date: 2010-04-09 03:02:43 -0400 (Fri, 09 Apr 2010)
New Revision: 103734

Added:
   trunk/dist/
   trunk/dist/VersionRelease.java
   trunk/dist/pom.xml
   trunk/dist/src/
   trunk/dist/src/assembly/
Removed:
   trunk/build/VersionRelease.java
   trunk/build/src/assembly/
Modified:
   trunk/build/pom.xml
   trunk/depchain/pom.xml
   trunk/dist/src/assembly/jboss-dist-src.xml
   trunk/dist/src/assembly/jboss-dist.xml
   trunk/pom.xml
Log:
[JBAS-7919] Split the AS build of $JBOSS_HOME from the ZIP distribution

Deleted: trunk/build/VersionRelease.java
===================================================================
--- trunk/build/VersionRelease.java	2010-04-09 07:00:12 UTC (rev 103733)
+++ trunk/build/VersionRelease.java	2010-04-09 07:02:43 UTC (rev 103734)
@@ -1,379 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.FileOutputStream;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.FileWriter;
-import java.math.BigInteger;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-import java.util.jar.JarEntry;
-import java.util.jar.JarOutputStream;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.TreeSet;
-
-import org.dom4j.Document;
-import org.dom4j.DocumentFactory;
-import org.dom4j.Element;
-import org.dom4j.io.OutputFormat;
-import org.dom4j.io.XMLWriter;
-
-/** A utility which goes through a standard dist build and tags every jar
- * with the current build version using the jar file version manifest
- * headers. The unique jars and their version info and md5 digests are
- * output to the jboss.home/jar-versions.xml.
- * 
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class VersionRelease
-{
-   static byte[] buffer = new byte[4096];
-
-   /** The jboss dist root directory */
-   File jbossHome;
-   String specVersion;
-   String specVendor;
-   String specTitle;
-   String implTitle;
-   String implURL;
-   String implVersion;
-   String implVendor;
-   String implVendorID;
-   MessageDigest md5;
-   TreeSet jars = new TreeSet();
-
-   public VersionRelease(String homeDir)
-      throws FileNotFoundException, NoSuchAlgorithmException
-   {
-      jbossHome = new File(homeDir);
-      if( jbossHome.exists() == false )
-         throw new FileNotFoundException(jbossHome.getAbsolutePath() + " does not exist");
-      specTitle = System.getProperty("specification.title");
-      specVersion = System.getProperty("specification.version");
-      specVendor = System.getProperty("specification.vendor");
-      implTitle = System.getProperty("implementation.title");
-      implURL = System.getProperty("implementation.url");
-      implVersion = System.getProperty("implementation.version");
-      implVendor = System.getProperty("implementation.vendor");
-      implVendorID = System.getProperty("implementation.vendor.id");
-      md5 = MessageDigest.getInstance("MD5");
-   }
-
-   public void run()
-   {
-      processDir(jbossHome);
-      try
-      {
-         DocumentFactory df = DocumentFactory.getInstance();
-         Document doc = df.createDocument();
-         Element root = doc.addElement("jar-versions");
-         Iterator iter = jars.iterator();
-         while( iter.hasNext() )
-         {
-            JarInfo info = (JarInfo) iter.next();
-            info.writeXML(root);
-         }
-
-         File versionsXml = new File(jbossHome, "jar-versions.xml");
-         FileWriter versionInfo = new FileWriter(versionsXml);
-         OutputFormat outformat = OutputFormat.createPrettyPrint();
-         XMLWriter writer = new XMLWriter(versionInfo, outformat);
-         writer.setEscapeText(true);
-         writer.write(doc);
-         writer.flush();
-         versionInfo.close();
-      }
-      catch(IOException e)
-      {
-         e.printStackTrace();
-      }
-   }
-
-   void processDir(File dir)
-   {
-      File[] files = dir.listFiles();
-      for(int f = 0; f < files.length; f ++)
-      {
-         File child = files[f];
-         if( child.isDirectory() == true )
-            processDir(child);
-         else
-            processFile(child);
-      }
-   }
-   void processFile(File file)
-   {
-      System.out.println("Checking file: "+file);
-      // See if this is a jar archive
-      try
-      {
-         JarInfo info = new JarInfo(file, this);
-         info.write(md5);
-         jars.add(info);
-      }
-      catch(FileNotFoundException e)
-      {
-      }
-      catch(Exception e)
-      {
-         e.printStackTrace();
-      }
-   }
-
-   static class JarInfo implements Comparable
-   {
-      File file;
-      File tmpFile;
-
-      Manifest mf;
-      JarFile jarFile;
-      String jarName;
-      boolean sealed;
-      String md5Digest;
-      String specVersion;
-      String specVendor;
-      String specTitle;
-      String implTitle;
-      String implURL;
-      String implVersion;
-      String implVendor;
-      String implVendorID;
-
-      JarInfo(File file, VersionRelease release)
-         throws IOException
-      {
-         this.file = file;
-         this.jarName = file.getName();
-         this.tmpFile = new File(file.getAbsolutePath()+".tmp");
-         if( file.renameTo(tmpFile) == false )
-            throw new IOException("Failed to rename: "+file);
-
-         try
-         {
-            this.jarFile = new JarFile(tmpFile);
-         }
-         catch(IOException e)
-         {
-            tmpFile.renameTo(file);
-            throw new FileNotFoundException("Not a JarFile: "+file);
-         }
-
-         Manifest tmpMf = jarFile.getManifest();
-         this.mf = tmpMf == null ? new Manifest() : tmpMf;
-         Attributes mfAttrs = mf.getMainAttributes();
-
-         String sealedAttr = mfAttrs.getValue(Attributes.Name.SEALED);
-         sealed = Boolean.valueOf(sealedAttr).booleanValue();
-
-         specVersion = mfAttrs.getValue(Attributes.Name.SPECIFICATION_VERSION);
-         if( specVersion == null )
-         {
-            specVersion = release.specVersion;
-            mfAttrs.put(Attributes.Name.SPECIFICATION_VERSION, specVersion);
-         }
-         specVendor = mfAttrs.getValue(Attributes.Name.SPECIFICATION_VENDOR);
-         if( specVendor == null )
-         {
-            specVendor = release.specVendor;
-            mfAttrs.put(Attributes.Name.SPECIFICATION_VENDOR, specVendor);
-         }
-         specTitle = mfAttrs.getValue(Attributes.Name.SPECIFICATION_TITLE);
-         if( specTitle == null )
-         {
-            specTitle = release.specTitle;
-            mfAttrs.put(Attributes.Name.SPECIFICATION_TITLE, specTitle);
-         }
-
-         implTitle = mfAttrs.getValue(Attributes.Name.IMPLEMENTATION_TITLE);
-         if( implTitle == null )
-         {
-            implTitle = release.implTitle;
-            mfAttrs.put(Attributes.Name.IMPLEMENTATION_TITLE, implTitle);
-         }
-         implVersion = mfAttrs.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
-         if( implVersion == null )
-         {
-            implVersion = release.implVersion;
-            mfAttrs.put(Attributes.Name.IMPLEMENTATION_VERSION, implVersion);
-         }
-         implVendor = mfAttrs.getValue(Attributes.Name.IMPLEMENTATION_VENDOR);
-         if( implVendor == null )
-         {
-            implVendor = release.implVendor;
-            mfAttrs.put(Attributes.Name.IMPLEMENTATION_VENDOR, implVendor);
-         }
-         implVendorID = mfAttrs.getValue(Attributes.Name.IMPLEMENTATION_VENDOR_ID);
-         if( implVendorID == null )
-         {
-            implVendorID = release.implVendorID;
-            mfAttrs.put(Attributes.Name.IMPLEMENTATION_VENDOR_ID, implVendorID);
-         }
-         implURL = mfAttrs.getValue(Attributes.Name.IMPLEMENTATION_URL);
-         if( implURL == null )
-         {
-            implURL = release.implURL;
-            mfAttrs.put(Attributes.Name.IMPLEMENTATION_URL, implURL);
-         }
-      }
-
-      public void write(MessageDigest md5)
-         throws IOException
-      {
-         md5.reset();
-         if( sealed == true )
-         {
-            System.out.println("Skipping sealed jar: "+file);
-         }
-         else
-         {
-            FileOutputStream fos = new FileOutputStream(file);
-            JarOutputStream jos = new JarOutputStream(fos, mf);
-            Enumeration entries = jarFile.entries();
-            while( entries.hasMoreElements() )
-            {
-               JarEntry entry = (JarEntry) entries.nextElement();
-               String name = entry.getName();
-               if( name.equals("META-INF/MANIFEST.MF") )
-               {
-                  continue;
-               }
-
-               JarEntry outEntry = new JarEntry(entry.getName());
-               outEntry.setTime(entry.getTime());
-               if( entry.getComment() != null )
-                  outEntry.setComment(entry.getComment());
-               jos.putNextEntry(outEntry);
-               InputStream is = jarFile.getInputStream(entry);
-               int bytes = is.read(buffer);
-               while( bytes > 0 )
-               {
-                  jos.write(buffer, 0, bytes);
-                  bytes = is.read(buffer);
-               }
-               jos.closeEntry();
-            }
-            jarFile.close();
-            jos.close();
-            tmpFile.delete();
-         }
-
-         // Calculate the md5sum
-         FileInputStream fis = new FileInputStream(file);
-         int bytes = fis.read(buffer);
-         while( bytes > 0 )
-         {
-            md5.update(buffer, 0, bytes);
-            bytes = fis.read(buffer);
-         }
-         fis.close();
-         byte[] digest = md5.digest();
-         BigInteger bi = new BigInteger(-1, digest);
-         bi = bi.abs();
-         md5Digest = bi.toString(16);
-         System.out.println(file+", md5: "+md5Digest);
-      }
-
-      public int compareTo(Object o)
-      {
-         JarInfo info = (JarInfo) o;
-         return jarName.compareTo(info.jarName);
-      }
-      public boolean equals(Object o)
-      {
-         JarInfo info = (JarInfo) o;
-         return jarName.equals(info.jarName);
-      }
-      public int hashCode()
-      {
-         return jarName.hashCode();
-      }
-      /* Output an xml string element like:
-      <jar name='twiddle.jar' specVersion='3.2.4'
-            specVendor='JBoss (http://www.jboss.org/)'
-            specTitle='JBoss'
-            implVersion='3.2.4RC2 (build: CVSTag=Branch_3_2 date=200404182118)'
-            implVendor='JBoss.org'
-            implTitle='JBoss [WonderLand]'
-            implVendorID='http://www.jboss.org/'
-            implURL='http://www.jboss.org/'
-            sealed='false'
-            md5Digest='ebf8681b4e600cbe7bb2eff68c537c79' />
-      */
-      public String toString()
-      {
-         StringBuffer tmp = new StringBuffer("<jar name='");
-         tmp.append(jarName);
-         tmp.append("' specVersion='");
-         tmp.append(specVersion);
-         tmp.append("' specVendor='");
-         tmp.append(specVendor);
-         tmp.append("' specTitle='");
-         tmp.append(specTitle);
-         tmp.append("' implVersion='");
-         tmp.append(implVersion);
-         tmp.append("' implVendor='");
-         tmp.append(implVendor);
-         tmp.append("' implTitle='");
-         tmp.append(implTitle);
-         tmp.append("' implVendorID='");
-         tmp.append(implVendorID);
-         tmp.append("' implURL='");
-         tmp.append(implURL);
-         tmp.append("' sealed='");
-         tmp.append(sealed);
-         tmp.append("' md5Digest='");
-         tmp.append(md5Digest);
-         tmp.append("' />");
-         return tmp.toString();
-      }
-      public void writeXML(Element root)
-      {
-         Element jar = root.addElement("jar");
-         jar.addAttribute("name", jarName);
-         jar.addAttribute("specVersion", specVersion);
-         jar.addAttribute("specVendor", specVendor);
-         jar.addAttribute("specTitle", specTitle);
-         jar.addAttribute("implVersion", implVersion);
-         jar.addAttribute("implVendor", implVendor);
-         jar.addAttribute("implTitle", implTitle);
-         jar.addAttribute("implVendorID", implVendorID);
-         jar.addAttribute("implURL", implURL);
-         jar.addAttribute("sealed", ""+sealed);
-         jar.addAttribute("md5Digest", md5Digest);
-      }
-   }
-
-   public static void main(String[] args)
-      throws Exception
-   {
-      VersionRelease vr = new VersionRelease(args[0]);
-      vr.run();
-   }
-}

Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml	2010-04-09 07:00:12 UTC (rev 103733)
+++ trunk/build/pom.xml	2010-04-09 07:02:43 UTC (rev 103734)
@@ -7,11 +7,11 @@
 	</parent>
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.jboss.jbossas</groupId>
-  <artifactId>jboss-as-distribution</artifactId>
+  <artifactId>jboss-as-build</artifactId>
   <packaging>pom</packaging>
-  <name>JBoss Application Server Distribution</name>
+  <name>JBoss Application Server Build</name>
   <url>http://www.jboss.org/jbossas</url>
-  <description>JBoss Application Server Distribution</description>
+  <description>JBoss Application Server Build</description>
 
   <dependencies>
     
@@ -83,110 +83,6 @@
         </plugins>
       </build>
     </profile>    
-    <profile>
-      <id>dist-zip</id>
-      <activation>
-        <property>
-          <name>dist-zip</name>
-        </property>
-      </activation>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-assembly-plugin</artifactId>
-            <inherited>false</inherited>
-            <executions>
-              <execution>
-                <phase>package</phase>
-                <goals>
-                  <goal>single</goal>
-                </goals>
-                <configuration>
-                  <descriptors>
-                    <descriptor>src/assembly/jboss-dist.xml</descriptor>
-                  </descriptors>
-                </configuration>
-              </execution>
-            </executions>
-          </plugin>      
-        </plugins>
-      </build>
-    </profile>
-    <profile>
-      <id>release</id>
-      <activation>
-        <property>
-          <name>release</name>
-        </property>
-      </activation>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-antrun-plugin</artifactId>
-            <inherited>false</inherited>
-            <executions>
-              <execution>
-                <id>version-jars</id>
-                <phase>package</phase>
-                <goals>
-                  <goal>run</goal>
-                </goals>
-                <configuration>
-                  <tasks>
-                    <property name="jboss.dist.dir" value="${project.build.directory}/jboss-${project.version}" />
-                    <javac destdir="${project.build.directory}" executable="${env.JAVA_HOME}/bin/javac" 
-                        fork="true">
-                      <src path="."/>
-                      <classpath>
-                        <pathelement location="${jboss.dist.dir}/lib/dom4j.jar"/>
-                      </classpath>
-                      <include name="VersionRelease.java"/>
-                    </javac>
-                    <echo message="Versioning: jboss-${project.version}"/>
-                    <java classname="VersionRelease">
-                      <arg value="${jboss.dist.dir}"/>
-                      <classpath>
-                        <pathelement location="${project.build.directory}"/>
-                        <pathelement location="${jboss.dist.dir}/lib/dom4j.jar"/>
-                      </classpath>
-                      <sysproperty key="specification.title" value="${project.name}"/>
-                      <sysproperty key="specification.vendor" value="${project.organization.name}"/>
-                      <sysproperty key="specification.version" value="${project.version}"/>
-                      <sysproperty key="implementation.title" value="${project.name}"/>
-                      <sysproperty key="implementation.vendor" value="${project.organization.name}"/>
-                      <sysproperty key="implementation.vendor.id" value="${project.groupId}"/>
-                      <sysproperty key="implementation.version" value="${project.version}"/>
-                      <sysproperty key="implementation.url" value="${project.url}"/>
-                    </java>
-                  </tasks>
-                </configuration>
-              </execution>
-            </executions>
-          </plugin>      
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-assembly-plugin</artifactId>
-            <inherited>false</inherited>
-            <executions>
-              <execution>
-                <phase>package</phase>
-                <goals>
-                  <goal>single</goal>
-                </goals>
-                <configuration>
-                  <descriptors>
-                    <descriptor>src/assembly/jboss-dist.xml</descriptor>
-                    <descriptor>src/assembly/jboss-dist-src.xml</descriptor>
-                  </descriptors>
-                </configuration>
-              </execution>
-            </executions>
-          </plugin>      
-        </plugins>
-      </build>
-    </profile>
   </profiles>
   
   <distributionManagement>

Modified: trunk/depchain/pom.xml
===================================================================
--- trunk/depchain/pom.xml	2010-04-09 07:00:12 UTC (rev 103733)
+++ trunk/depchain/pom.xml	2010-04-09 07:02:43 UTC (rev 103734)
@@ -175,12 +175,24 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
+      <groupId>org.jboss.jbossas.osgi</groupId>
+      <artifactId>jboss-as-osgi-distribution</artifactId>
+      <version>${version}</version>
+      <type>pom</type>
+    </dependency>
+    <dependency>
       <groupId>org.jboss.jbossas</groupId>
       <artifactId>jboss-as-profileservice</artifactId>
       <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.jboss.jbossas</groupId>
+      <artifactId>resteasy-int-dist</artifactId>
+      <version>${project.version}</version>
+      <type>pom</type>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.jbossas</groupId>
       <artifactId>jboss-as-security</artifactId>
       <version>${project.version}</version>
     </dependency>


Property changes on: trunk/dist
___________________________________________________________________
Name: svn:ignore
   + .git
.metadata
target
bin
*.ipr
*.iws
*.iml
.idea
*.patch
.settings
.classpath
.project
build.log
local.properties


Copied: trunk/dist/VersionRelease.java (from rev 103730, trunk/build/VersionRelease.java)
===================================================================
--- trunk/dist/VersionRelease.java	                        (rev 0)
+++ trunk/dist/VersionRelease.java	2010-04-09 07:02:43 UTC (rev 103734)
@@ -0,0 +1,379 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.FileOutputStream;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.FileWriter;
+import java.math.BigInteger;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+import java.util.jar.JarEntry;
+import java.util.jar.JarOutputStream;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.TreeSet;
+
+import org.dom4j.Document;
+import org.dom4j.DocumentFactory;
+import org.dom4j.Element;
+import org.dom4j.io.OutputFormat;
+import org.dom4j.io.XMLWriter;
+
+/** A utility which goes through a standard dist build and tags every jar
+ * with the current build version using the jar file version manifest
+ * headers. The unique jars and their version info and md5 digests are
+ * output to the jboss.home/jar-versions.xml.
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class VersionRelease
+{
+   static byte[] buffer = new byte[4096];
+
+   /** The jboss dist root directory */
+   File jbossHome;
+   String specVersion;
+   String specVendor;
+   String specTitle;
+   String implTitle;
+   String implURL;
+   String implVersion;
+   String implVendor;
+   String implVendorID;
+   MessageDigest md5;
+   TreeSet jars = new TreeSet();
+
+   public VersionRelease(String homeDir)
+      throws FileNotFoundException, NoSuchAlgorithmException
+   {
+      jbossHome = new File(homeDir);
+      if( jbossHome.exists() == false )
+         throw new FileNotFoundException(jbossHome.getAbsolutePath() + " does not exist");
+      specTitle = System.getProperty("specification.title");
+      specVersion = System.getProperty("specification.version");
+      specVendor = System.getProperty("specification.vendor");
+      implTitle = System.getProperty("implementation.title");
+      implURL = System.getProperty("implementation.url");
+      implVersion = System.getProperty("implementation.version");
+      implVendor = System.getProperty("implementation.vendor");
+      implVendorID = System.getProperty("implementation.vendor.id");
+      md5 = MessageDigest.getInstance("MD5");
+   }
+
+   public void run()
+   {
+      processDir(jbossHome);
+      try
+      {
+         DocumentFactory df = DocumentFactory.getInstance();
+         Document doc = df.createDocument();
+         Element root = doc.addElement("jar-versions");
+         Iterator iter = jars.iterator();
+         while( iter.hasNext() )
+         {
+            JarInfo info = (JarInfo) iter.next();
+            info.writeXML(root);
+         }
+
+         File versionsXml = new File(jbossHome, "jar-versions.xml");
+         FileWriter versionInfo = new FileWriter(versionsXml);
+         OutputFormat outformat = OutputFormat.createPrettyPrint();
+         XMLWriter writer = new XMLWriter(versionInfo, outformat);
+         writer.setEscapeText(true);
+         writer.write(doc);
+         writer.flush();
+         versionInfo.close();
+      }
+      catch(IOException e)
+      {
+         e.printStackTrace();
+      }
+   }
+
+   void processDir(File dir)
+   {
+      File[] files = dir.listFiles();
+      for(int f = 0; f < files.length; f ++)
+      {
+         File child = files[f];
+         if( child.isDirectory() == true )
+            processDir(child);
+         else
+            processFile(child);
+      }
+   }
+   void processFile(File file)
+   {
+      System.out.println("Checking file: "+file);
+      // See if this is a jar archive
+      try
+      {
+         JarInfo info = new JarInfo(file, this);
+         info.write(md5);
+         jars.add(info);
+      }
+      catch(FileNotFoundException e)
+      {
+      }
+      catch(Exception e)
+      {
+         e.printStackTrace();
+      }
+   }
+
+   static class JarInfo implements Comparable
+   {
+      File file;
+      File tmpFile;
+
+      Manifest mf;
+      JarFile jarFile;
+      String jarName;
+      boolean sealed;
+      String md5Digest;
+      String specVersion;
+      String specVendor;
+      String specTitle;
+      String implTitle;
+      String implURL;
+      String implVersion;
+      String implVendor;
+      String implVendorID;
+
+      JarInfo(File file, VersionRelease release)
+         throws IOException
+      {
+         this.file = file;
+         this.jarName = file.getName();
+         this.tmpFile = new File(file.getAbsolutePath()+".tmp");
+         if( file.renameTo(tmpFile) == false )
+            throw new IOException("Failed to rename: "+file);
+
+         try
+         {
+            this.jarFile = new JarFile(tmpFile);
+         }
+         catch(IOException e)
+         {
+            tmpFile.renameTo(file);
+            throw new FileNotFoundException("Not a JarFile: "+file);
+         }
+
+         Manifest tmpMf = jarFile.getManifest();
+         this.mf = tmpMf == null ? new Manifest() : tmpMf;
+         Attributes mfAttrs = mf.getMainAttributes();
+
+         String sealedAttr = mfAttrs.getValue(Attributes.Name.SEALED);
+         sealed = Boolean.valueOf(sealedAttr).booleanValue();
+
+         specVersion = mfAttrs.getValue(Attributes.Name.SPECIFICATION_VERSION);
+         if( specVersion == null )
+         {
+            specVersion = release.specVersion;
+            mfAttrs.put(Attributes.Name.SPECIFICATION_VERSION, specVersion);
+         }
+         specVendor = mfAttrs.getValue(Attributes.Name.SPECIFICATION_VENDOR);
+         if( specVendor == null )
+         {
+            specVendor = release.specVendor;
+            mfAttrs.put(Attributes.Name.SPECIFICATION_VENDOR, specVendor);
+         }
+         specTitle = mfAttrs.getValue(Attributes.Name.SPECIFICATION_TITLE);
+         if( specTitle == null )
+         {
+            specTitle = release.specTitle;
+            mfAttrs.put(Attributes.Name.SPECIFICATION_TITLE, specTitle);
+         }
+
+         implTitle = mfAttrs.getValue(Attributes.Name.IMPLEMENTATION_TITLE);
+         if( implTitle == null )
+         {
+            implTitle = release.implTitle;
+            mfAttrs.put(Attributes.Name.IMPLEMENTATION_TITLE, implTitle);
+         }
+         implVersion = mfAttrs.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
+         if( implVersion == null )
+         {
+            implVersion = release.implVersion;
+            mfAttrs.put(Attributes.Name.IMPLEMENTATION_VERSION, implVersion);
+         }
+         implVendor = mfAttrs.getValue(Attributes.Name.IMPLEMENTATION_VENDOR);
+         if( implVendor == null )
+         {
+            implVendor = release.implVendor;
+            mfAttrs.put(Attributes.Name.IMPLEMENTATION_VENDOR, implVendor);
+         }
+         implVendorID = mfAttrs.getValue(Attributes.Name.IMPLEMENTATION_VENDOR_ID);
+         if( implVendorID == null )
+         {
+            implVendorID = release.implVendorID;
+            mfAttrs.put(Attributes.Name.IMPLEMENTATION_VENDOR_ID, implVendorID);
+         }
+         implURL = mfAttrs.getValue(Attributes.Name.IMPLEMENTATION_URL);
+         if( implURL == null )
+         {
+            implURL = release.implURL;
+            mfAttrs.put(Attributes.Name.IMPLEMENTATION_URL, implURL);
+         }
+      }
+
+      public void write(MessageDigest md5)
+         throws IOException
+      {
+         md5.reset();
+         if( sealed == true )
+         {
+            System.out.println("Skipping sealed jar: "+file);
+         }
+         else
+         {
+            FileOutputStream fos = new FileOutputStream(file);
+            JarOutputStream jos = new JarOutputStream(fos, mf);
+            Enumeration entries = jarFile.entries();
+            while( entries.hasMoreElements() )
+            {
+               JarEntry entry = (JarEntry) entries.nextElement();
+               String name = entry.getName();
+               if( name.equals("META-INF/MANIFEST.MF") )
+               {
+                  continue;
+               }
+
+               JarEntry outEntry = new JarEntry(entry.getName());
+               outEntry.setTime(entry.getTime());
+               if( entry.getComment() != null )
+                  outEntry.setComment(entry.getComment());
+               jos.putNextEntry(outEntry);
+               InputStream is = jarFile.getInputStream(entry);
+               int bytes = is.read(buffer);
+               while( bytes > 0 )
+               {
+                  jos.write(buffer, 0, bytes);
+                  bytes = is.read(buffer);
+               }
+               jos.closeEntry();
+            }
+            jarFile.close();
+            jos.close();
+            tmpFile.delete();
+         }
+
+         // Calculate the md5sum
+         FileInputStream fis = new FileInputStream(file);
+         int bytes = fis.read(buffer);
+         while( bytes > 0 )
+         {
+            md5.update(buffer, 0, bytes);
+            bytes = fis.read(buffer);
+         }
+         fis.close();
+         byte[] digest = md5.digest();
+         BigInteger bi = new BigInteger(-1, digest);
+         bi = bi.abs();
+         md5Digest = bi.toString(16);
+         System.out.println(file+", md5: "+md5Digest);
+      }
+
+      public int compareTo(Object o)
+      {
+         JarInfo info = (JarInfo) o;
+         return jarName.compareTo(info.jarName);
+      }
+      public boolean equals(Object o)
+      {
+         JarInfo info = (JarInfo) o;
+         return jarName.equals(info.jarName);
+      }
+      public int hashCode()
+      {
+         return jarName.hashCode();
+      }
+      /* Output an xml string element like:
+      <jar name='twiddle.jar' specVersion='3.2.4'
+            specVendor='JBoss (http://www.jboss.org/)'
+            specTitle='JBoss'
+            implVersion='3.2.4RC2 (build: CVSTag=Branch_3_2 date=200404182118)'
+            implVendor='JBoss.org'
+            implTitle='JBoss [WonderLand]'
+            implVendorID='http://www.jboss.org/'
+            implURL='http://www.jboss.org/'
+            sealed='false'
+            md5Digest='ebf8681b4e600cbe7bb2eff68c537c79' />
+      */
+      public String toString()
+      {
+         StringBuffer tmp = new StringBuffer("<jar name='");
+         tmp.append(jarName);
+         tmp.append("' specVersion='");
+         tmp.append(specVersion);
+         tmp.append("' specVendor='");
+         tmp.append(specVendor);
+         tmp.append("' specTitle='");
+         tmp.append(specTitle);
+         tmp.append("' implVersion='");
+         tmp.append(implVersion);
+         tmp.append("' implVendor='");
+         tmp.append(implVendor);
+         tmp.append("' implTitle='");
+         tmp.append(implTitle);
+         tmp.append("' implVendorID='");
+         tmp.append(implVendorID);
+         tmp.append("' implURL='");
+         tmp.append(implURL);
+         tmp.append("' sealed='");
+         tmp.append(sealed);
+         tmp.append("' md5Digest='");
+         tmp.append(md5Digest);
+         tmp.append("' />");
+         return tmp.toString();
+      }
+      public void writeXML(Element root)
+      {
+         Element jar = root.addElement("jar");
+         jar.addAttribute("name", jarName);
+         jar.addAttribute("specVersion", specVersion);
+         jar.addAttribute("specVendor", specVendor);
+         jar.addAttribute("specTitle", specTitle);
+         jar.addAttribute("implVersion", implVersion);
+         jar.addAttribute("implVendor", implVendor);
+         jar.addAttribute("implTitle", implTitle);
+         jar.addAttribute("implVendorID", implVendorID);
+         jar.addAttribute("implURL", implURL);
+         jar.addAttribute("sealed", ""+sealed);
+         jar.addAttribute("md5Digest", md5Digest);
+      }
+   }
+
+   public static void main(String[] args)
+      throws Exception
+   {
+      VersionRelease vr = new VersionRelease(args[0]);
+      vr.run();
+   }
+}

Copied: trunk/dist/pom.xml (from rev 103730, trunk/build/pom.xml)
===================================================================
--- trunk/dist/pom.xml	                        (rev 0)
+++ trunk/dist/pom.xml	2010-04-09 07:02:43 UTC (rev 103734)
@@ -0,0 +1,149 @@
+<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">
+	<parent>
+		<groupId>org.jboss.jbossas</groupId>
+		<artifactId>jboss-as-parent</artifactId>
+		<version>6.0.0-SNAPSHOT</version>
+	</parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.jbossas</groupId>
+  <artifactId>jboss-as-distribution</artifactId>
+  <packaging>pom</packaging>
+  <name>JBoss Application Server Distribution</name>
+  <url>http://www.jboss.org/jbossas</url>
+  <description>JBoss Application Server Distribution</description>
+
+  <dependencies>
+    
+    <!-- 
+      The Build is in charge of creating $JBOSS_HOME under its /target, so depend upon that
+      -->
+    <dependency>
+      <groupId>org.jboss.jbossas</groupId>
+      <artifactId>jboss-as-build</artifactId>
+      <version>${version}</version>
+      <optional>true</optional>
+      <type>pom</type>
+    </dependency>
+    
+  </dependencies>
+  
+  <profiles>
+    <profile>
+      <id>dist-zip</id>
+      <activation>
+        <property>
+          <name>dist-zip</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <inherited>false</inherited>
+            <executions>
+              <execution>
+                <phase>package</phase>
+                <goals>
+                  <goal>single</goal>
+                </goals>
+                <configuration>
+                  <descriptors>
+                    <descriptor>src/assembly/jboss-dist.xml</descriptor>
+                  </descriptors>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>      
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>release</id>
+      <activation>
+        <property>
+          <name>release</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <inherited>false</inherited>
+            <executions>
+              <execution>
+                <id>version-jars</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+                <configuration>
+                  <tasks>
+                    <property name="jboss.dist.dir" value="${basedir}/../build/target/jboss-${project.version}" />
+                    <mkdir dir="${project.build.directory}" />
+                    <javac destdir="${project.build.directory}" executable="${env.JAVA_HOME}/bin/javac" 
+                        fork="true">
+                      <src path="."/>
+                      <classpath>
+                        <pathelement location="${jboss.dist.dir}/lib/dom4j.jar"/>
+                      </classpath>
+                      <include name="VersionRelease.java"/>
+                    </javac>
+                    <echo message="Versioning: jboss-${project.version}"/>
+                    <java classname="VersionRelease">
+                      <arg value="${jboss.dist.dir}"/>
+                      <classpath>
+                        <pathelement location="${project.build.directory}"/>
+                        <pathelement location="${jboss.dist.dir}/lib/dom4j.jar"/>
+                      </classpath>
+                      <sysproperty key="specification.title" value="${project.name}"/>
+                      <sysproperty key="specification.vendor" value="${project.organization.name}"/>
+                      <sysproperty key="specification.version" value="${project.version}"/>
+                      <sysproperty key="implementation.title" value="${project.name}"/>
+                      <sysproperty key="implementation.vendor" value="${project.organization.name}"/>
+                      <sysproperty key="implementation.vendor.id" value="${project.groupId}"/>
+                      <sysproperty key="implementation.version" value="${project.version}"/>
+                      <sysproperty key="implementation.url" value="${project.url}"/>
+                    </java>
+                  </tasks>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <inherited>false</inherited>
+            <executions>
+              <execution>
+                <phase>package</phase>
+                <goals>
+                  <goal>single</goal>
+                </goals>
+                <configuration>
+                  <descriptors>
+                    <descriptor>src/assembly/jboss-dist.xml</descriptor>
+                    <descriptor>src/assembly/jboss-dist-src.xml</descriptor>
+                  </descriptors>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>      
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+  
+  <distributionManagement>
+    <snapshotRepository>
+      <id>jboss-snapshots</id>
+      <name>JBoss Snapshot Repository</name>
+      <url>dav:https://snapshots.jboss.org/maven2</url>
+      <!-- Need to set unique version to false to prevent large amounts of data building up in the snapshot repo -->
+      <uniqueVersion>false</uniqueVersion>
+    </snapshotRepository>
+  </distributionManagement>
+  
+</project>

Copied: trunk/dist/src/assembly (from rev 103730, trunk/build/src/assembly)

Modified: trunk/dist/src/assembly/jboss-dist-src.xml
===================================================================
--- trunk/build/src/assembly/jboss-dist-src.xml	2010-04-09 05:46:26 UTC (rev 103730)
+++ trunk/dist/src/assembly/jboss-dist-src.xml	2010-04-09 07:02:43 UTC (rev 103734)
@@ -7,7 +7,7 @@
   <fileSets>
     <fileSet>
       <directory>..</directory>
-      <outputDirectory>/jboss-${project.version}-src</outputDirectory>
+      <outputDirectory>${project.build.dir}/jboss-${project.version}-src</outputDirectory>
       <excludes>
         <exclude>**/target/**</exclude>
         <exclude>**/output/**</exclude>
@@ -16,11 +16,11 @@
     </fileSet>
     <fileSet>
       <directory>..</directory>
-      <outputDirectory>/jboss-${project.version}-src</outputDirectory>
+      <outputDirectory>${project.build.dir}/jboss-${project.version}-src</outputDirectory>
       <includes>
         <include>tools/**/bin/*</include>
       </includes>
       <fileMode>0755</fileMode>
     </fileSet>
   </fileSets>
-</assembly>
\ No newline at end of file
+</assembly>

Modified: trunk/dist/src/assembly/jboss-dist.xml
===================================================================
--- trunk/build/src/assembly/jboss-dist.xml	2010-04-09 05:46:26 UTC (rev 103730)
+++ trunk/dist/src/assembly/jboss-dist.xml	2010-04-09 07:02:43 UTC (rev 103734)
@@ -6,8 +6,8 @@
   <includeBaseDirectory>false</includeBaseDirectory>
   <fileSets>
     <fileSet>
-      <directory>${project.build.directory}/jboss-${project.version}</directory>
-      <outputDirectory>/jboss-${project.version}</outputDirectory>
+      <directory>${basedir}/../build/target/jboss-${project.version}</directory>
+      <outputDirectory>${project.build.dir}/jboss-${project.version}</outputDirectory>
       <excludes>
         <exclude>**/data/**</exclude>
         <exclude>**/log/**</exclude>
@@ -17,8 +17,8 @@
       </excludes>
     </fileSet>
     <fileSet>
-      <directory>${project.build.directory}/jboss-${project.version}</directory>
-      <outputDirectory>/jboss-${project.version}</outputDirectory>
+      <directory>${basedir}/../build/target/jboss-${project.version}</directory>
+      <outputDirectory>${project.build.dir}/jboss-${project.version}</outputDirectory>
       <includes>
         <include>bin/*</include>
       </includes>
@@ -26,7 +26,7 @@
     </fileSet>
     <fileSet>
       <directory>docs</directory>
-      <outputDirectory>/jboss-${project.version}</outputDirectory>
+      <outputDirectory>${project.build.dir}/jboss-${project.version}</outputDirectory>
     </fileSet>
   </fileSets>
-</assembly>
\ No newline at end of file
+</assembly>

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2010-04-09 07:00:12 UTC (rev 103733)
+++ trunk/pom.xml	2010-04-09 07:02:43 UTC (rev 103734)
@@ -555,6 +555,7 @@
         <module>console</module>
         <module>depchain</module>
         <module>deployment</module>
+        <module>dist</module>
         <module>ejb3</module>
         <module>hibernate-int</module>
         <module>hornetq-int</module>




More information about the jboss-cvs-commits mailing list