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

  • Home
  • SEARCH
  • 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 6094471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:40:57+00:00 2026-05-23T12:40:57+00:00

when I run java test file(single file) through eclipse by passing arguments -DappRoot=ECM -DappName=ESW

  • 0

when I run java test file(single file) through eclipse by passing arguments

-DappRoot=ECM -DappName=ESW -Dapp.module=FNT -Dapp.env=LOC -DcloneNumber=1

test file executes without error, if I dont give arguments error occurs as Could not resolve placeholder ‘appRoot’.

I have junit target to generate report in html format.

<target name="junit" depends="init-junit">
        <junit printsummary="on" fork="yes" forkmode="perBatch" haltonfailure="false" failureproperty="junit.failure" showoutput="false">           
            <classpath>
                <path refid="CLASSPATH_JUNIT"/>             
            </classpath>            
            <batchtest fork="no"  todir="${TEST_BUILD_DIR}">
               <fileset dir="${COMP_TEST_SRC}">                           
                  <include name="**/*Test.java" />          
               </fileset>              
            </batchtest>
            <formatter type="xml" />
        </junit>        
        <junitreport todir="${JUNIT_REPORT}">
            <fileset dir="${TEST_BUILD_DIR}">
                <include name="TEST-*.xml" />           
            </fileset>       
            <report format="frames" todir="${JUNIT_REPORT}"/>       
        </junitreport>          
    </target>       

When I run above build script, getting following error: Could not resolve placeholder ‘appRoot’ where this has passed as an arguments.

I have passed parameter to build.xml through eclipse, this parameter passes to build.xml file but not passing to java files. How can I solve this?

EDIT:
tried with following parameter:

<junit printsummary="on" fork="yes" forkmode="perBatch" haltonfailure="false" failureproperty="junit.failure" showoutput="false">           
    <jvmarg value="-DappRoot=ECM" />
    <jvmarg value="-DappName=ESW" />
    <jvmarg value="-Dapp.module=FNT" />
    <jvmarg value="-Dapp.env=LOC" />
    <jvmarg value="-DcloneNumber=1" />
    <!--<sysproperty key="appRoot" value="${appRoot}"/>
    <sysproperty key="appName" value="${appName}"/>
    <sysproperty key="app.module" value="${app.module}"/>
    <sysproperty key="app.env" value="${app.env}"/>
    <sysproperty key="cloneNumber" value="${cloneNumber}"/>-->
    <classpath>
        <path refid="CLASSPATH_JUNIT"/>             
    </classpath>

with system paramter it works fine but takes very long time to execute. with jvmarg it doesnt work. same error with

 <jvmarg value="-DappRoot=${appRoot}" />

http://ant.apache.org/manual/Tasks/junit.html doesn’t define any restriction for sys and jvm args.

  • 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-23T12:40:58+00:00Added an answer on May 23, 2026 at 12:40 pm

    The documentation of the junit ant task shows it:

    <junit fork="yes" ...>
        <jvmarg value="-DappRoot=ECM" />
    </junit>
    

    If the appRoot property is passed as a system property to ant, you may access it as an ant property:

    <junit fork="yes" ...>
        <jvmarg value="-DappRoot=${appRoot}" />
    </junit>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use the Eclipse IDE to develop, compile, and run my Java projects. Today,
whenever I try to run something in Java, Eclipse changes into the PHP perspective.
I have created simple Java class to test file writes from applets: update appeared
Multi-Test TestNG.xml file results in java.lang.NullPointerException Hello Quality Team, I need help getting TestNG
I'm trying to use javadoc to document one single java file on window 7,to
I am fairly new to Java. I have constructed a single JUnit test class
I have got the following code in a file called test.java which is located
I'm trying to run my junit test (to verify that a properties file loads
Always when I run java application it will display in Windows Task Manager is
I am trying to run a java based tool using a command line syntax

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.