Before running the sample applications you should familiarize yourself with the Installation of jAgE Platform
All the sample applications are in the svn repository at the address: https://caribou.iisg.agh.edu.pl/svn/age/jage/trunk/examples/ (or anonymous access: http://caribou.iisg.agh.edu.pl/pub/svn/age/jage/trunk/examples).
You have to download the whole examples
directory.
Run examples from Eclipse
- First of all, you have to import projects to Eclipse. To achieve this goal, it is required to generate files
.project
and.classpath
by executing the following command in the main directory (examples
):Connection to the Internet is neededmvn eclipse:eclipse
- Now you have to import the projects to Eclipse (File -> Import -> Existing project into Workspace) - it is necessary to import both the generated projects (solutions and applications).
- To run the sample applications you have to move to the directory
src/main/config
in the project applications - there are run configurations for all of the examples. To run any of them, right-click on one of the configurations and choose Run As and the configurations's name.
Run examples from command line (using Maven)
- Firstly, it is necessary to compile the source files by executing the following command in the main directory (
examples
):Connection to the Internet is needed, to download all required dependencies.mvn compile
- Then you have to navigate to the directory
examples/applications-examples
. - You can run examples using the following Maven command:
Configuration files for examples can be found in the directory
mvn exec:java -Dage.node.conf=uri_of_config_file
examples/applications-examples/src/main/resources/examples/
.
For example:Or, if you prefer loading files from the classpath:mvn exec:java -Dage.node.conf=file:src/main/resources/examples/helloworld/age.xml
mvn exec:java -Dage.node.conf=classpath:examples/helloworld/age.xml
You can also run your own AgE applications using the same Maven command:
mvn exec:java -Dage.node.conf=uri_of_configuration_file
This method can be used also to run your own application. You only need to assure if the following configuration is in your project's pom file (or the parent ones):
<build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.2</version> <configuration> <mainClass>org.jage.platform.node.NodeBootstrapper</mainClass> <arguments> <argument>-starter</argument> <argument>org.jage.platform.starter.batch.single.BatchModeSingleStarter</argument> <argument>-Dage.node.conf=${age.node.conf}</argument> </arguments> </configuration> </plugin> </plugins> </build>