ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Lybarger" <Mark.Lybar...@CBC-Companies.com>
Subject java task with optional jvmargs
Date Fri, 30 Jul 2004 13:58:32 GMT
i'd like to use the ant java task with option jvmargs.  i'm using it to startup my weblogic
servers, and would like to be able to add debugging for development, but not qa/prod. my current
task looks something like:


    <java jvm="java" classname="weblogic.Server" spawn="${server.spawn}" fork="true" dir="${DOMAIN_DIR}">
      <jvmarg value="-hotspot"/>
      <jvmarg value="-ms32m" />
      <jvmarg value="-mx200m" />
	<jvmarg value="${Server.Debug.Option}" />
      <jvmarg value="${JDWP_SERVER_DEBUG_OPTION}" />
      <env key="PATH" path="${env.PATH};${WEBLOGIC_LIB_DIR}/solaris;${WEBLOGIC_OCI_DIR};${WEBLOGIC_SERVER_BIN_DIR};${JAVA_BIN_DIR};${java.library.path}"/>
      <env key="ORACLE_HOME" path="${ORACLE_HOME_DIR}"/>
      <env key="LD_LIBRARY_PATH" path="${ORACLE_HOME_DIR}/lib;${WEBLOGIC_LIB_DIR}/solaris"/>
     
      <sysproperty key="java.library.path" path="${WEBLOGIC_OCI_DIR};${WEBLOGIC_SERVER_BIN_DIR};${java.library.path}"
/>
  	  <sysproperty key="org.apache.commons.logging.LogFactory" value="org.apache.commons.logging.impl.LogFactoryImpl"/>
      <sysproperty key="weblogic.Domain" value="${DOMAIN_NAME}" />
      <sysproperty key="weblogic.Name" value="${weblogic.server.name}" />
      <sysproperty key="bea.home" file="${WEBLOGIC_LICENSE_DIR}" />
      <sysproperty key="weblogic.management.username" value="${weblogic.management.username}"
/>
      <sysproperty key="weblogic.management.password" value="${weblogic.management.password}"
/> 
      <sysproperty key="weblogic.management.server" value="t3://localhost:${Server.isacAdmin.ListenPort}"
/>    
      <sysproperty key="java.security.policy" value="${WEBLOGIC_LIB_DIR}/weblogic.policy"/>

      <classpath>
        <path refid="classpath" />
      </classpath>
    </java>

i'm using separate property files per environment.  the trouble is that when the Server.Debug.Option
and JDWP_SERVER_DEBUG_OPTION are set to blank for qa, the servers don't start. somehow it
interfers with the command line being sent to ant.  i'm using ant 1.6.0 on qa and 1.6.2 on
development.  (it's easier to upgrade development of course).  i had to comment out the 4th
and 5th jvmarg(s) to get these to start on qa.  is there a good way to make these args optional?
i could even have two separate tasks if needed and switch based on if those properties are
set, i'm just not sure how that would go.

suggestions/ideas?

thanks!
mark


Mime
View raw message