Forum Discussion

Lajos_Papp's avatar
Lajos_Papp
New Contributor
16 years ago

Re: relative reference to a project in the workspace xml

Hi right now my workspace.xml file lists the project file location with an absolute file path like:


 
  /Users/somepath/my-project.xml


is it possible to use relative path?
i tried ./something and file://./something but didn't work

thanks

8 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    soapUI 2.5 has a "WorkspaceDir" project at the bottom left (when selecting the Workspace node in the navigator), if you set its value to ${workspaceDir}, project paths should be saved related to path of workspace file..

    regards!

    /Ole
    eviware.com
  • Lajos_Papp's avatar
    Lajos_Papp
    New Contributor
    thanks a lot!
    actually the specific "workspace property" is called "projectRoot" and should be set as you suggested: ${workspaceDir}
  • Rene_Single's avatar
    Rene_Single
    Occasional Contributor
    My Problem is a bit beyond the one of the OP (as I did discover that setting on my own  )

    But what I need is relative paths in the project files themselves.

    When I manually change the following settings to relative paths

    .

    file:/../../PATHTOWADL

    and all other references to the WADL (although I'm not sure this is required)

    everything still works fine.

    On shutdown of SoapUI it then overwrites at least the . with an absolute path again, which is a bit of a nuisance.

    Is there an option that enforces relative paths within the project files for the above mentioned paths ?

    Background: Project files are required to work on different machines where the structure is identical but just the location is different.

    kind regards

    René
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    the "Resource Root" property on the Project level is for this; set it to ${projectDir} and all paths in the project (property files, wadl/wsdls, etc..) should be relative to the project file directory.

    regards!

    /Ole
    eviware.com
  • Rene_Single's avatar
    Rene_Single
    Occasional Contributor
    I have this actually set to $(projectDir), but still have some absolute references in the project file.

    ABSOLUTEPATH TO OLD LOCATION HERE



    file:/ABSOLUETPATHTOWSDLHERE

    That threw my off, but it seems it is working anyway.
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    these are "internal" and shouldn't pose any problems.. let me know otherwise!

    regards,

    /ole
    eviware.com
  • MC's avatar
    MC
    Contributor
    Will they be a problem if the project is put under source code control?
    If I use a "composite project" and I check in (say) settings.xml, won't my
    "internal" absolute pathnames conflict with others?

    Likewise, if I select certain filenames using a file dialog, all the pathnames are absolute.
    How can I get them to be relative.

    Finally, all the property browsers (project, endpoint, request, etc) present the file paths
    as absolute. How do I know if they've been specified as relative?
  • MC's avatar
    MC
    Contributor
    If configured correctly, the file dialog will create relative paths.

    If configured correctly, the variables like ${projectDir} will be preserved.

    Absolute pathnames are really absolute.

    I needed to save my project after making changes. That's why I got confused.