You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Wicked J <wi...@gmail.com> on 2012/03/10 05:00:42 UTC

Issue with mvn test finding a file in resources

Hello,

I'm using MethodInvokingFactoryBean to pass the JKS location info as shown
below. My web services client is passed with this JKS (through system
props) and makes a call to remote web service. In the code below, the
location of the JKS is per my local dev box and for production environment
the location of the JKS will be different. I'm using a Maven multi module
project and integration is a maven module which will be packaged finally as
a JAR file in the Web App -WAR file. The issue is when I pass a relative
location i.e. ./integration/src/main/resources/sample.jks the Junit test
fails complaining it couldn't find the JKS file when I run: mvn install or
mvn test for builds. How can the JKS location be passed using a relative
path location so it works building using mvn and across environments?

Thanks!

<bean

class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property
            name="targetObject">
            <bean

class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
                <property name="targetClass" value="java.lang.System" />
                <property name="targetMethod" value="getProperties" />
            </bean>
        </property>
        <property
            name="targetMethod"
            value="putAll" />
        <property
            name="arguments">
            <util:properties>
                <prop
key="javax.net.ssl.keyStore">c:/project-root/integration/src/main/resources/sample.jks</prop>
                <prop key="javax.net.ssl.keyStorePassword">sample</prop>
            </util:properties>
        </property>
</bean>