0

i have a taskdef pointing to a class

<taskdef name="configjar"  classname="com.bea.alsb.tools.configjar.ant.ConfigJarTask" classpathref="configjar.path">
</taskdef>

Inside this i want to pass java system property. Like how we do in the java task

<java > <sysproperty key="" value""/> </java>

The problem is the jar is some library which I can't modify .I can't use a command to set in a build environment we have. I know i can do this by setting ANT_OPTS,but can i do this from build.xml.How can i make this happen

Raj
  • 1,250
  • 2
  • 11
  • 20
  • Nothing to do with task declaration. Have your plugin code just access the system property and set it as normal from ANT. – Mark O'Connor Dec 23 '13 at 18:38
  • Can you give us a bit better explanation. What do you mean _want to pass in a system property_? What property is that? The location of the jar that contains the task? There's not much else you can pass into ``. – David W. Dec 23 '13 at 18:40
  • Just reframed my question so that it can help others to understand my question – Raj Dec 23 '13 at 18:45

1 Answers1

1

Not sure it's exact way or not. But found a work around for this

  <java classname="org.apache.tools.ant.launch.Launcher" fork="true" failonerror="true">
        <sysproperty key="weblogic.home" value="${weblogic.home}"/>
        <sysproperty key="osb.home" value="${osb.home}"/>
         <arg value="test"/>
</java>
<target name="test">
<configjar debug="${task.debug}"
               failonerror="${task.failonerror}"
               errorProperty="${task.errorproperty}"
               settingsFile="${settingsFile}" >
    </configjar>
</target>

I have invoked ant using java command and set the two system properties as shown above.

Raj
  • 1,250
  • 2
  • 11
  • 20