【发布时间】:2020-10-29 10:40:35
【问题描述】:
我需要一些建议,以便了解该做什么以及如何理解一个我从未见过的非常糟糕的项目。 这是一个带有 servlet 和 jsp 的 Java 5 项目,看起来像是用 ant 构建的。
它被许多不同的人多次更新。我已经尝试在这部分应该构建它的地方启动 ant build.xml 脚本(其他人指的是库,我猜这并不重要)。
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<javac debug="true" debuglevel="${debuglevel}" destdir="WebContent/WEB-INF/classes" includeantruntime="false" source="${source}" target="${target}">
<src path="src/xxx_src"/>
<src path="src/yyy_src/00_hibernate"/>
<src path="src/yyy_src/00_jblooming"/>
<src path="src/yyy_src/00_jblooming_waf"/>
<src path="src/yyy_src/00_svn"/>
<src path="src/yyy_src/05_designer"/>
<src path="src/yyy_src/20_indexing"/>
<src path="src/yyy_src/40_website"/>
<src path="src/yyy_src/42_forum"/>
<src path="src/yyy_src/50_core"/>
<src path="src/yyy_src/52_flowork"/>
<src path="src/yyy_src/88_JES_mailserver"/>
<classpath refid="xxx.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
我区分 XXX 和 YYY,因为它是两个不同的项目。 Intellij 检测为 2 个不同的包。不知道这是如何工作的。 通过运行它,它会创建一个“out”目录,但没有 jar,甚至没有 .class 文件。 通过运行 Tomcat(当然)给出的例外是无法找到主类。我是新手,我很困惑。项目结构是我以前从未见过的。
由于某些原因,在实用程序内部我们有 Tomcat 服务器和一些图像。 在 src 中,我们有 2 个目录“xxx_src”和“yyy_src”,在 Intellij 中,它看起来像这样:
每个以数字开头的目录都有一个包含逻辑的 org 或 com 目录。 在 50_core 内部,我们有业务逻辑和模型,因此 Java 类按部分划分。例如:
50_core/com/yyyproject/agenda/businessLogic/AgendaAction.java
50_core/com/yyyproject/agenda/businessLogic/AgendaController.java
50_core/com/yyyproject/task/Assignment.java
我需要让它运行,但我真的不知道如何进行或在哪里查看。任何帮助我避免发生炉火袭击的建议将不胜感激。
【问题讨论】:
标签: java tomcat ant setup-project disaster-recovery