我正在eclipse中进行一个java项目,最近我发现需要重新创建build.xml,因为我无意中删除了旧版本(woops)的内容。现在,当我去调试我的工作时,stracktrace说未知源,它应该显示我的行号和它所属的文件。我利用了这一点,因此我确切地知道在代码中查找问题的位置。如果没有这个,就很难在我的代码中搜索错误。
下面是my build.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project name="FoolishPlugin">
<description>Creates the plugin of the fools...</description>
<path id="Foolish Plugin.classpath">
<!-- Spare you the details -->
</path>
<path id="Maven Dependencies.libraryclasspath">
<!-- Spare you this long list of stuff -->
</path>
<!-- set global properties for this build -->
<property name="src" location="src" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<property name="version" value="1.0" />
<!-- init -->
<target name="init">
<!-- Create the time stamp -->
<tstamp />
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}" />
</target>
<!-- compile -->
<target name="compile" depends="init" description="compile the source">
<!-- Compile the java code from ${src} into ${build} -->
<javac debug="true" debuglevel="lines" srcdir="${src}" destdir="${build}" includeantruntime="false">
<classpath refid="Foolish Plugin.classpath" />
</javac>
</target>
<target name="create-funky-jar" depends="compile" description="Creates the jar ya filthy animal">
<buildnumber />
<!-- Create the distribution direct ory -->
<mkdir dir="${dist}/lib" />
<copy todir="${build}">
<fileset dir="resources/" />
</copy>
<!-- Put everything in ${build} into the MyApplication-${version}.${build.number}.jar -->
<jar destfile="${dist}/lib/Fools-${version}.${build.number}.jar" basedir="${build}" />
</target>
</project>
我试着研究如何具体返回行号,我发现的建议是将debug标记设置为true,将debuglevel设置为line,这两个选项都是我添加的(从粘贴中可以看到)。然而,两者都没有产生影响,因为我仍然在堆栈跟踪中获得未知的源消息。
有什么想法吗?
暂无答案!
目前还没有任何答案,快来回答吧!