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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:37:02+00:00 2026-05-28T18:37:02+00:00

Unit test is in Java, using Maven to build & run. I can use

  • 0

Unit test is in Java, using Maven to build & run. I can use either local jars “outside” Maven or local Maven repository.

However, I’d like to figure out a way to do this automatically somehow, without changing the pom.xml->running ->changing the pom.xml

Is there any other way except the above or creating pom.xmls which only differ in the specific library version?

(I’m using IntelliJ if that’s of any use)

  • 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-28T18:37:03+00:00Added an answer on May 28, 2026 at 6:37 pm

    You could also read the version of your lib from a property, like

        <dependency>
            <groupId>javax.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>${jsp.api.version}</version>
        </dependency>
    

    You can set this property in several ways, e.g. loading build-specific properties file.

    You could even specify it as a parameter when running the build. On the command line svn, this is something like

     mvn -Djsp.api.version=1.8 install
    

    Don’t know how to specify such an property when running Maven from inside IntelliJ, but I’m sure it’s possible….

    This approach would give you full flexibility to freely speficy the lib version for each build. But if you only have a limited number of versions you want to choose from, using profiles is probably the better way to go. Just define a profile for each version number and the always tell Maven which profile to use when you run a build.

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

Sidebar

Related Questions

I'm using IntelliJ-Idea to write Java daemons. We use JUnit to unit test our
If writing a Java unit test with mocking using JMock, should we use Mockery
We build software using Hudson and Maven. We have C#, java and last, but
I am writing my unit test cases for a Java project using Scala (JUnit
I want to run single test class from command line using Maven and TestNG
I am using EasyMock to unit test my Java code. The class I'm trying
I'm using Hudson to build a Java project w/ Maven. The project includes two
I'm setting up a unit test in my Java EE application. I'm using JPA,
I'm trying to unit test a java WFS web service implementation. The service can
I have algorithm/computation in Java and unit test for it. The unit test expects

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.