You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2004/02/29 19:24:57 UTC

cvs commit: jakarta-jetspeed-2 GETTING-STARTED.html maven.xml project.properties

taylor      2004/02/29 10:24:57

  Modified:    .        GETTING-STARTED.html maven.xml project.properties
  Log:
  Integrated Torque generated scripts into build
  
  Revision  Changes    Path
  1.8       +2 -2      jakarta-jetspeed-2/GETTING-STARTED.html
  
  Index: GETTING-STARTED.html
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/GETTING-STARTED.html,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- GETTING-STARTED.html	27 Feb 2004 18:03:27 -0000	1.7
  +++ GETTING-STARTED.html	29 Feb 2004 18:24:57 -0000	1.8
  @@ -139,9 +139,9 @@
   <ol>
     <li>make sure you have terminated the test HSQLserver</li>
     <li>cd ${jetspeed-2-home}</li>
  -  <li>maven start.proudction.server</li>
  +  <li>maven start.prouduction.server</li>
     <li>(in seperate window/terminal session) cd ${jetspeed-2-home}</li>
  -  <li>maven installProductionDb this will recreate the DB to deploy into. &nbsp;WARNING 
  +  <li>maven db.recreate this will recreate the DB to deploy into. &nbsp;WARNING 
       This will drop all the tables and data in the proudction database.</li>
     <li>cd ${jetspeed-2-home}/portal</li>
     <li>maven deploy</li>
  
  
  
  1.30      +61 -13    jakarta-jetspeed-2/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/maven.xml,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- maven.xml	28 Feb 2004 20:58:12 -0000	1.29
  +++ maven.xml	29 Feb 2004 18:24:57 -0000	1.30
  @@ -36,6 +36,9 @@
   
     <goal name="allBuild"
           description="Build all jars and war">
  +  	<attainGoal name="db.scripts.gen"/>
  +  	<attainGoal name="db.create"/>
  +
       <!-- Build jars -->
       <maven:reactor
                  basedir="${basedir}/portlet-api"
  @@ -97,7 +100,7 @@
       <maven:reactor
                  basedir="${basedir}"
                  includes="services/security/project.xml"
  -               goals="db.recreate,jar:install,ojb.registry"
  +               goals="jar:install,ojb.registry"
                  banner="Build and Install the services - security jar"
                  postProcessing="false"
                  ignoreFailures="false"/>
  @@ -196,18 +199,7 @@
               <arg value="false" />
           </java>  
     </goal>
  -  
  -   <goal name="installProductionDb">
  -  	<echo message="${basedir}" />
  -  	 <maven:reactor
  -               basedir="${basedir}"
  -               includes="components/registry/project.xml,services/security/project.xml,portal/project.xml"
  -               goals="db.recreate"
  -               banner="Create production database"
  -               postProcessing="false"
  -               ignoreFailures="false"/>
  -  </goal>
  -    
  +      
     <goal name="db.scripts.gen" prereqs="torque:init"
           description="Build SQL scripts using Torque generator">
   
  @@ -262,6 +254,62 @@
         />
       </torque-sql>
                    
  +  </goal>
  +                
  +
  +  <!-- ================================================================ -->
  +  <!-- EXECUTE a DB SCRIPT                                              -->
  +  <!-- TODO: I'd like to implement this as a plugin or use commons SQL  -->
  +  <!-- ================================================================ -->
  +  <goal name="db.execute">
  +    <sql driver="${org.apache.jetspeed.database.driver}"
  +         classpathref="maven.dependency.classpath"
  +         url="${org.apache.jetspeed.database.url}"
  +         userid="${org.apache.jetspeed.database.user}"
  +         password="${org.apache.jetspeed.database.password}"
  +         src="${database.arg.script}">
  +    </sql>
  +  </goal>
  +
  +  <!-- ================================================================ -->
  +  <!-- EXECUTE CREATE DB SQL SCRIPTS                                    -->
  +  <!-- TODO: I'd like to implement this as a plugin or use commons SQL  -->
  +  <!-- ================================================================ -->
  +  <goal name="db.create">
  +    <j:set var="database.arg.script" value="./target/src/sql/${database.default.name}/phase3ojb-schema.sql" />
  +    <attainGoal name="db.execute" />
  +    <j:set var="database.arg.script" value="./target/src/sql/${database.default.name}/phase1-schema.sql" />
  +    <attainGoal name="db.execute" />
  +    <j:set var="database.arg.script" value="./target/src/sql/${database.default.name}/phase2-schema.sql" />
  +    <attainGoal name="db.execute" />
  +    <j:set var="database.arg.script" value="./target/src/sql/${database.default.name}/registry-schema.sql" />
  +    <attainGoal name="db.execute" />
  +    <j:set var="database.arg.script" value="./target/src/sql/${database.default.name}/prefs-schema.sql" />
  +    <attainGoal name="db.execute" />
  +    <j:set var="database.arg.script" value="./target/src/sql/${database.default.name}/security-schema.sql" />
  +    <attainGoal name="db.execute" />
  +    <j:set var="database.arg.script" value="./src/sql/populate-db-default.sql" />
  +    <attainGoal name="db.execute" />
  +  </goal>
  +
  +  <!-- ================================================================ -->
  +  <!-- EXECUTE DROP DB SQL SCRIPTS                                      -->
  +  <!-- TODO: I'd like to implement this as a plugin or use commons SQL  -->
  +  <!-- ================================================================ -->
  +  <goal name="db.drop">
  +    <j:set var="database.arg.script" value="./src/sql/${database.default.name}/drop-db.sql" />
  +    <attainGoal name="db.execute" />
  +    <j:set var="database.arg.script" value="./src/sql/${database.default.name}/registry-drop-db.sql" />
  +    <attainGoal name="db.execute" />
  +  </goal>
  +
  +  <!-- ================================================================ -->
  +  <!-- EXECUTE RECREATE DB SQL SCRIPTS                                  -->
  +  <!-- TODO: I'd like to implement this as a plugin or use commons SQL  -->
  +  <!-- ================================================================ -->
  +  <goal name="db.recreate">
  +<!--    <attainGoal name="db.drop" /> -->
  +    <attainGoal name="db.create" />
     </goal>
   
   </project>
  
  
  
  1.7       +3 -0      jakarta-jetspeed-2/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/project.properties,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- project.properties	28 Feb 2004 20:58:12 -0000	1.6
  +++ project.properties	29 Feb 2004 18:24:57 -0000	1.7
  @@ -21,6 +21,8 @@
   org.apache.jetspeed.database.user = sa
   org.apache.jetspeed.database.password = 
   
  +database.default.name=hsql
  +
   # ---------------------------------------------------------------------------
   # Torque settings
   torque.project = portal
  @@ -29,3 +31,4 @@
   torque.schema.dir = ${maven.src.dir}/schema
   torque.idTableXMLFile = 
   torque.template.sql = sql/base/Control.vm
  +
  
  
  

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


Re: cvs commit: jakarta-jetspeed-2 GETTING-STARTED.html maven.xml project.properties

Posted by David Sean Taylor <da...@bluesunrise.com>.
On Monday, March 1, 2004, at 02:50  AM, Serge Huber wrote:

>
> Hey David great job on the maven script !
>
Thanks

> Actually one thing that would help automate the integration of the 
> Torque script gen is if we could rename "hsql" to "hypersonic". The 
> reason is that Torque uses "hypersonic" as the target database name in 
> it's templates and if we do it that way we could simply pass a 
> parameter to the db.scripts.gen goal that would specify the database 
> to generate for. Then we could do something like :
>
> maven -Ddefault.database.name=hypersonic db.test.setup
>
> and we could :
> 1. generate just the needed scripts
> 2. start the HSQL if needed
> 3. run the scripts
>
> The other way around this would be to rename the Torque scripts from 
> "hypersonic" to "hsql", but that means waiting on even more patches.
>
No problem, will make the change today

> I hope I didn't give you too much trouble with my script gen, and I'm 
> glad I could finally contribute, even just a little.
>
The first of many ;-)



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


Re: cvs commit: jakarta-jetspeed-2 GETTING-STARTED.html maven.xml project.properties

Posted by Serge Huber <sh...@jahia.com>.
Hey David great job on the maven script !

Actually one thing that would help automate the integration of the Torque 
script gen is if we could rename "hsql" to "hypersonic". The reason is that 
Torque uses "hypersonic" as the target database name in it's templates and 
if we do it that way we could simply pass a parameter to the db.scripts.gen 
goal that would specify the database to generate for. Then we could do 
something like :

maven -Ddefault.database.name=hypersonic db.test.setup

and we could :
1. generate just the needed scripts
2. start the HSQL if needed
3. run the scripts

The other way around this would be to rename the Torque scripts from 
"hypersonic" to "hsql", but that means waiting on even more patches.

I hope I didn't give you too much trouble with my script gen, and I'm glad 
I could finally contribute, even just a little.

Regards,
   Serge Huber.

At 07:24 PM 2/29/2004, you wrote:
>taylor      2004/02/29 10:24:57
>
>   Modified:    .        GETTING-STARTED.html maven.xml project.properties
>   Log:
>   Integrated Torque generated scripts into build
>
>   Revision  Changes    Path
>   1.8       +2 -2      jakarta-jetspeed-2/GETTING-STARTED.html
>
>   Index: GETTING-STARTED.html
>   ===================================================================
>   RCS file: /home/cvs/jakarta-jetspeed-2/GETTING-STARTED.html,v
>   retrieving revision 1.7
>   retrieving revision 1.8
>   diff -u -r1.7 -r1.8
>   --- GETTING-STARTED.html      27 Feb 2004 18:03:27 -0000      1.7
>   +++ GETTING-STARTED.html      29 Feb 2004 18:24:57 -0000      1.8
>   @@ -139,9 +139,9 @@
>    <ol>
>      <li>make sure you have terminated the test HSQLserver</li>
>      <li>cd ${jetspeed-2-home}</li>
>   -  <li>maven start.proudction.server</li>
>   +  <li>maven start.prouduction.server</li>
>      <li>(in seperate window/terminal session) cd ${jetspeed-2-home}</li>
>   -  <li>maven installProductionDb this will recreate the DB to deploy 
> into. &nbsp;WARNING
>   +  <li>maven db.recreate this will recreate the DB to deploy into. 
> &nbsp;WARNING
>        This will drop all the tables and data in the proudction 
> database.</li>
>      <li>cd ${jetspeed-2-home}/portal</li>
>      <li>maven deploy</li>
>
>
>
>   1.30      +61 -13    jakarta-jetspeed-2/maven.xml
>
>   Index: maven.xml
>   ===================================================================
>   RCS file: /home/cvs/jakarta-jetspeed-2/maven.xml,v
>   retrieving revision 1.29
>   retrieving revision 1.30
>   diff -u -r1.29 -r1.30
>   --- maven.xml 28 Feb 2004 20:58:12 -0000      1.29
>   +++ maven.xml 29 Feb 2004 18:24:57 -0000      1.30
>   @@ -36,6 +36,9 @@
>
>      <goal name="allBuild"
>            description="Build all jars and war">
>   +     <attainGoal name="db.scripts.gen"/>
>   +     <attainGoal name="db.create"/>
>   +
>        <!-- Build jars -->
>        <maven:reactor
>                   basedir="${basedir}/portlet-api"
>   @@ -97,7 +100,7 @@
>        <maven:reactor
>                   basedir="${basedir}"
>                   includes="services/security/project.xml"
>   -               goals="db.recreate,jar:install,ojb.registry"
>   +               goals="jar:install,ojb.registry"
>                   banner="Build and Install the services - security jar"
>                   postProcessing="false"
>                   ignoreFailures="false"/>
>   @@ -196,18 +199,7 @@
>                <arg value="false" />
>            </java>
>      </goal>
>   -
>   -   <goal name="installProductionDb">
>   -     <echo message="${basedir}" />
>   -     <maven:reactor
>   -               basedir="${basedir}"
>   - 
> includes="components/registry/project.xml,services/security/project.xml,portal/project.xml"
>   -               goals="db.recreate"
>   -               banner="Create production database"
>   -               postProcessing="false"
>   -               ignoreFailures="false"/>
>   -  </goal>
>   -
>   +
>      <goal name="db.scripts.gen" prereqs="torque:init"
>            description="Build SQL scripts using Torque generator">
>
>   @@ -262,6 +254,62 @@
>          />
>        </torque-sql>
>
>   +  </goal>
>   +
>   +
>   +  <!-- 
> ================================================================ -->
>   +  <!-- EXECUTE a DB 
> SCRIPT                                              -->
>   +  <!-- TODO: I'd like to implement this as a plugin or use commons 
> SQL  -->
>   +  <!-- 
> ================================================================ -->
>   +  <goal name="db.execute">
>   +    <sql driver="${org.apache.jetspeed.database.driver}"
>   +         classpathref="maven.dependency.classpath"
>   +         url="${org.apache.jetspeed.database.url}"
>   +         userid="${org.apache.jetspeed.database.user}"
>   +         password="${org.apache.jetspeed.database.password}"
>   +         src="${database.arg.script}">
>   +    </sql>
>   +  </goal>
>   +
>   +  <!-- 
> ================================================================ -->
>   +  <!-- EXECUTE CREATE DB SQL 
> SCRIPTS                                    -->
>   +  <!-- TODO: I'd like to implement this as a plugin or use commons 
> SQL  -->
>   +  <!-- 
> ================================================================ -->
>   +  <goal name="db.create">
>   +    <j:set var="database.arg.script" 
> value="./target/src/sql/${database.default.name}/phase3ojb-schema.sql" />
>   +    <attainGoal name="db.execute" />
>   +    <j:set var="database.arg.script" 
> value="./target/src/sql/${database.default.name}/phase1-schema.sql" />
>   +    <attainGoal name="db.execute" />
>   +    <j:set var="database.arg.script" 
> value="./target/src/sql/${database.default.name}/phase2-schema.sql" />
>   +    <attainGoal name="db.execute" />
>   +    <j:set var="database.arg.script" 
> value="./target/src/sql/${database.default.name}/registry-schema.sql" />
>   +    <attainGoal name="db.execute" />
>   +    <j:set var="database.arg.script" 
> value="./target/src/sql/${database.default.name}/prefs-schema.sql" />
>   +    <attainGoal name="db.execute" />
>   +    <j:set var="database.arg.script" 
> value="./target/src/sql/${database.default.name}/security-schema.sql" />
>   +    <attainGoal name="db.execute" />
>   +    <j:set var="database.arg.script" 
> value="./src/sql/populate-db-default.sql" />
>   +    <attainGoal name="db.execute" />
>   +  </goal>
>   +
>   +  <!-- 
> ================================================================ -->
>   +  <!-- EXECUTE DROP DB SQL 
> SCRIPTS                                      -->
>   +  <!-- TODO: I'd like to implement this as a plugin or use commons 
> SQL  -->
>   +  <!-- 
> ================================================================ -->
>   +  <goal name="db.drop">
>   +    <j:set var="database.arg.script" 
> value="./src/sql/${database.default.name}/drop-db.sql" />
>   +    <attainGoal name="db.execute" />
>   +    <j:set var="database.arg.script" 
> value="./src/sql/${database.default.name}/registry-drop-db.sql" />
>   +    <attainGoal name="db.execute" />
>   +  </goal>
>   +
>   +  <!-- 
> ================================================================ -->
>   +  <!-- EXECUTE RECREATE DB SQL 
> SCRIPTS                                  -->
>   +  <!-- TODO: I'd like to implement this as a plugin or use commons 
> SQL  -->
>   +  <!-- 
> ================================================================ -->
>   +  <goal name="db.recreate">
>   +<!--    <attainGoal name="db.drop" /> -->
>   +    <attainGoal name="db.create" />
>      </goal>
>
>    </project>
>
>
>
>   1.7       +3 -0      jakarta-jetspeed-2/project.properties
>
>   Index: project.properties
>   ===================================================================
>   RCS file: /home/cvs/jakarta-jetspeed-2/project.properties,v
>   retrieving revision 1.6
>   retrieving revision 1.7
>   diff -u -r1.6 -r1.7
>   --- project.properties        28 Feb 2004 20:58:12 -0000      1.6
>   +++ project.properties        29 Feb 2004 18:24:57 -0000      1.7
>   @@ -21,6 +21,8 @@
>    org.apache.jetspeed.database.user = sa
>    org.apache.jetspeed.database.password =
>
>   +database.default.name=hsql
>   +
>    # 
> ---------------------------------------------------------------------------
>    # Torque settings
>    torque.project = portal
>   @@ -29,3 +31,4 @@
>    torque.schema.dir = ${maven.src.dir}/schema
>    torque.idTableXMLFile =
>    torque.template.sql = sql/base/Control.vm
>   +
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org

- -- --- -----=[ shuber2 at jahia dot com ]=---- --- -- -
www.jahia.org : A collaborative source CMS and Portal Server 



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