Добрый день! Пытаюсь собрать проект, всё собираеться до цели "instrument", поэтому её код и выложил,чтоб лишний код не мешал. Именно с log4j выкидывает это, причём jar есть в папке и указываю я на него даже явно, всёравно ругаеться на него..может кто сталкивался с данной проблемой. вот мои пропти:
<property name="src.dir" value="./src" />
<property name="test.dir" value="./test" />
<property name="build.dir" value="build" />
<property name="build.classes.dir" value="build/classes" />
<property name="build.test.dir" value="build/test" />
<property name="lib.dir" value="./libs" />
<property name="cobertura.dir" value="${lib.dir}/cobertura-2.0.3" />
<property name="instrumented.dir" value="${build.dir}/instrumented" />
<property name="build.report.xml.dir" value="./build/report/xml" />
<property name="build.report.html.dir" value="./build/report/html" />
<property name="checktyle.report" value="checkstyle-report.xml" />
<property name="jar_result.dir" value="./cooked_jar" />
<property name="resources.dir" value="./resources" />
<property name="checkstyle.xml" value="${resources.dir}/sun_checks_eclipse.xml" />
<property name="checkstyle.xsl" value="${resources.dir}/checkstyle.xsl" />
а вот classpath и объявлении task-ов:
<path id="classpath.dir">
<fileset dir="${lib.dir}" includes="*.jar" />
<pathelement location="${lib.dir}/log4j-1.2.17.jar" />
<pathelement location="${lib.dir}/commons-logging-1.1.3.jar" />
</path>
<path id="cobertura.classpath">
<pathelement location="${cobertura.dir}/cobertura-2.0.3.jar" />
<pathelement location="${cobertura.dir}/lib/log4j-1.2.9.jar" />
<pathelement location="${lib.dir}/log4j-1.2.17.jar" />
<pathelement location="${cobertura.dir}/lib/asm-4.1.jar" />
<pathelement location="${cobertura.dir}/lib/asm-tree-4.1.jar" />
</path>
<taskdef classpath="${lib.dir}/checkstyle-5.6-all.jar" resource="checkstyletask.properties" />
<taskdef classpath="${cobertura.dir}/cobertura-2.0.3.jar" resource="tasks.properties" />
вот сама задача которая валиться:
<target name="instrument" depends="testcompile">
<echo>Instrument the application classes</echo>
<cobertura-instrument todir="${instrumented.dir}" datafile="cobertura.ser">
<classpath refid="classpath.dir" />
<classpath refid="cobertura.class.path" />
<path location="${cobertura.dir}/lib/log4j-1.2.9.jar" />
<path location="${lib.dir}/log4j-1.2.17.jar" />
<ignore regex="org.apache.log4j.*" />
<fileset dir="${build.classes.dir}">
<include name="**/*.class" />
<exclude name="**/*Test*.class" />
</fileset>
</cobertura-instrument>
<echo>Instrument the application classes Comleted!</echo>
</target>
А вот лог ошибки:
BUILD FAILED
D:\workspace\Labs\build.xml:135: java.lang.NoClassDefFoundError
: org/apache/log4j/Logger
at net.sourceforge.cobertura.util.CommandLineBuilder.<clinit>(CommandLin
eBuilder.java:72)
at net.sourceforge.cobertura.ant.InstrumentTask.execute(InstrumentTask.j
ava:166)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:811)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoa
der.java:1365)
at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:131
5)
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:106
8)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 18 more
Total time: 4 seconds
Спасибо за внимание!:-)