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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:48:46+00:00 2026-05-26T21:48:46+00:00

In a maven project I have some junit tests where I need to refer

  • 0

In a maven project I have some junit tests where I need to refer to some runtime libraries (the birt runtime) when running the tests:

  @Before
  public void setup() {
    // init osgi/birt rte.
    BEngine.getEngine().init("C:\\birt-runtime-2_6_1\\ReportEngine\\");
  }

  @Test
  public void testname() {
       // run test that requires the initialization of the above rte.
  }

This works fine when running the tests locally from eclipse. My maven project is also build on a linux server running jenkins but currently I disable tests that requires the above runtime libs.

I am considering to copy the runtime libs to the server running hudson and see if I can get hudson to pick up the location of these files when the tests are executed on hudson.

But to do this I need to use the correct location of the rte in the tests.

Any suggestions for doing this? Eg using env variables that can both be understood on windows/linux?

  • 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-26T21:48:47+00:00Added an answer on May 26, 2026 at 9:48 pm

    If the values will not change during the lifetime of the test run (i.e. the build), then use an environmental variable, and just set it as an option in the surefire plugin, systemPropertyVariables.

    The correct way to do this for different environments is to use different profiles in maven.

    You can have a default profile which includes the set of variables for windows, and another for the hudson.

    EDIT: For running the tests correctly from within Eclipse, then simply you can have a default value for the variable

    public String getRteLocation() {
        String s = System.getProperty("test.rte.location");
        return (s == null) ? "C:\\birt-runtime-2_6_1\\ReportEngine\\" : s;
    }
    
    @Before
    public void setup() {
        // init osgi/birt rte.
        BEngine.getEngine().init(getRteLocation());
     }
    

    or simply set the environment variable in the Run Configuration in Eclipse.

    EDIT: Just a clarification, when I say environment variables, I mean the -D variables set from the java command line.

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

Sidebar

Related Questions

I have maven project with several modules. Need to deploy all modules( jars and
I have a maven project that contains a certain api I need to use
I have a Maven (3.0.3) / GWT (2.4) project. I'm trying to write some
So I have a maven project which produces a jar package containing some ant
i have 3 maven project (starto.commons,starto.hibernate,starto.server) that use some same dependencies and two of
Using maven 3.0.4 I have a multi-module maven project, with some modules producing war
I have a Maven project within which I need execute two code generation steps.
I'm using Maven 3.0.3. I want to run some Junit tests in my test
I have a multi module maven project and the directory structure is hierarchical. Some
I have a maven project that uses some custom jars [not found in any

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.