Skip to content

Instantly share code, notes, and snippets.

@kght6123
Created September 20, 2018 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kght6123/cf6b881011bd15b779df22c3c6aea13d to your computer and use it in GitHub Desktop.
Save kght6123/cf6b881011bd15b779df22c3c6aea13d to your computer and use it in GitHub Desktop.
java Inherit classpath. add vm option "-Dbuild.sysclasspath=last".
<macrodef name="single-task">
<attribute name="application.name" default="AntTask" />
<attribute name="vm.dir"/>
<attribute name="build.file"/>
<element name="build.tasks" />
<sequential>
<echo message="start @{application.name}."/>
<!-- デバッグ情報の出力 -->
<property name="ant-class-path" refid="ant.class.path" />
<echo message="classpath = ${ant-class-path}" />
<echo message="tomcat.home = ${tomcat.home}" />
<!-- javaタスクで、build.xmlを実行 -->
<java classname="org.apache.tools.ant.launch.Launcher" fork="true" dir="@{vm.dir}" failonerror="true">
<sysproperty key="ant.home" value="${ant.home}"/>
<arg value="-buildfile" />
<arg value="@{build.file}" />
<build.tasks />
<env key="TOMCAT_HOME" value="${tomcat.home}" />
<!-- <java cloneVm="true" /> cloneVmは、"-buildfile"オプションが無効になる -->
<classpath refid="ant.class.path"/>
</java>
<echo message="complete @{application.name}."/>
</sequential>
</macrodef>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment