Scarab commit: svn commit: r11161 - branches/20120417_mavenPort: . src/conf/conf src/schema src/sql/mysql

[email protected] Tue, 17 Apr 2012 01:30:46 -0700 (PDT)
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: mcoss
Date: 2012-04-17 01:30:46-0700
New Revision: 11161

Added:
   branches/20120417_mavenPort/source-archives.xml
   branches/20120417_mavenPort/src/schema/id_table-schema.xml
      - copied unchanged from r11156, /branches/20120417_mavenPort/src/schema/id-table-schema.xml
Removed:
   branches/20120417_mavenPort/src/schema/id-table-schema.xml
Modified:
   branches/20120417_mavenPort/pom.xml
   branches/20120417_mavenPort/src/conf/conf/intake.xml
   branches/20120417_mavenPort/src/sql/mysql/create-db.sql

Log:
FIX - Adaptations in scarab sources for new maven build: clean, create-db (mysql only), packaging + archives.
  CHG - Dependencies in pom.xml were revised.

Modified: branches/20120417_mavenPort/pom.xml
Url: http://scarab.tigris.org/source/browse/scarab/branches/20120417_mavenPort/pom.xml?view=diff&pathrev=11161&r1=11160&r2=11161
==============================================================================
--- branches/20120417_mavenPort/pom.xml	(original)
+++ branches/20120417_mavenPort/pom.xml	2012-04-17 01:30:46-0700
@@ -164,9 +164,16 @@
 			Build
 ###########################################################################################-->
 
-<build>
-       <sourceDirectory>${basedir}/src</sourceDirectory>
+<build>
+       <sourceDirectory>${basedir}/src/java</sourceDirectory>
        <testSourceDirectory>${basedir}/src/test</testSourceDirectory>
+       <testResources>
+	      <testResource>
+	        <directory>src/conf/classes</directory>
+	      </testResource>
+	    </testResources>
+       
+       <finalName>${artifactId}</finalName>
        <plugins>
 	   
 		<!--
@@ -191,19 +198,33 @@
               <fileset>
                 <directory>${basedir}/src/java/org/tigris/scarab/om</directory>
                 <includes>
+					<!-- remove generated om java files -->
                     <include>Base*.java</include>
-                    <include>map/*.java</include>
+					<include>Turbine*.java</include>
+					<include>NotificationDefault*.java</include>
+					<include>ScarabRole*.java</include>
+					<include>IdTable*.java</include>
+                    <include>TransactionsPer*.java</include>
+					<include>map/*.java</include>
                 </includes>
               </fileset>
-              <fileset>
+			  <fileset>
                 <directory>${basedir}/src/java</directory>
                 <includes>
-                  <include>report.*.generation</include>
+                    <include>*.sql</include>
+                    <include>report.*.generation</include>
                 </includes>
-              </fileset>              
+              </fileset>
+			   <fileset>
+                <directory>${basedir}/src/conf/conf</directory>
+                <includes>
+                    <include>defaultCustom.properties</include>
+                    <include>custom.properties</include>
+                </includes>
+              </fileset>
             </filesets>
             </configuration>
-          </plugin>          
+          </plugin> 
 
 		<!--
 			Maven plugin for torque tasks:
@@ -216,12 +237,8 @@
           <groupId>org.apache.db.torque</groupId>
           <artifactId>torque-maven-plugin</artifactId>
           <configuration>
-            <targetDatabase>mysql</targetDatabase>
+            <targetDatabase>${scarab.database.type}</targetDatabase>
             <targetPackage>org.tigris.scarab.om</targetPackage>
-            <driver>org.gjt.mm.mysql.Driver</driver>
-            <url>jdbc:mysql://localhost:3306/scarab</url>
-            <user>root</user>
-            <password/>
             <baseOutputDir>${basedir}/src/java</baseOutputDir>
             <outputDir>src/java</outputDir>
             <baseReportFile>report.${project.artifact.artifactId}.om.base.generation</baseReportFile>
@@ -237,7 +254,6 @@
               <phase>generate-sources</phase>
               <goals>
                 <goal>om</goal>
-                <goal>documentation</goal>
               </goals>
             </execution>
           </executions>
@@ -256,7 +272,7 @@
 		<plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-war-plugin</artifactId>
-            <version>2.0.2</version>
+            <version>2.2</version>
             <configuration>
                <warName>scarab</warName>
                <containerConfigXML>tomcat/conf/server.xml</containerConfigXML>
@@ -264,16 +280,96 @@
                <webResources>
                  <resource>
                    <directory>src/conf/conf</directory>
-                   <targetPath>WEB-INF/classes</targetPath>
                    <targetPath>WEB-INF/conf</targetPath>
+				   <filtering>true</filtering>
+                 </resource>
+				  <resource>
+                   <directory>src/conf/classes</directory>
+                   <targetPath>WEB-INF/classes</targetPath>
                  </resource>
                  <resource>
                    <directory>src/webapp</directory>
                  </resource>
-               </webResources>
+               </webResources>
             </configuration>
+            <executions>
+	            <execution>
+	              <phase>generate-test-resources</phase>
+	              <goals>
+	                <goal>war</goal>
+	              </goals>
+	            </execution>
+          	</executions>
           </plugin>
-    </plugins>
+		  
+		  <!--
+			Initialize database and other Scarab related stuff:
+				- init-db : fill database
+				- generateProperties : create defaultCustom.properties
+		  -->
+		  <plugin>
+			<groupId>org.tigris.scarab</groupId>
+			<artifactId>scarab-maven-plugin</artifactId>
+			<version>1.0-SNAPSHOT</version>
+			<configuration>
+				<dbType>${scarab.database.type}</dbType>
+				<dbUser>${scarab.database.admin.username}</dbUser>
+				<dbPassword>${scarab.database.admin.password}</dbPassword>
+				<dbServerUrl>${jdbc}:${scarab.jdbc.handler}://${scarab.database.host}:${scarab.database.port}</dbServerUrl>
+				<dbFullUrl>${scarab.database.url}</dbFullUrl>
+				<dbDriver>${scarab.database.jdbc.driver}</dbDriver>
+				<configurationDirectory>src/conf/conf</configurationDirectory>
+			</configuration>
+			<executions>
+				<execution><id>package</id><phase>validate</phase><goals><goal>generate-custom-properties</goal></goals></execution>
+				<execution><id>site</id><phase>pre-site</phase><goals><goal>prepare-site-docs</goal></goals></execution>
+            </executions>
+			 <dependencies>
+				<dependency>
+				  <artifactId>mysql-connector-java</artifactId>
+				  <groupId>mysql</groupId>
+				  <version>5.1.18</version>
+				</dependency>
+			    <dependency>
+			      <groupId>hsqldb</groupId>
+			      <artifactId>hsqldb</artifactId>
+			      <version>1.8.0.7</version>
+			    </dependency>
+			</dependencies>
+		  </plugin>
+		  
+		  <!--
+			Read in defaultCustom.properties during "initialize"
+		  -->
+		  <plugin>
+			<groupId>org.codehaus.mojo</groupId>
+			<artifactId>properties-maven-plugin</artifactId>
+			<version>1.0-alpha-2</version>
+				<configuration>
+					<files>
+						<file>src/conf/conf/defaultCustom.properties</file>
+					</files>
+				</configuration>
+				<executions>
+					<execution><phase>initialize</phase><goals><goal>read-project-properties</goal></goals></execution>
+				</executions>
+		  </plugin>
+		  
+	
+		<!-- 
+			Build of Scarab source archives 
+		-->		
+		<plugin>
+	        <artifactId>maven-assembly-plugin</artifactId>
+	        <version>2.3</version>
+	        <configuration>
+	          <descriptors>
+	            <descriptor>source-archives.xml</descriptor>
+	          </descriptors>
+	        </configuration>
+		</plugin>
+		  
+    </plugins>
  </build>
  
 <!--######################################################################################
@@ -281,11 +377,17 @@
 ###########################################################################################-->
 
  <dependencies>
-   <dependency>
-     <groupId>rome</groupId>
-     <artifactId>rome</artifactId>
-     <version>0.8</version>
-   </dependency>  
+	<dependency>
+     <groupId>javax.servlet</groupId>
+     <artifactId>servlet-api</artifactId>
+     <version>2.5</version>
+	 <scope>provided</scope>
+   </dependency>  
+   <dependency>
+     <groupId>rome</groupId>
+     <artifactId>rome</artifactId>
+     <version>0.8</version>
+   </dependency>  
    <dependency>
      <groupId>jdom</groupId>
      <artifactId>jdom</artifactId>
@@ -294,13 +396,12 @@
    <dependency>
      <groupId>javax.activation</groupId>
      <artifactId>activation</artifactId>
-     <version>1.0.2</version>
+     <version>1.1.1</version>
    </dependency>
    <dependency>
      <groupId>axis</groupId>
      <artifactId>axis</artifactId>
-     <version>1.4</version>
-     <scope>runtime</scope>
+     <version>1.1</version>
    </dependency>
    <dependency>
      <groupId>commons-configuration</groupId>
@@ -312,11 +413,17 @@
       <artifactId>commons-email</artifactId>
       <version>1.0</version>
     </dependency>
-    <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-      <version>2.4</version>
-    </dependency>
+	<dependency>
+	  <groupId>geronimo-spec</groupId>
+      <artifactId>geronimo-spec-javamail</artifactId>
+      <version>1.3.1-rc3</version>
+	  <scope>provided</scope><!-- sun's javamail is used -->
+	</dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.3</version>
+    </dependency>
     <dependency>
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
@@ -342,19 +449,39 @@
       <artifactId>commons-fileupload</artifactId>
       <version>1.1.1</version>
     </dependency>
+	<dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+      <version>1.3</version>
+    </dependency>
     <dependency>
       <groupId>dnsjava</groupId>
       <artifactId>dnsjava</artifactId>
       <version>1.3.2</version>
     </dependency>
     <dependency>
-      <groupId>dom4j</groupId>
-      <artifactId>dom4j</artifactId>
-      <version>1.3</version>
+      <groupId>dom4j</groupId>
+      <artifactId>dom4j</artifactId>
+      <version>1.3</version>
     </dependency>
-
-    <dependency>
-      <groupId>oro</groupId>
+	<dependency>
+      <groupId>javax.mail</groupId>
+      <artifactId>mail</artifactId>
+      <version>1.4.4</version>
+    </dependency>
+	<dependency>
+      <groupId>javax.xml</groupId>
+      <artifactId>jaxrpc</artifactId>
+      <version>1.1</version>
+    </dependency>
+	<dependency>
+		<groupId>aspectj</groupId>
+		<artifactId>aspectjrt</artifactId>
+		<version>1.2.1</version>
+	</dependency>
+	
+    <dependency>
+      <groupId>oro</groupId>
       <artifactId>oro</artifactId>
       <version>2.0.7</version>
     </dependency>
@@ -415,35 +542,83 @@
     </dependency>
     <dependency>
       <groupId>xstream</groupId>
-      <artifactId>xstream</artifactId>
-      <version>1.0.2</version>
+      <artifactId>xstream</artifactId>
+      <version>1.0.2</version>
     </dependency>  
     <dependency>
-      <groupId>cactus</groupId>
-      <artifactId>cactus</artifactId>
-      <version>13-1.7.2</version>
-    </dependency>
-  <!-- Avalon Container and Components -->
-    <dependency>
-      <groupId>fulcrum</groupId>
-      <artifactId>fulcrum-cache</artifactId>
-      <version>1.0.5</version>
-    </dependency>
-    <dependency>
-      <groupId>fulcrum</groupId>
-      <artifactId>fulcrum-localization</artifactId>
-      <version>1.0.5</version>
-    </dependency>    
-    <dependency>
-      <groupId>fulcrum</groupId>
-      <artifactId>fulcrum-pool</artifactId>
-      <version>1.0.3</version>
-    </dependency>
+      <groupId>bsh</groupId>
+      <artifactId>bsh</artifactId>
+      <version>2.0b1</version>
+    </dependency> 
     <dependency>
-      <groupId>fulcrum</groupId>
-      <artifactId>fulcrum-factory</artifactId>
-      <version>1.0.3</version>
-    </dependency>
+      <groupId>commons-jelly</groupId>
+      <artifactId>commons-jelly-tags-interaction</artifactId>
+      <version>1.0</version>
+    </dependency>              
+   <dependency>
+     <groupId>opensymphony</groupId>
+     <artifactId>quartz</artifactId>
+     <version>1.5.0</version>
+   </dependency>     
+   <dependency>
+     <groupId>org.samba.jcifs</groupId>
+     <artifactId>jcifs</artifactId>
+     <version>1.2.6</version>
+   </dependency>     
+   <dependency>
+     <groupId>radeox</groupId>
+     <artifactId>radeox</artifactId>
+     <version>1.0-b2</version>
+   </dependency>
+   <dependency>
+     <groupId>radeox</groupId>
+     <artifactId>radeox-api</artifactId>
+     <version>1.0-b2</version>
+   </dependency>
+   <dependency>
+     <groupId>net.sf.saxon</groupId>
+     <artifactId>saxon</artifactId>
+     <version>8.7</version>
+   </dependency>  
+   <dependency>
+     <groupId>net.sf.saxon</groupId>
+     <artifactId>saxon-dom</artifactId>
+     <version>8.7</version>
+   </dependency>   
+   <dependency>
+     <groupId>net.sf.saxon</groupId>
+     <artifactId>saxon-xpath</artifactId>
+     <version>8.7</version>
+   </dependency>
+     <!-- was former Scarab depend
+   <dependency>
+     <groupId>stratum</groupId>
+     <artifactId>stratum</artifactId>
+     <version>1.0</version>
+   </dependency--> 
+
+    
+  <!-- Avalon Container and Components -->
+    <dependency>
+      <groupId>fulcrum</groupId>
+      <artifactId>fulcrum-cache</artifactId>
+      <version>1.0.5</version>
+    </dependency>
+    <dependency>
+      <groupId>fulcrum</groupId>
+      <artifactId>fulcrum-localization</artifactId>
+      <version>1.0.5</version>
+    </dependency>    
+    <dependency>
+      <groupId>fulcrum</groupId>
+      <artifactId>fulcrum-pool</artifactId>
+      <version>1.0.3</version>
+    </dependency>
+    <dependency>
+      <groupId>fulcrum</groupId>
+      <artifactId>fulcrum-factory</artifactId>
+      <version>1.0.3</version>
+    </dependency>
     <dependency>
       <groupId>fulcrum</groupId>
       <artifactId>fulcrum-mimetype</artifactId>
@@ -475,11 +650,35 @@
       <version>4.2.0</version>
     </dependency>
     <dependency>
-      <groupId>avalon-framework</groupId>
-      <artifactId>avalon-framework-impl</artifactId>
-      <version>4.2.0</version>
-    </dependency>         
+      <groupId>avalon-framework</groupId>
+      <artifactId>avalon-framework-impl</artifactId>
+      <version>4.2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>fulcrum</groupId>
+      <artifactId>fulcrum-xmlrpc</artifactId>
+      <version>1.0.5</version>
+    </dependency>
+    <dependency>
+      <groupId>fulcrum</groupId>
+      <artifactId>fulcrum-testcontainer</artifactId>
+      <version>1.0.4</version>
+    </dependency> 
     
+    <!-- hack to provide other velocity version during runtime as transitive depends say -->
+    <dependency>
+    	<groupId>velocity</groupId>
+    	<artifactId>velocity</artifactId>
+    	<version>1.5</version>
+    	<scope>provided</scope>
+    </dependency>
+    <dependency>
+    	<groupId>org.apache.velocity</groupId>
+    	<artifactId>velocity</artifactId>
+    	<version>1.6.3</version>
+    	<scope>runtime</scope>
+    </dependency>     
+    
   <!-- Begin Database Dependencies -->
 
     <!-- MySQL 4.0/4.1 / InnoDB
@@ -503,65 +702,12 @@
     <!-- Hypersonic (HSQLDB) -->
     <dependency>
       <groupId>hsqldb</groupId>
-      <artifactId>hsqldb</artifactId>
-      <version>1.8.0.7</version>
-    </dependency>        
-    
-  <!-- End Database Dependencies -->    
-    <dependency> 
-      <groupId>maven-plugins</groupId> 
-      <artifactId>maven-findbugs-plugin</artifactId> 
-      <version>1.3.1</version> 
-      <type>plugin</type>
-    </dependency> 
-    
-    <dependency> 
-      <groupId>statcvs</groupId> 
-      <artifactId>maven-statcvs-plugin</artifactId> 
-      <version>2.4</version> 
-      <type>plugin</type>
-    </dependency>    
-
-    <!-- Needed for Building -->
-    <dependency>
-      <groupId>bsh</groupId>
-      <artifactId>bsh</artifactId>
-      <version>2.0b1</version>
-    </dependency>   
-    <dependency>
-      <groupId>commons-jelly</groupId>
-      <artifactId>commons-jelly-tags-interaction</artifactId>
-      <version>1.0</version>
-    </dependency>     
-    <dependency>
-      <groupId>fulcrum</groupId>
-      <artifactId>fulcrum-xmlrpc</artifactId>
-      <version>1.0.5</version>
-    </dependency>
-    
-    <!-- Needed for testing -->
-    <dependency>
-      <groupId>fulcrum</groupId>
-      <artifactId>fulcrum-testcontainer</artifactId>
-      <version>1.0.4</version>
-    </dependency>        
-   <dependency>
-     <groupId>opensymphony</groupId>
-     <artifactId>quartz</artifactId>
-     <version>1.5.0</version>
-   </dependency>     
-   <dependency>
-     <groupId>org.samba.jcifs</groupId>
-     <artifactId>jcifs</artifactId>
-     <version>1.2.6</version>
-   </dependency>     
-   <dependency>
-     <groupId>radeox</groupId>
-     <artifactId>radeox</artifactId>
-     <version>1.0-b2</version>
-   </dependency> 
-  </dependencies>
-  
+      <artifactId>hsqldb</artifactId>
+      <version>1.8.0.7</version>
+    </dependency>         
+
+  </dependencies>
+  
   <properties>
   	<sonar.light>true</sonar.light>
   </properties>

Added: branches/20120417_mavenPort/source-archives.xml
Url: http://scarab.tigris.org/source/browse/scarab/branches/20120417_mavenPort/source-archives.xml?view=markup&pathrev=11161
==============================================================================
--- (empty file)
+++ branches/20120417_mavenPort/source-archives.xml	2012-04-17 01:30:46-0700
@@ -0,0 +1,44 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+  <id>src</id>
+  <baseDirectory>/</baseDirectory>
+  <formats>
+    <format>zip</format>
+	<format>tar.gz</format>
+  </formats>
+  <fileSets>
+  	<fileSet>
+      <directory>build</directory>
+	  <outputDirectory>build</outputDirectory>
+    </fileSet>
+	<fileSet>
+      <directory>src</directory>
+	  <outputDirectory>src</outputDirectory>
+    </fileSet>
+	<fileSet>
+      <directory>extensions</directory>
+	  <outputDirectory>extensions</outputDirectory>
+    </fileSet>
+	<fileSet>
+      <directory>tomcat</directory>
+	  <outputDirectory>tomcat</outputDirectory>
+    </fileSet>
+	<fileSet>
+      <directory>xdocs</directory>
+	  <outputDirectory>xdocs</outputDirectory>
+    </fileSet>
+	<fileSet>
+      <directory>www</directory>
+	  <outputDirectory>www</outputDirectory>
+    </fileSet>
+	<fileSet>
+      <includes>
+		<include>*.xml</include>
+		<include>*.xsl</include>
+		<include>*.bat</include>
+		<include>*.sh</include>
+		<include>*.properties</include>
+	  </includes>
+    </fileSet>	
+  </fileSets>
+</assembly>

Modified: branches/20120417_mavenPort/src/conf/conf/intake.xml
Url: http://scarab.tigris.org/source/browse/scarab/branches/20120417_mavenPort/src/conf/conf/intake.xml?view=diff&pathrev=11161&r1=11160&r2=11161
==============================================================================
--- branches/20120417_mavenPort/src/conf/conf/intake.xml	(original)
+++ branches/20120417_mavenPort/src/conf/conf/intake.xml	2012-04-17 01:30:46-0700
@@ -384,7 +384,7 @@
         </field>
         <field name="Code" key="code" type="String">
             <rule name="mask" value="^[:alpha:]+$">intake_CodeMustBeAlpha</rule>
-            <rule name="maxLength" value="@SCARAB_MODULE_CODE_LENGTH@"/>
+            <rule name="maxLength" value="${scarab.module.code.length}"/>
         </field>
         <!--
         <field name="Url" key="url" type="String">
@@ -480,7 +480,7 @@
         <required-message>intake_FieldRequired</required-message>
     </field>
     <field name="File" key="d" type="FileItem">
-        <rule name="maxLength" value="@SCARAB_FILE_MAX_SIZE@">intake_MaxFileUploadSizeExceeded</rule>
+        <rule name="maxLength" value="${scarab.file.max.size}">intake_MaxFileUploadSizeExceeded</rule>
         <required-message>intake_NoFile</required-message>
     </field>
     <!-- two different fields are used because there is an 'other' field -->

Removed: branches/20120417_mavenPort/src/schema/id-table-schema.xml
Url: http://scarab.tigris.org/source/browse/scarab/branches/20120417_mavenPort/src/schema/id-table-schema.xml?view=markup&pathrev=11160

Modified: branches/20120417_mavenPort/src/sql/mysql/create-db.sql
Url: http://scarab.tigris.org/source/browse/scarab/branches/20120417_mavenPort/src/sql/mysql/create-db.sql?view=diff&pathrev=11161&r1=11160&r2=11161
==============================================================================
--- branches/20120417_mavenPort/src/sql/mysql/create-db.sql	(original)
+++ branches/20120417_mavenPort/src/sql/mysql/create-db.sql	2012-04-17 01:30:46-0700
@@ -1,3 +1,3 @@
-drop database if exists @DB_NAME@;
-create database @DB_NAME@;
-grant all on @DB_NAME@.* to @DATABASE_USERNAME@ identified by '@DATABASE_PASSWORD@';
\ No newline at end of file
+drop database if exists ${scarab.database.name};
+create database ${scarab.database.name};
+grant all on ${scarab.database.name}.* to ${scarab.database.username} identified by '${scarab.database.password}';
\ No newline at end of file

------------------------------------------------------
http://scarab.tigris.org/ds/viewMessage.do?dsForumId=3577&dsMessageId=2949028