我已经制作了build.xml 制作 master build.xml 并制作 jar war Ear 文件
现在我想使用 apache ant 从 master build.xml 文件停止并启动 jboss 服务器
然后复制所有 war 和耳朵
最佳答案
很简单
<!-- Start Jboss -->
<target name="start-jboss" description="Starts back-end EJB container" depends="prepare">
<exec executable="${jboss.bin.dir}/run.bat" spawn="false">
</exec>
<copy todir="destination of where you want the file to go" overwrite="true">
<fileset file="myfile.war" />
<fileset file="myfile.ear" />
</copy>
<echo>+-----------------------------+</echo>
<echo>| J B O S S S T A R T E D |</echo>
<echo>+-----------------------------+</echo>
</target>
<!-- Stop Jboss -->
<target name="stop-jboss" description="Stops back-end EJB container" depends="prepare">
<exec executable="${jboss.bin.dir}/shutdown.bat" spawn="false">
<arg line="-S" />
</exec>
<copy todir="destination to where you want the file to go" overwrite="true">
<fileset file="myfile.war" />
<fileset file="myfile.ear" />
</copy>
<echo>+-----------------------------+</echo>
<echo>| J B O S S S T O P P E D |</echo>
<echo>+-----------------------------+</echo>
</target>
希望这对您有帮助:)
关于ant - 如何从 apache ant build.xml 文件目标启动和停止 jboss,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10226377/