Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6382315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:30:24+00:00 2026-05-25T02:30:24+00:00

I am trying to run a build file using Ant. I am using Maven

  • 0

I am trying to run a build file using Ant. I am using Maven for dependencies. I am having a testNG dependency in my project.

This is the pom.xml file

<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>be.anova.abis</groupId>
    <artifactId>maven-pom</artifactId>
    <packaging>pom</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>My first Maven POM</name>
<dependencies>
    <dependency>  
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>6.2</version>
    </dependency>
</dependencies>
</project>

The maven downloads the testNG from mavenrepository, but I am getting an error, it is complaining that it can not find org.testng.Assert and org.testng.annotations.Test. (as below)

Compiling 10 source files to /home/shahin/Files/Development/Ant/ServiceEJBSample3/bin
    [javac] /home/shahin/Files/Development/Ant/ServiceEJBSample3/ejbModule/net/company/test/Service1Test.java:5: package org.testng does not exist
    [javac] import org.testng.Assert;
    [javac]                  ^
    [javac] /home/shahin/Files/Development/Ant/ServiceEJBSample3/ejbModule/net/company/test/Service1Test.java:6: package org.testng.annotations does not exist
    [javac] import org.testng.annotations.Test;
    [javac]                              ^
    [javac] /home/shahin/Files/Development/Ant/ServiceEJBSample3/ejbModule/net/company/test/Service1Test2.java:5: package org.testng does not exist
    [javac] import org.testng.Assert;
    [javac]                  ^

If I don’t use maven and simply use ant and specify the location where the testNG.jar file is, there is no problem at all. I have used the same .jar file that maven downloaded for Ant to make sure I am using the same source. I also have tried different versions of testNG from maevnrepo. Any insights ?

Do I need to include all dependencies (all different packages? like org.testng.Assert and org.testng.annotationsTest and as such) in the POM file? or just the one is enough? If I need to have all of them listed in POM file, what is the best and fastet way of doing it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:30:25+00:00Added an answer on May 25, 2026 at 2:30 am

    I have cleaned the maven and revised the build.xml file once again, it works now. Probably it was something wrong in the repository. Thanks all for your input.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get SpecUnit to run in a continuous integration build using
When trying to run an Eclipse Dynamic Web Project under a Tomcat setup using
I'm trying to run Watin from within a TeamCity build, using nUnit. All tests
I have created a jar file usign maven2 build. I am trying to run
I'm trying to run some tests in Ant presently using JUnit, and all of
I'm using ubuntu 64-bit and trying to run a .asm file on NASM. But
I am trying to run an Ant task from within IBM RSA IDE using
I'm trying to run this script: import re, os def build_pool(cwd): global xtn_pool, file_pool
I'm trying to build my first generic list and have run into some problems.
I am trying to setup a TeamCity 4.0 build server to run VS2008 (non-TFS)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.