WAR 使用 Ant 脚本创建的文件未在 Eclipse 中调试
WAR file created using Ant script not debugging in eclipse
我目前正在使用 struts 和 Eclipse 以及 JBoss 5.0 开发 Web 应用程序。我正在使用 Ant 编译和构建 war 结构,Web 应用程序是 运行 在 Jboss 和 eclipse 中成功。但是从调试的角度来看,当我在 eclipse 中放置断点时,调试器会在该断点处停止(它甚至不会在 eclipse 中显示附加源)。
我想知道如何通过 ant 工具和 eclipse 调试我的 Java 代码。
我看到了类似的问题here。但这对我没有帮助。
提前感谢您的帮助。
与ANT无关。您需要在调试模式下启动 JBoss。有几十个 articles and answers 描述了如何做到这一点。
我找到了我在 build.xml 中遗漏的内容。在 Ant 中编译我们的源代码时,我们应该提供 debug=true 属性。
<javac srcdir="${src.dir}" destdir="${build.dir}/WEB-INF/classes" debug="true" >
<classpath refid="classpath"/>
</javac>
我目前正在使用 struts 和 Eclipse 以及 JBoss 5.0 开发 Web 应用程序。我正在使用 Ant 编译和构建 war 结构,Web 应用程序是 运行 在 Jboss 和 eclipse 中成功。但是从调试的角度来看,当我在 eclipse 中放置断点时,调试器会在该断点处停止(它甚至不会在 eclipse 中显示附加源)。 我想知道如何通过 ant 工具和 eclipse 调试我的 Java 代码。
我看到了类似的问题here。但这对我没有帮助。
提前感谢您的帮助。
与ANT无关。您需要在调试模式下启动 JBoss。有几十个 articles and answers 描述了如何做到这一点。
我找到了我在 build.xml 中遗漏的内容。在 Ant 中编译我们的源代码时,我们应该提供 debug=true 属性。
<javac srcdir="${src.dir}" destdir="${build.dir}/WEB-INF/classes" debug="true" >
<classpath refid="classpath"/>
</javac>