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 8437033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:19:38+00:00 2026-06-10T07:19:38+00:00

I met a problem when I use maven failsafe plugin to run integration test.

  • 0

I met a problem when I use maven failsafe plugin to run integration test.
I have two classes one is TestUnitTest.java the other is TestIntegrationIT.java.
in pom.xml, I configure as below:

<plugin>                
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
        <excludes>
            <exclude>**/*IT.java</exclude>
        </excludes>
    </configuration>
    <executions>
        <execution>
            <id>unit-tests</id>
            <phase>test</phase>
            <goals>
                <goal>test</goal>
            </goals>
        </execution>
    </executions>
</plugin>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <configuration>
        <includes>
            <include>**/*IT.java</include>
        </includes>
    </configuration>                    
    <executions>
        <execution>
            <id>integration-test</id>
            <phase>integration-test</phase>
            <goals>
                <goal>integration-test</goal>                           
            </goals>
        </execution>
    </executions>
</plugin>

when I run mvn:integration-test, will execute both tests, when I run mvn failsafe:integration-test then only run the “TestIntegrationIT”. Why output the different results?

  • 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-06-10T07:19:40+00:00Added an answer on June 10, 2026 at 7:19 am

    The includes for maven-surefire-plugin are defined like *Test, *TestCase whereas maven-failsafe-plugin are defined with IT.java, IT.java or *ITCase.java. So you don’t need to define includes for maven-surefire-plugin or maven-failsafe-plugin use the defaults. If you wan’t to name an integration test just name it NameIT.java whereas a unit test can be named like NameTest.java.
    To run your unit tests and/or the integration test you should use the lifecylce either:

    mvn package
    

    which will run the unit tests whereas

    mvn verify
    

    will run the unit tests and the integration tests.

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

Sidebar

Related Questions

I met strange problem. I have never work with Devise gem before. So, i
I use sphinx + thinking_sphinx on my local machine and met really strange problem.
I'm new to apache-camel and know i met a problem. I want to use
Ha ii everybody,i met with a problem in one of my view-controllers in my
I met a strange problem. If I use for loop to render html into
I have met an interesting problem while implementing the Observer pattern with C++ and
I met a problem with sum function: the data have a datetime column and
Good day! I have met problem with synchronizing threads. I am writing program which
I met a problem like this. class A have a list of class B.
I met very strange problem. I have Timetable model and try to write my

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.