-
Notifications
You must be signed in to change notification settings - Fork 2
Running
Adriana Cristina Draghici edited this page Sep 2, 2013
·
1 revision
In its current state, the application needs the following properties to be set when running it:
- the user's name
- the user's device name
- the path of the folder used by Teamshare
On Linux, the run.sh script starts the application (implicitly compiling the code).
./run.sh username device-name teamshare-folder
The script uses Maven's plugin exec:java to run the application, like in the example below:
mvn exec:java -Dexec.mainClass="com.oss.teamshare.Main" \
-Dteamshare.user="user_name" \
-Dteamshare.device="device_name" \
-Duser.folder="teamshare_folder_path"`
Some exec:java arguments:
-
-Dexec.mainClass- for setting the Main class -
-Dproperty_name- for setting properties that can, for example, be read in the code using System.getProperty. -
-Dargs = "arg1 arg2 ..."- the list of arguments for the application.
In order to use exec.java, this plugin must be added to the pom.xml file:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
</plugin>
The main class, arguments and properties can be set directly in the pom.xml file, such as:
<mainClass>com.oss.teamshare.Main</mainClass>
<arguments>
<argument>username</argument>
....
</arguments>
<systemProperties>
<systemProperty>
<key>teamshare.user</key>
<value>username</value>
</systemProperty> </systemProperties>