• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Possible to have list of systemProperties in an external file?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have just started with Maven today so am still getting up to speed. I have set up a selenium test in Eclipse, in my test I have baseUrl = System.getProperty("webdriver.base.url");

I then run the test via command line passing in the argument I want the base url to be

mvn clean test -Dwebdriver.base.url=http://www.google.com

My problem is that I am working on a test where I will need to pass in a lot of arguments and would prefer if I could read them from a properties file instead of having a massive command line argument.

Is this possible and can anyone point me to a tutorial so I can set this up?

I have read about the mojo properties maven plugin which I have added to my pom.xml but I haven't been able to get it working so far.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think what you are looking for is profiles, and using settings.xml to maintain multiple profiles. That's what I do to automatically switch from one test environment to another. These should get you started:
http://maven.apache.org/guides/introduction/introduction-to-profiles.html
http://maven.apache.org/settings.html
 
Ranch Hand
Posts: 440
Hibernate Eclipse IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maven profiles will be the best solution to your problem. You will just have to define all your arguments and properties once in the settings.xml file and then when issueing the mvn install command , just specify which profile you are calling.
 
reply
    Bookmark Topic Watch Topic
  • New Topic