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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:08:25+00:00 2026-06-18T12:08:25+00:00

I made some unit-tests using fest , now I need to run mvn my

  • 0

I made some unit-tests using fest, now I need to run mvn my test using maven on a headless system. I would like to run test using Xvfb but I need help to configure maven to start Xvfb before testing and stop it when all is done.

  • 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-18T12:08:26+00:00Added an answer on June 18, 2026 at 12:08 pm

    Actually I use this plugin configuration:

    <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
            <execution>
                <id>start-xvfb</id>
                <phase>process-test-classes</phase>
                <goals>
                    <goal>run</goal>
                </goals>
                <configuration>
                    <tasks>
                        <echo message="Starting xvfb ..." />
                        <exec executable="Xvfb" spawn="true">
                            <arg value=":1" />
                        </exec>
                    </tasks>
                </configuration>
            </execution>
            <execution>
                <id>shutdown-xvfb</id>
                <phase>test</phase>
                <goals>
                    <goal>run</goal>
                </goals>
                <configuration>
                    <tasks>
                        <echo message="Ending xvfb ..." />
                        <exec executable="killall">
                                <arg value="Xvfb" />
                        </exec>
                    </tasks>
                </configuration>
            </execution>
        </executions>
    </plugin>
    

    The good is that you get a background process (with spawn = "true") and you can kill the Xvfb process (with killall) without having to write any script. Moreover in my Ubuntu distro I don’t hav to set any special setting in my sudoers file to let this works.

    The shutdown-xvfb execution is executed at the end of the test phase but (here is the problem) is not executed if the test fail. This is not a problem if you want to restart another test (the old Xvfb is still running and the new one can’t run, but this is not a problem) but the problem is that the resources are still busy by Xvfb. A workaround for this could be to add testFailureIgnore = "true" to the configuration of maven-surefire-plugin but this way I can’t easily see if some test fail.

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

Sidebar

Related Questions

I've made some unit tests (in test class). The tutorial I've read said that
I have a class that I made for some unit tests. Everything was going
In my project I want to run some unit tests on the DAL layer
I am trying to write some unit tests that test the endpoints for my
I am trying to write some unit tests against a view model using SimpleMvvmToolkit,
I made some source changes to lint my code. I did not run unit
I made some little programs with Swing-components in JRuby. Now I want to convert
I am working on a series of unit tests in Python, some of which
How do you do unit testing when you have some general unit tests more
Have created an android test project and currently trying to write android unit tests

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.