我只能與ANT做一個解決方法。我希望這對下一個認爲Jenkins的jboss插件有效的人是有幫助的......當然不是v7.1.1。
所以解決方法:
檢查JBoss的響應
<condition property="jboss.online">
<socket server="localhost" port="8080"/>
</condition>
如果是的話,停止JBoss和刪除所有部署
<target name="stop" depends="-check-status" if="${start.successful}">
<java jar="${jboss.home}/jboss-modules.jar" fork="true">
<arg line="-mp ${jboss.home}/modules org.jboss.as.cli -c command=:shutdown" />
</java>
<sleep seconds="10" />
<delete quiet="false" includeEmptyDirs="true">
<fileset dir="${jboss.home}/standalone/deployments/">
<include name="**/*" />
</fileset>
</delete>
</target>
複製所有的耳朵和戰爭來部署
<copy file="${publish.dir}/main.ear" overwrite="true" todir="${jboss.home}/standalone/deployments" />
<copy file="${publish.dir}/first.war" overwrite="true" todir="${jboss.home}/standalone/deployments" />
<copy file="${publish.dir}/second.war" overwrite="true" todir="${jboss.home}/standalone/deployments" />
啓動JBoss
<exec executable="${jboss.home}/bin/standalone.bat" spawn="true">
等待部署和啓動單元測試
<!-- startup, deploy -->
<target name="deploy-war" description="deploy war file" depends="-start">
<condition property="jboss.online">
<socket server="localhost" port="8080"/>
</condition>
<echo message="${jboss.online}"> ONLINE STATUS</echo>
<sequential>
<echo>WAITING FOR DEPLOYMENT...</echo>
<waitfor>
<or>
<available file="${jboss.home}/standalone/deployments/main.ear.deployed" />
<available file="${jboss.home}/standalone/deployments/main.ear.failed" />
</or>
</waitfor>
<condition property="deployed">
<available file="${jboss.home}/standalone/deployments/main.ear.deployed" />
</condition>
<antcall target="deploy.failed"/>
<antcall target="deploy.success"/>
<echo>+----------------------------+</echo>
<echo>| W A R D E P L O Y E D |</echo>
<echo>+----------------------------+</echo>
</sequential>
</target>
<!-- Deploy success, run unit tests -->
<target name="deploy.success" if="deployed">
<echo>DEPLOY SUCCESS</echo>
<sleep seconds="10" />
<antcall target="unit-test.-multi-only-unit-test-noreport"></antcall>
</target>
<!-- Deploy failed, fail -->
<target name="deploy.failed" unless="deployed">
<echo>DEPLOY FAILED</echo>
<fail/>
</target>
如果出現任何故障,致電螞蟻錯誤,所以詹金斯將發送郵件有關錯誤。
當我修改我的代碼,我將發佈最終版本
到目前爲止,我想只是一個ant腳本的解決辦法的,我認爲沒有很大的機會找到任何東西。 – CsBalazsHungary