Build Fails when using ANT for TestNG | Selenium Forum
M
Posted on 22/01/2017
I am trying to build & compile a TestNG project using ANT but getting - "D:\Chetan\Eclipse_Workspace\Training_Day9_TestNGTutorial\build.xml:39: taskdef class org.testng.TestNGAntTask cannot be found
using the classloader AntClassLoader[]

Total time: 0 seconds"

The build.xml was copied from one of the folders having the training code.

After checking the build.xml file, I observed that there is a warning message - "Multiple markers at this line
- taskdef class org.testng.TestNGAntTask cannot be found using the classloader
AntClassLoader[]
- Ant breakpoint [line: 38]"

Please let me know how can I remove the above WARNING.

PFA the build.xml that is being used

M
Replied on 22/01/2017

send a screen shot of the exception.


M
Replied on 31/01/2017

PFA the 2 screenshot separately for the build failures

Responsive image

M
Replied on 31/01/2017

Also there is a warning message inside the build.xml file. please find below the entire message which i get when i hover the curson on the warning icon:

Multiple markers at this line
- taskdef class org.testng.TestNGAntTask cannot be found using the classloader AntClassLoader[C:\Users\Chetan
\.p2\pool\plugins\org.apache.ant_1.9.6.v201510161327\lib\ant-antlr.jar;C:\Users\Chetan\.p2\pool\plugins
\org.apache.ant_1.9.6.v201510161327\lib\ant-apache-bcel.jar;C:\Users\Chetan\.p2\pool\plugins
\org.apache.ant_1.9.6.v201510161327\lib\ant-apache-bsf.jar;C:\Users\Chetan\.p2\pool\plugins
\org.apache.ant_1.9.6.v201510161327\lib\ant-apache-log4j.jar;C:\Users\Chetan\.p2\pool\plugins
\org.apache.ant_1.9.6.v201510161327\lib\ant-apache-oro.jar;C:\Users\Chetan\.p2\pool\plugins
\org.apache.ant_1.9.6.v201510161327\lib\ant-apache-regexp.jar;C:\Users\Chetan\.p2\pool\plugins
\org.apache.ant_1.9.6.v201510161327\lib\ant-apache-resolver.jar;C:\Users\Chetan\.p2\pool\plugins
\org.apache.ant_1.9.6.v201510161327\lib\ant-apache-xalan2.jar;C:\Users\Chetan\.p2\pool\plugins
\org.apache.ant_1.9.6.v201510161327\lib\ant-commons-logging.jar;C:\Users\Chetan\.p2\pool\plugins
\org.apache.ant_1.9.6.v201510161327\lib\ant-commons-net.jar;C:\Users\Chetan\.p2\pool\plugins
\org.apache.ant_1.9.6.v201510161327\lib\ant-jai.jar;C:\Users\Chetan\.p2\pool\plugins\org.apache.ant_1.9.6.v201510161327\lib
\ant-javamail.jar;C:\Users\Chetan\.p2\pool\plugins\org.apache.ant_1.9.6.v201510161327\lib\ant-jdepend.jar;C:\Users\Chetan
\.p2\pool\plugins\org.apache.ant_1.9.6.v201510161327\lib\ant-jmf.jar;C:\Users\Chetan\.p2\pool\plugins
\org.apache.ant_1.9.6.v201510161327\lib\ant-jsch.jar;C:\Users\Chetan\.p2\pool\plugins\org.apache.ant_1.9.6.v201510161327\lib
\ant-junit.jar;C:\Users\Chetan\.p2\pool\plugins\org.apache.ant_1.9.6.v201510161327\lib\ant-junit4.jar;C:\Users\Chetan\.p2\pool
\plugins\org.apache.ant_1.9.6.v201510161327\lib\ant-launcher.jar;C:\Users\Chetan\.p2\pool\plugins
\org.apache.ant_1.9.6.v201510161327\lib\ant-netrexx.jar;C:\Users\Chetan\.p2\pool\plugins
\org.apache.ant_1.9.6.v201510161327\lib\ant-swing.jar;C:\Users\Chetan\.p2\pool\plugins
\org.apache.ant_1.9.6.v201510161327\lib\ant-testutil.jar;C:\Users\Chetan\.p2\pool\plugins
\org.apache.ant_1.9.6.v201510161327\lib\ant.jar;C:\Program Files\Java\jre1.8.0_121\lib\tools.jar;C:\Users\Chetan\eclipse\jee-
neon\eclipse\configuration\org.eclipse.osgi\111\0\.cp\ant_tasks\resources-ant.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse
\configuration\org.eclipse.osgi\279\0\.cp\ant_tasks\emf.ant.tasks.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse\configuration
\org.eclipse.osgi\299\0\.cp\ant_tasks\importer.ecore.tasks.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse\configuration
\org.eclipse.osgi\300\0\.cp\ant_tasks\importer.java.tasks.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse\configuration
\org.eclipse.osgi\301\0\.cp\ant_tasks\importer.rose.tasks.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse\configuration
\org.eclipse.osgi\336\0\.cp\ant_tasks\director-ant.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse\configuration\org.eclipse.osgi
\343\0\.cp\lib\jarprocessor-ant.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse\configuration\org.eclipse.osgi\345\0\.cp\ant_tasks
\metadataRepository-ant.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse\configuration\org.eclipse.osgi\348\0\.cp\ant_tasks
\pdepublishing-ant.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse\configuration\org.eclipse.osgi\351\0\.cp\lib\repository-tools-
ant.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse\configuration\org.eclipse.osgi\371\0\.cp\ant_tasks\helpbase-ant.jar;C:\Users
\Chetan\eclipse\jee-neon\eclipse\configuration\org.eclipse.osgi\382\0\.cp\jdtCompilerAdapter.jar;C:\Users\Chetan\eclipse
\jee-neon\eclipse\configuration\org.eclipse.osgi\674\0\.cp\lib\apitooling-ant.jar;C:\Users\Chetan\.p2\pool\plugins
\org.eclipse.pde.build_3.9.200.v20160204-0642\lib\pdebuild-ant.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse\configuration
\org.eclipse.osgi\678\0\.cp\ant_tasks\pde-ant.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse\configuration\org.eclipse.osgi
\803\0\.cp\ant-lib\anttasks.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse\configuration\org.eclipse.osgi\928\0\.cp\lib
\xinclude.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse\configuration\org.eclipse.osgi\80\0\.cp\lib\antsupportlib.jar;C:\Users
\Chetan\eclipse\jee-neon\eclipse\configuration\org.eclipse.osgi\81\0\.cp\lib\loggers.jar;C:\Users\Chetan\eclipse\jee-neon
\eclipse\configuration\org.eclipse.osgi\81\0\.cp\lib\antdebug.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse\configuration
\org.eclipse.osgi\81\0\.cp\lib\remote.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse\configuration\org.eclipse.osgi\82\0\.cp\lib
\antrunner.jar;C:\Users\Chetan\eclipse\jee-neon\eclipse\configuration\org.eclipse.osgi\82\0\.cp\lib\remoteAnt.jar]
- Ant breakpoint [line: 38]


M
Replied on 31/01/2017

add extent reports jar files in ant jars folder.


M
Replied on 01/02/2017

From where can I get these jar files. I downloaded apache-ant-1.10.0 and have configured the same under Environment Variables. are the extent reports jar files not part of - apache-ant-1.10.0


M
Replied on 01/02/2017

download this https://drive.google.com/open?id=0ByJmgAhaLx0GVzktVFNNUEZPeWc

and add this file to D://chetan/jars folder.