I currently use Eclipse as my Java IDE and I use Maven. I click the run button and it is able to run a Selenium Java test I wrote.
I then proceeded to install Maven
I didn't see this until after I had posted my own question...and subsequently found an answer to it! I've included my answer below:
Maven can be made to run the code it compiles by using the exec-maven-plugin and adding the following to the pom.xml:
org.codehaus.mojo
exec-maven-plugin
1.1.1
test
java
Selenium2Example
arg0
arg1
As you can probably gather from the snippet, arguments can be passed in by listing them in the pom.xml. Also, be sure to use the proper package name in the mainClass
element.
You can then run mvn compile
followed by mvn test
to compile and run your code.
Credit has to go to http://www.vineetmanohar.com/2009/11/3-ways-to-run-java-main-from-maven/ for listing several ways to do this.