0

Java Maven Spring Junit with webapplication

I am using following code to load property file into spring context placer holder.

<context:property-placeholder location="file:${RESOURCE_PATH}/jdbc.properties" />

in eclipse Junit run time configuration i have defined "RESOURCE_PATH" so it runs fine when i execute my junit tests from GUI but when i run from maven they fail.

Can we define variable and pass in pom file at run time ?

1 Answer 1

1

You should either supply the property RESOURCE_PATH using -D switch when running maven or put it into pom.xml into section <properties>; something like this:

<properties>
    <RESOURCE_PATH>put your path here</RESOURCE_PATH>
</properties>
1
  • 1
    i want it to available only for test cases
    – d-man
    Jun 10, 2013 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.