有人能让我知道配置Liberty服务器以自动从项目文件夹中指定位置选择ant build war文件并在liberty服务器运行时部署该文件的步骤。
答案 0 :(得分:1)
使用在WASdev/ci.ant项目中定义的Liberty Ant任务,可以部署带有以下内容的WAR:
<project xmlns:wlp="antlib:net.wasdev.wlp.ant" name="net.wasdev.wlp.ant.it">
<path id="wlp-ant-tasks.classpath">
<fileset dir="${basedir}/../../../../target" includes="wlp-anttasks-*.jar" />
</path>
<typedef resource="net/wasdev/wlp/ant/antlib.xml" uri="antlib:net.wasdev.wlp.ant" classpathref="wlp-ant-tasks.classpath" />
<property name="target.dir" value="${basedir}/../install-server-it/target" />
<!-- Defining server configuration -->
<property name="wlp.install.dir" value="${target.dir}/wlp" />
<property name="wlp.usr.dir" value="${target.dir}/wlp_usr" />
<property name="wlp.output.dir" value="${target.dir}/wlp_output" />
<property name="servername" value="deploy.war" />
<target name="deploy">
<wlp:server id="testServer" installDir="${wlp.install.dir}" serverName="${servername}" userDir="${wlp.usr.dir}" outputDir="${wlp.output.dir}" operation="status" />
<wlp:server ref="testServer" operation="start" />
<wlp:deploy ref="testServer">
<fileset dir="${basedir}/../../setup/test-war/target">
<include name="*.war" />
</fileset>
</wlp:deploy>
</target>
</project>
您可以从Maven Central here获取 wlp-anttasks-*。jar ,也可以通过克隆WASdev/ci.ant项目并进行Maven构建在本地进行构建。