[jboss-cvs] JBossAS SVN: r90196 - branches/JBPAPP_5_0/build.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jun 15 10:59:48 EDT 2009


Author: smarlow at redhat.com
Date: 2009-06-15 10:59:48 -0400 (Mon, 15 Jun 2009)
New Revision: 90196

Modified:
   branches/JBPAPP_5_0/build/build.xml
Log:
JBPAPP-2052 first pass at EAP 5 production profile support.  Currently, no WEB and no SecurityManager.  This file needs to be tweaked and the configuration changes are not implemented yet.

Modified: branches/JBPAPP_5_0/build/build.xml
===================================================================
--- branches/JBPAPP_5_0/build/build.xml	2009-06-15 13:10:49 UTC (rev 90195)
+++ branches/JBPAPP_5_0/build/build.xml	2009-06-15 14:59:48 UTC (rev 90196)
@@ -176,6 +176,10 @@
         <include groups="core, basic, standard, optional"/>
       </group>
 
+      <group name="production">
+        <include groups="core, basic, standard, optional"/>
+      </group>
+
     </moduleconfig>
 
     <!-- Show the module configuration -->
@@ -257,6 +261,13 @@
     <property name="install.all.conf" value="${install.all}/conf"/>
     <property name="install.all.deploy.hasingleton" value="${install.all}/deploy-hasingleton"/>
 
+    <property name="install.production" value="${install.server}/production"/>
+    <property name="install.production.lib" value="${install.production}/lib"/>
+    <property name="install.production.deploy" value="${install.production}/deploy"/>
+    <property name="install.production.deployers" value="${install.production}/deployers"/>
+    <property name="install.production.conf" value="${install.production}/conf"/>
+    <property name="install.production.deploy.hasingleton" value="${install.production}/deploy-hasingleton"/>
+
     <property name="install.default" value="${install.server}/default"/>
     <property name="install.default.lib" value="${install.default}/lib"/>
     <property name="install.default.deploy" value="${install.default}/deploy"/>
@@ -269,11 +280,13 @@
     <property name="install.minimal.deployers" value="${install.minimal}/deployers"/>
     <property name="install.minimal.conf" value="${install.minimal}/conf"/>
 
+    <!-- WEB PROFILE MIGHT BE REMOVED FROM EAP 5 AS PER EMAIL THREAD -->
     <property name="install.web" value="${install.server}/web"/>
     <property name="install.web.lib" value="${install.web}/lib"/>
     <property name="install.web.deploy" value="${install.web}/deploy"/>
     <property name="install.web.deployers" value="${install.web}/deployers"/>
     <property name="install.web.conf" value="${install.web}/conf"/>
+    <!-- WEB PROFILE MIGHT BE REMOVED FROM EAP 5 AS PER EMAIL THREAD -->
 
     <property name="install.standard" value="${install.server}/standard"/>
     <property name="install.standard.lib" value="${install.standard}/lib"/>
@@ -699,11 +712,371 @@
      depends="partition-build"
      />
 
+  <!-- THE FOLLOWING IS BASED ON EAP4 AND PROBABLY NEEDS CHANGES -->
+  <!-- Partition the default single configuration build into a all, production,
+  default and minimal configs with a minimal set of jars in the root lib dir.
+  -->
+  <target name="partition-build" depends="init">
+    <antcall target="partition-community"/>
+    <antcall target="partition-production"/>
+    <!-- antcall target="makeConfigChanges"/ -->
+    <antcall target="processSecurityAnnotations"/>
+    <antcall target="jboss-all-client"/>
+    <!--<antcall target="setup-ejb3-dist"/>-->
+  </target>
+
+  <!-- Update config files -->
+  <target name="makeConfigChanges" 
+          depends="makeProductionConfigChanges">
+
+     <!-- Fix up the EOL characters for Windows files -->
+     <!-- antcall target="fixEOL"/ -->
+     
+     <replaceregexp file="${install.examples}/binding-manager/sample-bindings.xml"
+         flags="gm"
+         match="@.*${verconf.to.keep}\s"
+         replace=""
+     />
+
+     <replaceregexp file="${install.examples}/binding-manager/sample-bindings.xml"
+         flags="gs"
+         match="@${verconf.to.delete}((?!@END.*CONF).)*@END${verconf.to.delete}\s"
+         replace=""
+     />
+  
+     <replaceregexp file="${install.production.conf}/login-config.xml"
+         flags="gm"
+         match="@.*${verconf.to.keep}\s"
+         replace=""
+     />
+
+     <replaceregexp file="${install.production.conf}/login-config.xml"
+         flags="gs"
+         match="@${verconf.to.delete}((?!@END.*CONF).)*@END${verconf.to.delete}\s"
+         replace=""
+     />
+  
+     <replaceregexp file="${install.default.conf}/login-config.xml"
+         flags="gm"
+         match="@.*${verconf.to.keep}\s"
+         replace=""
+     />
+
+     <replaceregexp file="${install.default.conf}/login-config.xml"
+         flags="gs"
+         match="@${verconf.to.delete}((?!@END.*CONF).)*@END${verconf.to.delete}\s"
+         replace=""
+     />
+  
+     <replaceregexp file="${install.all.conf}/login-config.xml"
+         flags="gm"
+         match="@.*${verconf.to.keep}\s"
+         replace=""
+     />
+
+     <replaceregexp file="${install.all.conf}/login-config.xml"
+         flags="gs"
+         match="@${verconf.to.delete}((?!@END.*CONF).)*@END${verconf.to.delete}\s"
+         replace=""
+     />
+
+  </target>
+
+
+  <!-- Update config and other files for production config -->
+  <target name="makeProductionConfigChanges" 
+          depends="partition-community,partition-production">
+
+     <ant antfile="build.xml" target="updateConfigFiles">
+         <property name="config.type" value="dev" />
+         <property name="config.dir" value="${install.all}" />
+     </ant>
+
+     <ant antfile="build.xml" target="updateConfigFiles">
+         <property name="config.type" value="dev" />
+         <property name="config.dir" value="${install.default}" />
+     </ant>
+
+     <ant antfile="build.xml" target="updateConfigFiles">
+         <property name="config.type" value="prod" />
+         <property name="config.dir" value="${install.production}" />
+     </ant>
+      
+  </target>
+
+  <!-- Modify run.sh for production config -->
+  <target name="updateConfigFiles">
+
+        <property name="config.type" value=""/>
+        <property name="config.dir" value=""/>
+
+        <condition property="conf.to.keep" value="DEVCONF" else="PRODCONF">
+            <equals arg1="${config.type}" arg2="dev"/>
+        </condition>
+
+        <condition property="conf.to.delete" value="PRODCONF" else="DEVCONF">
+            <equals arg1="${config.type}" arg2="dev"/>
+        </condition>
+ 
+       <!-- Uncomment the configuration to make the key generation cluster safe -->
+
+        <replaceregexp file="${config.dir}/deploy/uuid-key-generator.sar/META-INF/jboss-service.xml"
+            flags="gm"
+            match="@.*${conf.to.keep}\s"
+            replace=""
+        />
+
+        <replaceregexp file="${config.dir}/deploy/uuid-key-generator.sar/META-INF/jboss-service.xml"
+            flags="gs"
+            match="@${conf.to.delete}((?!@END.*CONF).)*@END${conf.to.delete}\s"
+            replace=""
+        />
+
+
+        <!-- Only the customers explicit production queues should be configured in the mq destinations file  -->
+
+        <replaceregexp file="${config.dir}/deploy-hasingleton/jms/jbossmq-destinations-service.xml"
+            flags="gm"
+            match="@.*${conf.to.keep}\s"
+            replace=""
+        />
+
+        <replaceregexp file="${config.dir}/deploy-hasingleton/jms/jbossmq-destinations-service.xml"
+            flags="gs"
+            match="@${conf.to.delete}((?!@END.*CONF).)*@END${conf.to.delete}\s"
+            replace=""
+        />
+
+        <replaceregexp file="${config.dir}/deploy/jms/jbossmq-destinations-service.xml"
+            flags="gm"
+            match="@.*${conf.to.keep}\s"
+            replace=""
+        />
+
+        <replaceregexp file="${config.dir}/deploy/jms/jbossmq-destinations-service.xml"
+            flags="gs"
+            match="@${conf.to.delete}((?!@END.*CONF).)*@END${conf.to.delete}\s"
+            replace=""
+        />
+
+        <!-- Reduce log verbosity -->
+
+        <replaceregexp file="${config.dir}/conf/jboss-log4j.xml"
+            flags="gm"
+            match="@.*${conf.to.keep}\s"
+            replace=""
+        />
+
+        <replaceregexp file="${config.dir}/conf/jboss-log4j.xml"
+            flags="gs"
+            match="@${conf.to.delete}((?!@END.*CONF).)*@END${conf.to.delete}\s"
+            replace=""
+        />
+
+
+        <!-- Increase time between scans for hot deploy -->
+
+        <replaceregexp file="${config.dir}/conf/jboss-minimal.xml"
+            flags="gm"
+            match="@.*${conf.to.keep}\s"
+            replace=""
+        />
+
+        <replaceregexp file="${config.dir}/conf/jboss-minimal.xml"
+            flags="gs"
+            match="@${conf.to.delete}((?!@END.*CONF).)*@END${conf.to.delete}\s"
+            replace=""
+        />
+
+        <replaceregexp file="${config.dir}/conf/jboss-service.xml"
+            flags="gm"
+            match="@.*${conf.to.keep}\s"
+            replace=""
+        />
+
+        <replaceregexp file="${config.dir}/conf/jboss-service.xml"
+            flags="gs"
+            match="@${conf.to.delete}((?!@END.*CONF).)*@END${conf.to.delete}\s"
+            replace=""
+        />
+
+        <!-- Disable connection close debug monitoring -->
+
+        <replaceregexp file="${config.dir}/deploy/jbossjca-service.xml"
+            flags="gm"
+            match="@.*${conf.to.keep}\s"
+            replace=""
+        />
+
+        <replaceregexp file="${config.dir}/deploy/jbossjca-service.xml"
+            flags="gs"
+            match="@${conf.to.delete}((?!@END.*CONF).)*@END${conf.to.delete}\s"
+            replace=""
+        />
+
+  </target>
+
+  <!-- Update config and other files for production config -->
+  <target name="processSecurityAnnotations" 
+          depends="partition-community,partition-production">
+
+     <ant antfile="build.xml" target="updateSecurity">
+         <property name="config.file" value="conf/props/jmx-console-users.properties" />
+     </ant>
+
+     <ant antfile="build.xml" target="updateSecurity">
+         <property name="config.file" value="deploy/httpha-invoker.sar/invoker.war/WEB-INF/web.xml" />
+     </ant>
+
+     <ant antfile="build.xml" target="updateSecurity">
+         <property name="config.file" value="deploy/http-invoker.sar/invoker.war/WEB-INF/web.xml" />
+     </ant>
+
+     <ant antfile="build.xml" target="updateSecurity">
+         <property name="config.file" value="deploy/jmx-console.war/WEB-INF/jboss-web.xml" />
+     </ant>
+      
+     <ant antfile="build.xml" target="updateSecurity">
+         <property name="config.file" value="deploy/jmx-console.war/WEB-INF/web.xml" />
+     </ant>
+
+     <ant antfile="build.xml" target="updateSecurity">
+         <property name="config.file" value="deploy/jmx-invoker-service.xml" />
+     </ant>
+      
+     <ant antfile="build.xml" target="updateSecurity">
+         <property name="config.file" value="deploy/management/console-mgr.sar/web-console.war/WEB-INF/classes/web-console-users.properties" />
+     </ant>
+      
+     <ant antfile="build.xml" target="updateSecurity">
+         <property name="config.file" value="deploy/management/console-mgr.sar/web-console.war/WEB-INF/jboss-web.xml" />
+     </ant>
+      
+     <ant antfile="build.xml" target="updateSecurity">
+         <property name="config.file" value="deploy/management/console-mgr.sar/web-console.war/WEB-INF/web.xml" />
+     </ant>
+      
+  </target>
+
+  <!-- Modify run.sh for production config -->
+  <target name="updateSecurity">
+
+        <property name="config.file" value=""/>
+
+        <condition property="conf.to.keep" value="UNSECCONF" else="SECURECONF">
+            <equals arg1="${build.unsecure}" arg2="true"/>
+        </condition>
+
+        <condition property="conf.to.delete" value="SECURECONF" else="UNSECCONF">
+            <equals arg1="${build.unsecure}" arg2="true"/>
+        </condition>
+
+       <!-- Uncomment the configuration to make the key generation cluster safe -->
+
+        <replaceregexp file="${install.all}/${config.file}"
+            flags="gm"
+            match="@.*${conf.to.keep}\s"
+            replace=""
+        />
+
+        <replaceregexp file="${install.all}/${config.file}"
+            flags="gs"
+            match="@${conf.to.delete}((?!@END.*CONF).)*@END${conf.to.delete}\s"
+            replace=""
+        />
+
+        <replaceregexp file="${install.default}/${config.file}"
+            flags="gm"
+            match="@.*${conf.to.keep}\s"
+            replace=""
+        />
+
+        <replaceregexp file="${install.default}/${config.file}"
+            flags="gs"
+            match="@${conf.to.delete}((?!@END.*CONF).)*@END${conf.to.delete}\s"
+            replace=""
+        />
+
+
+        <replaceregexp file="${install.production}/${config.file}"
+            flags="gm"
+            match="@.*${conf.to.keep}\s"
+            replace=""
+        />
+
+        <replaceregexp file="${install.production}/${config.file}"
+            flags="gs"
+            match="@${conf.to.delete}((?!@END.*CONF).)*@END${conf.to.delete}\s"
+            replace=""
+        />
+  </target>
+
+  <!-- Before executing <replace> task on Windows, convert the target files from -->
+  <!-- UNIX line termination (LF) to Windows line termination (CRLF) so that -->
+  <!-- <replace> does not break due to line termination inconsistencies -->
+  <target name="fixEOL" depends="check.windows" if="is.windows">
+    <echo message="Fixing EOL characters for multi-line text replacement on Windows"/>
+    <fixcrlf srcdir="../system/src/bin" includes="run.conf" eol="crlf"/>
+    <fixcrlf srcdir="../system/src/bin" includes="run.sh" eol="crlf"/>
+    <fixcrlf srcdir="../server/src/resources/uuid-key-generator/META-INF" includes="jboss-service.xml" eol="crlf"/>
+    <fixcrlf srcdir="../messaging/src/etc/server/default/deploy" includes="jbossmq-destinations-service.xml" eol="crlf"/>
+    <fixcrlf srcdir="../server/src/etc/conf/default" includes="jboss-log4j.xml" eol="crlf"/>
+    <fixcrlf srcdir="../server/src/etc/conf/default" includes="jboss-minimal.xml" eol="crlf"/>
+    <fixcrlf srcdir="../server/src/etc/conf/default" includes="jboss-service.xml" eol="crlf"/>
+    <fixcrlf srcdir="../connector/src/resources/jca-sar" includes="jbossjca-service.xml" eol="crlf"/>
+    <fixcrlf srcdir="../varia/src/resources/services/binding" includes="sample-bindings.xml" eol="crlf"/>
+    <fixcrlf srcdir="../server/src/main/org/jboss/metadata/serviceref" includes="ServiceRefDelegate.java" eol="crlf"/>
+    <fixcrlf srcdir="../varia/src/resources/services/invoker/http" includes="web.xml" eol="crlf"/>
+    <fixcrlf srcdir="../varia/src/resources/services/invoker/httpha" includes="web.xml" eol="crlf"/>
+    <fixcrlf srcdir="../varia/src/resources/jmx/web-inf" includes="jboss-web.xml" eol="crlf"/>
+    <fixcrlf srcdir="../varia/src/resources/jmx" includes="jmx-console-web.xml" eol="crlf"/>
+    <fixcrlf srcdir="../server/src/resources/jmx-invoker-adaptor/META-INF" includes="jboss-service.xml" eol="crlf"/>
+    <fixcrlf srcdir="../server/src/etc/conf/default/props" includes="jmx-console-users.properties" eol="crlf"/>
+    <fixcrlf srcdir="../console/src/resources/webconsole.war/WEB-INF" includes="jboss-web.xml" eol="crlf"/>
+    <fixcrlf srcdir="../console/src/resources/webconsole.war/WEB-INF" includes="web.xml" eol="crlf"/>
+    <fixcrlf srcdir="../console/src/resources/webconsole.war/WEB-INF/classes" includes="web-console-users.properties" eol="crlf"/>
+  </target>
+
+  <target name="partition-production" depends="init">
+
+    <!-- JAVA_OPTS="-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512" -->
+    <copy tofile="${install.production}/run.conf"
+      file="${install.bin}/run.conf" overwrite="true"/>
+    <replace file="${install.production}/run.conf" 
+      token="Xms128m" value="Xms1503m"/>
+    <replace file="${install.production}/run.conf" 
+      token="Xmx512m" value="Xmx1503m"/>
+    <!-- 
+      <antcall target="makeCCChanges"/> 
+      -->
+
+    <!-- Build production based on all -->
+    <!-- Copy server/all to server/production
+    -->
+    <copy todir="${install.production}">
+      <fileset dir="${install.all}">
+      </fileset>
+    </copy>
+
+  </target>
+
+
   <!-- Partition the default single configuration build into a minimal,
   default and all configs with a minimal set of jars in the root lib dir.
   -->
-  <target name="partition-build" depends="init">
+  <target name="partition-community" depends="init">
 
+    <!-- JAVA_OPTS="-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512" -->
+    <copy tofile="${install.production}/run.conf"
+      file="${install.bin}/run.conf" overwrite="true"/>
+    <replace file="${install.production}/run.conf" 
+      token="Xms128m" value="Xms1503m"/>
+    <replace file="${install.production}/run.conf" 
+      token="Xmx512m" value="Xmx1503m"/>
+    <!-- 
+      <antcall target="makeCCChanges"/> 
+      -->
+
     <!-- move to the common library directory the jars common to all configs;
          the minimal config currently is not point to it
     -->
@@ -755,6 +1128,14 @@
     <unjar src="${project.root}/varia/output/lib/http-invoker.sar"
       dest="${install.default}/deploy/http-invoker.sar"/>
 
+    <!-- Build production based on all -->
+    <!-- Copy server/all to server/production
+    -->
+    <copy todir="${install.production}">
+      <fileset dir="${install.all}">
+      </fileset>
+    </copy>
+
     <!-- Build server/minimal manually -->
     <mkdir dir="${install.minimal.deploy}"/>
     <mkdir dir="${install.minimal.deployers}"/>
@@ -787,52 +1168,6 @@
     <copy todir="${install.minimal.lib}"
       file="${project.root}/server/output/lib/jboss-minimal.jar" />
 
-    <!-- Build server/web manually -->
-    <mkdir dir="${install.web}"/>
-    <mkdir dir="${install.web.lib}"/> <!-- empty -->
-    <copy todir="${install.web.conf}">
-      <fileset dir="${install.default.conf}">
-        <include name="**"/>
-        <exclude name="jboss-service.xml"/>
-      </fileset>
-      <fileset dir="${project.root}/server/output/etc/conf/web">
-        <include name="jboss-service.xml"/>
-      </fileset>
-    </copy>
-    <copy todir="${install.web.deployers}">
-      <fileset dir="${install.default.deployers}">
-         <include name="alias-deployers-jboss-beans.xml"/>            
-         <include name="ejb3.deployer/**"/>            
-         <include name="jboss-jca.deployer/**"/>            
-         <include name="jboss-aop-jboss5.deployer/**"/>            
-         <include name="jbossweb.deployer/**"/>            
-         <include name="metadata-deployer-jboss-beans.xml"/>            
-         <include name="security-deployer-jboss-beans.xml"/>            
-      </fileset>
-    </copy>
-    <copy todir="${install.web.deploy}">
-      <fileset dir="${install.default.deploy}">
-         <include name="hsqldb-ds.xml"/>
-         <include name="jca-jboss-beans.xml"/>
-         <include name="jboss-local-jdbc.rar"/>
-         <include name="jbossweb.sar/**"/>
-         <include name="jboss-xa-jdbc.rar"/>
-         <include name="jmx-console.war/**"/>
-         <include name="http-invoker.sar/**"/>
-         <include name="ROOT.war/**"/>
-         <include name="security/**"/>
-         <include name="transaction-jboss-beans.xml"/>
-         <!-- FIXME serlvets shouldn't be using the ejb3 user transaction -->
-         <include name="ejb3-container-jboss-beans.xml"/>
-      </fileset>
-      <fileset dir="${project.root}/server/output/etc/conf/web">
-        <include name="jmx-invoker-service.xml"/>
-      </fileset>
-      <fileset dir="${project.root}/profileservice/output/resources/">
-        <include name="hdscanner-jboss-beans.xml"/>
-      </fileset>
-    </copy>
-
     <!-- Build standard config manually -->
     <copy todir="${install.standard}">
       <fileset dir="${install.default}">
@@ -878,8 +1213,7 @@
         <include name="ear-deployer-jboss-beans.xml"/>
       </fileset>
     </copy>
-    
-    <call target="jboss-all-client"/>
+
   </target>
   
   <target name="jboss-all-client" depends="init"
@@ -1164,4 +1498,10 @@
       <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.username}" proxypassword="${proxy.password}"/>
    </target>
 
+  <target name="check.windows">
+    <condition property="is.windows">
+      <os family="windows"/>
+    </condition>
+  </target>
+
 </project>




More information about the jboss-cvs-commits mailing list