portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/maven-plugin plugin.jelly
Date Wed, 01 Dec 2004 17:43:00 GMT
weaver      2004/12/01 09:43:00

  Modified:    maven-plugin plugin.jelly
  Log:
  - Added support custom portals to define a "src/sql" directory to have custom SQL exceuted
by jetspeed@:db.create goal.
  - Now using a file iteration to run sql scripts instead of specific names.
  
  Revision  Changes    Path
  1.22      +28 -16    jakarta-jetspeed-2/maven-plugin/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/maven-plugin/plugin.jelly,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- plugin.jelly	14 Oct 2004 19:03:36 -0000	1.21
  +++ plugin.jelly	1 Dec 2004 17:43:00 -0000	1.22
  @@ -84,22 +84,33 @@
     
     <goal name="jetspeed2:db.create">
     	<echo>Using DB: ${org.apache.jetspeed.production.database.default.name}</echo>
  -    <j:set var="database.arg.script" value="${org.apache.jetspeed.plugin.root}/plugin-resources/${org.apache.jetspeed.production.database.default.name}/phase3ojb-schema.sql"
/>
  -    <attainGoal name="jetspeed2:db.execute" />
  -    <j:set var="database.arg.script" value="${org.apache.jetspeed.plugin.root}/plugin-resources/${org.apache.jetspeed.production.database.default.name}/phase1-schema.sql"
/>
  -    <attainGoal name="jetspeed2:db.execute" />
  -    <j:set var="database.arg.script" value="${org.apache.jetspeed.plugin.root}/plugin-resources/${org.apache.jetspeed.production.database.default.name}/phase2-schema.sql"
/>
  -    <attainGoal name="jetspeed2:db.execute" />
  -    <j:set var="database.arg.script" value="${org.apache.jetspeed.plugin.root}/plugin-resources/${org.apache.jetspeed.production.database.default.name}/registry-schema.sql"
/>
  -    <attainGoal name="jetspeed2:db.execute" />
  -    <j:set var="database.arg.script" value="${org.apache.jetspeed.plugin.root}/plugin-resources/${org.apache.jetspeed.production.database.default.name}/prefs-schema.sql"
/>
  -    <attainGoal name="jetspeed2:db.execute" />
  -    <j:set var="database.arg.script" value="${org.apache.jetspeed.plugin.root}/plugin-resources/${org.apache.jetspeed.production.database.default.name}/security-schema.sql"
/>
  -    <attainGoal name="jetspeed2:db.execute" />
  -    <j:set var="database.arg.script" value="${org.apache.jetspeed.plugin.root}/plugin-resources/populate-db-default.sql"
/>
  -    <attainGoal name="jetspeed2:db.execute" />
  -    <j:set var="database.arg.script" value="${org.apache.jetspeed.plugin.root}/plugin-resources/${org.apache.jetspeed.production.database.default.name}/test-persistence-schema.sql"
/>
  -    <attainGoal name="jetspeed2:db.execute" />
  +  	<echo>*************************************</echo>
  +    <echo>*   Excuting standard SQL scripts   *</echo>
  +    <echo>*************************************</echo>
  +  	<!-- Run standard SQL scripts -->
  +    <util:file name="${org.apache.jetspeed.plugin.root}/plugin-resources/${org.apache.jetspeed.production.database.default.name}"
var="sqlSrcDir"/>
  +    <j:if test="${sqlSrcDir.exists()}">
  +      <j:forEach items="${sqlSrcDir.listFiles()}" var="sqlFile">
  +        <j:if test="${sqlFile.name.endsWith('.sql')}">
  +          <j:set var="database.arg.script" value="${sqlFile.absolutePath}" />
  +          <attainGoal name="jetspeed2:db.execute" />
  +        </j:if>
  +      </j:forEach>
  +    </j:if>
  +     
  +    <!-- Run custom SQL scripts if they exist -->
  +    <util:file name="src/sql" var="sqlSrcDir"/>
  +    <j:if test="${sqlSrcDir.exists()}">
  +    <echo>*************************************</echo>
  +    <echo>* Excuting user-defined SQL Scripts *</echo>
  +    <echo>*************************************</echo>
  +    <j:forEach items="${sqlSrcDir.listFiles()}" var="sqlFile">
  +      <j:if test="${sqlFile.name.endsWith('.sql')}">
  +        <j:set var="database.arg.script" value="${sqlFile.absolutePath}" />
  +        <attainGoal name="jetspeed2:db.execute" />
  +      </j:if>
  +    </j:forEach>
  +  </j:if>
     </goal>
     
   
  @@ -324,6 +335,7 @@
           </filterset>
         </copy>    
   </goal>    
  +
   
     
   </project>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message