You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Heinie Barnard <he...@workmail.co.za> on 2006/04/06 00:05:13 UTC

Re: Need some help with the Ant Tasks

Here's the build.xml file. I tried to colour code it, but
it was removed.

<?xml version="1.0"?>

<!--
/**
 *
 * Copyright 2004 The Apache Software Foundation
 *
 *  Licensed under the Apache License, Version 2.0 (the
"License");
 *  you may not use this file except in compliance with the
License.
 *  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in
writing, software
 *  distributed under the License is distributed on an "AS
IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied.
 *  See the License for the specific language governing
permissions and
 *  limitations under the License.
 */
 -->
 
 
 <project name="GeronimoTaskExample" default="help"
basedir=".">
	  			
	<!-- CLASSPATH SETUP -->  			
	<property name="lib.dir" location="lib"/>
	<property name="gironimo.lib.dir"
location="C:/geronimo-1.0/lib"/>
	<property name="gironimo.lib.dir2"
location="C:/geronimo-1.0/repository/geronimo/jars"/>	
			 
	<path id="ant.lib.path">
	    <fileset dir="${lib.dir}">
		      <include name="*.jar"/>
	    </fileset>
	    <fileset dir="${gironimo.lib.dir}">
		      <include name="*.jar"/>
	    </fileset>
    	<fileset dir="${gironimo.lib.dir2}">
		      <include name="*.jar"/>
	    </fileset>
	</path>
	   
	<!-- CONFIG SETUP -->
	<property name="target"
     value="C:/geronimo-jetty/geronimo-1.0" />
	<property name="server"
     value="jmx:rmi:///jndi/rmi://localhost:1099/JMXConnector"
/> 			
	
	<property name="module"
     value="${maven.repo.local}/myproject/jars/myapplication-1.0-SNAPSHOT.jar"
/> 			
	<property name="moduleId"
   value="org/myproject/MyConfigurationName" /> 			
	
	<property name="username"    value="system" /> 
	<property name="password"    value="manager" />   
	   
	<!-- TASKS -->   
    <taskdef name="startServer"
       classname="org.apache.geronimo.deployment.ant.StartRemoteServer"
   classpathref="ant.lib.path"/>
	<taskdef name="stopServer"
        classname="org.apache.geronimo.deployment.ant.StopRemoteServer"
    classpathref="ant.lib.path"/>
   	<taskdef name="waitForStarted"
    classname="org.apache.geronimo.deployment.ant.WaitForStarted"
      classpathref="ant.lib.path"/>
    <taskdef name="deployModule"
      classname="org.apache.geronimo.deployment.ant.DistributeModule"
    classpathref="ant.lib.path"/>	
    <taskdef name="undeployModule"
    classname="org.apache.geronimo.deployment.ant.UndeployModule"
      classpathref="ant.lib.path"/>
    <taskdef name="startModule"
       classname="org.apache.geronimo.deployment.ant.StartModule"
         classpathref="ant.lib.path"/>	
    <taskdef name="stopModule"
        classname="org.apache.geronimo.deployment.ant.StopModule"
          classpathref="ant.lib.path"/>
    
    
    <!-- TARGETS -->
    
  <target name="help">
     	<echo message="Options:"/>
	  	<echo message="ant start - Start the configured
Geronimo Server"/>
     	<echo message="ant stop - Stop the configured
Geronimo Server"/>
		<echo message=""/>
		<echo message="ant deploy - Start the configured Geronimo
Server"/>
	   	<echo message="ant undeploy - Stop the configured
Geronimo Server"/>
		<echo message=""/>
		<echo message="ant startModule - Start the configured
Module"/>
	   	<echo message="ant stopModule - Stop the configured
Module"/>
  </target>
    
  <target name="start">
	  <startServer
geronimoTarget="C:/geronimo-jetty/geronimo-1.0">
	  </startServer> 
<!--  <waitForStarted uri="${server}"  username="system"
password="${password}"/> Not working, not sure why ? -->
	  <echo message="Geronimo Server Started"/>
  </target>
		
  <target name="stop">
	<stopServer uri="${server}" username="${username}"
password="${password}">
	</stopServer>
  	<echo message="Geronimo Server Stopped"/>
  </target>  
    
  <target name="stopModule">
	<stopModule uri="${server}" username="${username}"
password="${password}" id="${moduleId}">
	</stopModule>
  </target>
	
  <target name="startModule">
	<startModule uri="${server}" username="${username}"
password="${password}" id="${moduleId}">
	</startModule>
  </target>
	
  <!- If deploying a new Module make sure it stops the
previous one ->
  <target name="deploy" depends="stopModule">
	<deployModule uri="${server}" username="${username}"
password="${password}" home="${basedir}"
module="${module}">
	</deployModule>
  </target>

  <!- If deploying a new Module make sure it stops the
previous one ->
  <target name="undeploy" depends="stopModule">
	<undeployModule uri="${server}" username="${username}"
password="${password}" id="${moduleId}">
	</undeployModule>
  </target>
  
</project>  


>        Good evening everybody   We need some help with
the Ant Plugin
> Tasks. We  need some people to test the tasks.   The
source code
> can be obtained at : 
> http://issues.apache.org/jira/browse/GERONIMO-1792
  Prasad Kashyap
> and I have decided that we need to  change the following:
  1)
> Package structure:   2) Refactor StartRemoteServer /
> StopRemoteServer to StartServer and StopServer   3)
Change the ant
> build file to look like  the build at the bottom
  Regards Heinie
> Barnard Kaybee IT Solutions Orbis non sufficit
                    
>
                                                            
      
>
                                                            
      
>
                                                            
      
>
                                                            
      
>
                                                            
      
>
                                                            
      
>
                                                            
      
>
                                                            
      
>                                                        
>
___________________________________________________________________
>  For super low premiums, click here
http://www.webmail.co.za/dd.pwm
>    http://www.webmail.co.za the South African FREE email
service
___________________________________________________________________
For super low premiums, click here http://www.webmail.co.za/dd.pwm

http://www.webmail.co.za the South African FREE email service

Re: Need some help with the Ant Tasks

Posted by Dain Sundstrom <da...@iq80.com>.
Can we wrap the tasks up into an AntLib so it is easier for our users  
to declare and use the tasks?   The maven team has wrapped their  
artifact management code into an ant lib so ant users can use the  
maven repo.

Here is some info on ant libs:
   http://ant.apache.org/manual/CoreTypes/antlib.html

Here is the docs on how ant users use the maven artifact management  
ant tasks:
   http://maven.apache.org/ant-tasks.html

-dain


On Apr 5, 2006, at 3:05 PM, Heinie Barnard wrote:

> Here's the build.xml file. I tried to colour code it, but
> it was removed.
>
> <?xml version="1.0"?>
>
> <!--
> /**
>  *
>  * Copyright 2004 The Apache Software Foundation
>  *
>  *  Licensed under the Apache License, Version 2.0 (the
> "License");
>  *  you may not use this file except in compliance with the
> License.
>  *  You may obtain a copy of the License at
>  *
>  *     http://www.apache.org/licenses/LICENSE-2.0
>  *
>  *  Unless required by applicable law or agreed to in
> writing, software
>  *  distributed under the License is distributed on an "AS
> IS" BASIS,
>  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
> express or implied.
>  *  See the License for the specific language governing
> permissions and
>  *  limitations under the License.
>  */
>  -->
>
>
>  <project name="GeronimoTaskExample" default="help"
> basedir=".">
> 	  			
> 	<!-- CLASSPATH SETUP -->  			
> 	<property name="lib.dir" location="lib"/>
> 	<property name="gironimo.lib.dir"
> location="C:/geronimo-1.0/lib"/>
> 	<property name="gironimo.lib.dir2"
> location="C:/geronimo-1.0/repository/geronimo/jars"/>	
> 			
> 	<path id="ant.lib.path">
> 	    <fileset dir="${lib.dir}">
> 		      <include name="*.jar"/>
> 	    </fileset>
> 	    <fileset dir="${gironimo.lib.dir}">
> 		      <include name="*.jar"/>
> 	    </fileset>
>     	<fileset dir="${gironimo.lib.dir2}">
> 		      <include name="*.jar"/>
> 	    </fileset>
> 	</path>
> 	
> 	<!-- CONFIG SETUP -->
> 	<property name="target"
>      value="C:/geronimo-jetty/geronimo-1.0" />
> 	<property name="server"
>      value="jmx:rmi:///jndi/rmi://localhost:1099/JMXConnector"
> /> 			
> 	
> 	<property name="module"
>      value="${maven.repo.local}/myproject/jars/myapplication-1.0- 
> SNAPSHOT.jar"
> /> 			
> 	<property name="moduleId"
>    value="org/myproject/MyConfigurationName" /> 			
> 	
> 	<property name="username"    value="system" />
> 	<property name="password"    value="manager" />
> 	
> 	<!-- TASKS -->
>     <taskdef name="startServer"
>         
> classname="org.apache.geronimo.deployment.ant.StartRemoteServer"
>    classpathref="ant.lib.path"/>
> 	<taskdef name="stopServer"
>          
> classname="org.apache.geronimo.deployment.ant.StopRemoteServer"
>     classpathref="ant.lib.path"/>
>    	<taskdef name="waitForStarted"
>     classname="org.apache.geronimo.deployment.ant.WaitForStarted"
>       classpathref="ant.lib.path"/>
>     <taskdef name="deployModule"
>       classname="org.apache.geronimo.deployment.ant.DistributeModule"
>     classpathref="ant.lib.path"/>	
>     <taskdef name="undeployModule"
>     classname="org.apache.geronimo.deployment.ant.UndeployModule"
>       classpathref="ant.lib.path"/>
>     <taskdef name="startModule"
>        classname="org.apache.geronimo.deployment.ant.StartModule"
>          classpathref="ant.lib.path"/>	
>     <taskdef name="stopModule"
>         classname="org.apache.geronimo.deployment.ant.StopModule"
>           classpathref="ant.lib.path"/>
>
>
>     <!-- TARGETS -->
>
>   <target name="help">
>      	<echo message="Options:"/>
> 	  	<echo message="ant start - Start the configured
> Geronimo Server"/>
>      	<echo message="ant stop - Stop the configured
> Geronimo Server"/>
> 		<echo message=""/>
> 		<echo message="ant deploy - Start the configured Geronimo
> Server"/>
> 	   	<echo message="ant undeploy - Stop the configured
> Geronimo Server"/>
> 		<echo message=""/>
> 		<echo message="ant startModule - Start the configured
> Module"/>
> 	   	<echo message="ant stopModule - Stop the configured
> Module"/>
>   </target>
>
>   <target name="start">
> 	  <startServer
> geronimoTarget="C:/geronimo-jetty/geronimo-1.0">
> 	  </startServer>
> <!--  <waitForStarted uri="${server}"  username="system"
> password="${password}"/> Not working, not sure why ? -->
> 	  <echo message="Geronimo Server Started"/>
>   </target>
> 		
>   <target name="stop">
> 	<stopServer uri="${server}" username="${username}"
> password="${password}">
> 	</stopServer>
>   	<echo message="Geronimo Server Stopped"/>
>   </target>
>
>   <target name="stopModule">
> 	<stopModule uri="${server}" username="${username}"
> password="${password}" id="${moduleId}">
> 	</stopModule>
>   </target>
> 	
>   <target name="startModule">
> 	<startModule uri="${server}" username="${username}"
> password="${password}" id="${moduleId}">
> 	</startModule>
>   </target>
> 	
>   <!- If deploying a new Module make sure it stops the
> previous one ->
>   <target name="deploy" depends="stopModule">
> 	<deployModule uri="${server}" username="${username}"
> password="${password}" home="${basedir}"
> module="${module}">
> 	</deployModule>
>   </target>
>
>   <!- If deploying a new Module make sure it stops the
> previous one ->
>   <target name="undeploy" depends="stopModule">
> 	<undeployModule uri="${server}" username="${username}"
> password="${password}" id="${moduleId}">
> 	</undeployModule>
>   </target>
>
> </project>
>
>
>>        Good evening everybody   We need some help with
> the Ant Plugin
>> Tasks. We  need some people to test the tasks.   The
> source code
>> can be obtained at :
>> http://issues.apache.org/jira/browse/GERONIMO-1792
>   Prasad Kashyap
>> and I have decided that we need to  change the following:
>   1)
>> Package structure:   2) Refactor StartRemoteServer /
>> StopRemoteServer to StartServer and StopServer   3)
> Change the ant
>> build file to look like  the build at the bottom
>   Regards Heinie
>> Barnard Kaybee IT Solutions Orbis non sufficit
>
>>
>
>
>>
>
>
>>
>
>
>>
>
>
>>
>
>
>>
>
>
>>
>
>
>>
>
>
>>
>>
> ___________________________________________________________________
>>  For super low premiums, click here
> http://www.webmail.co.za/dd.pwm
>>    http://www.webmail.co.za the South African FREE email
> service
> ___________________________________________________________________
> For super low premiums, click here http://www.webmail.co.za/dd.pwm
>
> http://www.webmail.co.za the South African FREE email service