通过ant运行java app项目时,ant正在寻找log4j属性,
有人可以帮助我如何将资源/log4j.properties 包含到我的项目的编译中,以便我可以使用 log4j
这是我的 build.xml
<property name="maven.repo.local" value="${user.home}/.m2/repository" />
<target name="clean">
<echo message="deleting directory build" />
<delete dir="build" />
</target>
<target name="compile" depends="clean">
<echo message="creating directory build/classes" />
<mkdir dir="build/classes" />
<echo message="compiling source codes" />
<javac srcdir="src" classpathref="jars" includeantruntime="false" destdir="build/classes" />
</target>
<target name="jar" depends="clean,compile">
<echo message="creating a Jar fire, using compiled classes from build/classes" />
<mkdir dir="build/jar" />
<jar destfile="build/jar/HelloWorld.jar" basedir="build/classes">
<manifest>
<attribute name="Main-Class" value="com.sample.anttutorial.Main" />
</manifest>
<zipgroupfileset dir="${maven.repo.local}" includes="log4j/log4j/1.2.17/log4j-1.2.17.jar" />
</jar>
</target>
<target name="run">
<java jar="build/jar/HelloWorld.jar" fork="true" />
</target>
<path id="jars">
<fileset dir="${maven.repo.local}" includes="log4j/log4j/1.2.17/log4j-1.2.17.jar" />
</path>