【发布时间】:2015-07-06 18:20:53
【问题描述】:
我有一个战争(使用 Struts 1.x jars 构建)已部署在服务器上但没有相应的源代码,所以我基本上已经从 jar 中提取了 .class 文件并对其进行反编译并尝试构建源代码(项目)并提交到存储库。
所以,我想使用 Ant 工具创建一个 Struts 1.x 项目,将其导入 Eclipse IDE,然后生成一个战争。
我尝试了以下方法:
1.创建了一个动态 Web 项目并添加了 struts jars
New -> Other -> Web - >Dynamic Web Project
Updated web.xml & created struts-config.xml under WEB-INF
Then struts jars were added to build path
2。为现有项目创建了 Ant 构建文件
Select File > Export from main menu<br/>
In the Export dialog, select General > Ant Buildfilesas follows:
Click Next. In the Generate Ant Buildfilesscreen:
Check the project in list.
Uncheck the option "Create target to compile project using Eclipse compiler" because we want to create a build file which is independent of Eclipse.
Leave the Name for Ant buildfile as default: build.xml
Click Finish, Eclipse will generate the build.xmlfile
3.运行 Ant build 来构建战争。
这是使用ant工具构建战争的正确方法吗?或者有没有其他办法?
【问题讨论】:
-
我尝试了以下步骤 1) 创建了一个动态 Web 项目并添加了 struts jar 2) 为现有项目创建了一个 ant 构建文件 3) 运行 ant build 来构建一个战争。
-
我没有遇到任何问题。我想知道如何使用 ANT 工具创建一个 struts 项目。我是 ANT 工具的新手(在 maven 中,我们指定 struts-archetype 来构建项目,它会创建整个项目结构并下载所需的 jars)。那么,如何使用ant工具创建一个struts项目呢?
-
Struts 1.3.x 已被正式废弃多年。并且您正在使用 Struts 1.0 开始一个新项目?为什么?
-
我有一个战争(使用 Struts 1.x jars 构建)已部署在生产服务器上但没有相应的源代码,所以我基本上已经从 jar 和 de -编译它们并尝试构建源代码(项目)并提交到存储库