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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:04:11+00:00 2026-06-10T21:04:11+00:00

I have a maven build process that publishes executable jars and their tests to

  • 0

I have a maven build process that publishes executable jars and their tests to Nexus.
I have another maven build process that needs to access these jars (executable + test) and run the tests.

How do I go about it? So far I have managed to do this only if the jar is exploded to class files.
I am new to maven and completely lost in the documentation.

  • 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-10T21:04:12+00:00Added an answer on June 10, 2026 at 9:04 pm

    Update 2022-03-11

    The feature has been implemented, see https://stackoverflow.com/a/17061755/1589700 for details

    Original answer

    Surefire and failsafe do not currently support running tests from within a jar.

    This is largely a case of not being able to identify the tests.

    There are two ways to get the tests to run.

    1. Use a test suite that lists all the tests from the test-jar. Because the test suite will be in src/test/java (more correctly will be compiled into target/test-classes) that will be picked up and all the tests in the suite will be run by Surefire/failsafe (assuming the suite class name matches the includes rule: starts or ends with Test)

    2. Use the maven dependency plugin’s unpack-dependencies goal to unpack the test-jar into target/test-classes (this screams of hack, but works quite well)

    The main issue with the first option is that you cannot easily run just one test from the suite, and you need to name every test from the test-jar

    For that reason I tend to favour option 2… There is the added benefit that option 2 does not mean writing code to work around a limitation in a build tool plugin… The less you lock yourself into a specific build tool, the better IMHO

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

Sidebar

Related Questions

I'm working in a project that already have a build process running with maven
I have a project that needs the following Maven jibx plugin: <build> <plugins> <plugin>
I have written an OSS plugin to start/stop Derby during a Maven build process.
For example, let's say I have a Maven build file that has dependencies located
Currently we have a script that does maven build + tomcat deploy. Deploying to
I am currently migrating our build process from Eclipse/Ant to Maven/M2Eclipse/Artifactory. I have a
We are using Maven for a large build process (> 100 modules). We have
I have a Maven build with three modules. Module A exports a jar. Module
i have to setup an android maven build for a customer, which previously was
I have a requirement for my MAVEN build to pick a single jar from

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.