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

  • Home
  • SEARCH
  • 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 5987651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:50:46+00:00 2026-05-22T22:50:46+00:00

I cannot make these two work together in eclipse I can set up surefire

  • 0

I cannot make these two work together in eclipse

I can set up surefire plugin like this

<suiteXmlFiles>
        <suiteXmlFile>${basedir}/src/test/resources/testng.xml</suiteXmlFile>
    </suiteXmlFiles>
    <testResources>
        <testResource>
            <directory>${project.basedir}/src/test/java</directory>
            <includes>
                <include>**/*.*</include>
            </includes>
        </testResource>
        <testResource>
            <directory>${project.basedir}/src/test/resources</directory>
            <includes>
                <include>**/*</include>
            </includes>
        </testResource>
    </testResources>

and run $mvn test and all resources are compiled and moved into /target/test-classes, which works fine.

But if I run $mvn clean and then use the TestNG view to run some tests, there is nothing compiled in /target/test-classes, so that I either have to run test phase before that, or somehow employ maven-compiler-plugin:testCompile goal to compile test resources …

but maven-compiler-plugin:2.3.2:testCompile isn’t setup like surefire plugin via the testResources configuration. It just compiles test source code into test-classes

What should I do to make testNG execute as if I run surefire plugin ? I somehow need the effect that results from <testResources>

  • 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-22T22:50:47+00:00Added an answer on May 22, 2026 at 10:50 pm

    testResources & resources is part of maven-resources-plugin

    compile & test-compile is part of maven-compiler-plugin

    So that all you have to do is to click a button that invokes all these phases & goals before you run tests via TestNG view

    compile 
    test-compile
    maven-resources-plugin:resources 
    maven-resources-plugin:testResources 
    

    Also, and this is very important, whenever you run test(s) from the TestNG view, eclipse creates a temporary testng.xml definition with the test(s) you have clicked on, either a test or a class of tests. So that additional settings in testng.xml that you have when running via SureFire plugin gets lost if you are using testNG run configuration via Eclipse’s Run As … it looks like this

    /tmp/testng-eclipse-388280625/testng-customsuite.xml
    

    –

    <suite name="Default suite">
      <test verbose="2" name="Default test">
        <classes>
          <class name="com.example.tests.selenium.SubmitUploadFormTest"/>
        </classes>
      </test>
    </suite>
    

    It has a convenient way to deal with this – setting up a template testng.xml file in eclipse testng preferences.

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

Sidebar

Related Questions

We're testing WYSIWYG editors, and we cannot see to make them work with asynchronous
I cannot get a two-way bind in WPF to work. I have a string
I am storing objects in a buffer. Now I know that I cannot make
I cannot figure out how to make a C# Windows Form application write to
I need to make an ArrayList of ArrayLists thread safe. I also cannot have
I cannot understand how this is possible. Please help!! I have an app with
This is more like a package/import test. We'll start with my base folder at
I'm trying to get the permit method to work using the rails-authorization-plugin and authlogic
If I have these two classes: class A {} class B : A {}
I cannot figure out how to change the title bar icon (the icon in

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.