Forum Discussion

venkataramann's avatar
venkataramann
New Contributor
11 years ago

[Resolved]Update Project Properties from Maven-soapui-plugin

Hi,

I am using soapUI 5.0.0 , and I am using groovy scripting for getting the data to load the properties from an external file. In my code I have as below

File testdata = new File(projectPath+"//POCTEST.txt") and on Printing the project path it pints as D:\SOAPSAMPLE which is correct and runs the script.

When I ran the code from the command prompt and that also got working, but trying to run that from Maven due to some reason it is looking for the file in D:\ and not D:\SOAPSAMPLE ( Note: D:\SoapSample is the Path where the POM was kept )

I am getting the ProjectPath using the below Code

def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def projectPath = groovyUtils.projectPath

Since this was not working for me from Maven, I created a Project Property called as ProjectDir from Soapui and tried to populate the value for this parameter from maven POM. I am using the Maven-soapui-Plugin for this Purpose.

In the Configuration section of the Plugin, I gave a below, but this value is not getting passed to the Project Properties.
<projectProperties>
<projectProperty>ProjectDir=${project.basedir}/src/test/resources</projectProperty>
</projectProperties>

Can somebody please guide me if I am doing something wrong here?

Thanks and Regards
-Venkat
  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    about your project properties, it is supposed to work
    can you setup a soapui project with only a groovy test step where you log the value of the project property and share it along with a example of a pom.xml to let me try to reproduce your issue please?
  • Hi @redfish4ktc2,

    Thanks for the response, I was updating a different POM File and was executing from the wrong folder. The POM is working now.

    My aplogies for the incorrect question.

    Thanks and Regards
    -Venkat