在 Eclipse 中构建 Java 后如何自动导出 WAR? [英] How do I automatically export a WAR after Java build in Eclipse?

查看:24
本文介绍了在 Eclipse 中构建 Java 后如何自动导出 WAR?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Eclipse 3.2 中有一个 J2EE 项目,在每次构建结束时,我想自动创建和部署一个 WAR 文件.目前,我必须手动执行此操作,需要 5 或 6 次鼠标点击,如果能自动执行会很好.

I have a J2EE project in Eclipse 3.2 and at the end of every build I want to automatically create and deploy a WAR file. At the moment I have to do this by hand which is 5 or 6 mouse-cliks and it would be nice to automate it.

我知道我可以通过使用 ANT 的自定义构建脚本来做到这一点,但我希望有一个 Eclipse 原生解决方案.

I know I can do this with a custom build script using ANT but I am hoping for an Eclipse native solution.

我在 Eclipse 环境中安装了 J2EE 标准工具 (JST) 和 Web 标准工具 (WST) 插件.

I have the J2EE standard tools (JST) and Web Standard Tools (WST) plug-ins installed in my Eclipse environment.

推荐答案

如果您可以将其实现为 Ant 脚本,那么您可以让 Eclipse 在每次构建时(以及在 Eclipse 环境中)自动调用该 Ant 脚本.使用 Project->Properties->Builders->Add->Ant Builder.为该构建器提供您自定义的 Ant 脚本,它将在您项目的普通"构建器之后自动执行.

If you can implement it as an Ant script, then you can have Eclipse invoke that Ant script on each build automatically (and inside the Eclipse environment). Use Project->Properties->Builders->Add->Ant Builder. Give that builder you custom Ant script and it will automatically be executed after the "normal" builders of your project.

这篇关于在 Eclipse 中构建 Java 后如何自动导出 WAR?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆