Building Marketcetera Platform
TracNav menu
-
Marketcetera
-
Overview
- Photon
- ORS
- Tradebase
- OrderLoader
- Virtual Appliance
- User Mailing List
- Download
- License
- Reporting Bugs
-
Documentation
- Marketcetera Platform Configuration
- ORS Guide
- Photon Installation and Configuration
- Photon Guide
- Photon Scripting
- Tradebase Guide
- OrderLoader Guide
- Configuration Files Guide
- Configuring Market Data Feeds
- Order Limits
- Excel Integration
- .NET Support
-
Support
- Support
- User FAQ
- Developer FAQ
-
For Developers
- Architecture
- Building Marketcetera Platform
- Building Photon
- Building Tradebase
- Building Appliance
- Building MarketceteraCOM
- FIX Overview
- Developer Mailing List
- Developer Notes
- Contribute!
- Reading List
- Third-party Dependencies
- Exchange Simulator
- JavaDoc
- Blog
In order to build Marketcetera Photon from the source you must have the following software installed:
- Java JDK version 1.6 (Java 6) or greater
- Maven version 2.0.9 or greater
- If you have multiple Java installs, you may need to setup JAVA_HOME and JDK_HOME variables to point to Java 1.6
- Verify that Maven picks up the right version of Java with mvn -v call:
$ mvn -v Maven version: 2.0.9 Java version: 1.6.0_03-p3
- Ant version 1.7.0 or great
- Make sure to add mvn and ant binaries to your PATH
- MySQL or any other database
- Rails and Ruby on Rails if you choose to populate the tables through Tradebase migration scripts
- mysql or other command-line utility if you choose the manual db setup
- Subversion - You can use TortoiseSVN client on Windows
The build has been tested on Linux, Windows (with Cygwin) and MacOSX. Make sure that your path is set up such that you can run mvn from the command line since that program drives the build.
In order to run the JUnit integration tests from the command line, you may need to add the junit.jar file to your CLASSPATH.
Check out the source
Change to the directory into which you would like to checkout the source. Then use Subversion to get the source from the public Marketcetera repository:
$ svn co http://code.marketcetera.org/root/tags/0.5.0 marketcetera-platform $ cd marketcetera-platform $ cp profiles.xml.sample profiles.xml
Note that this pulls the code from the 0.5.0 release tag. You are welcome to build from root, but note that the code may be in flux and the build instructions may lag the source code.
Setup the Database
The ORS uses a database for generating unique IDs. The appliance and Windows installer ship with MySQL to perform these functions.
By default, the ORS expects to connect to a database called marketcetera on localhost with the username marketcetera and password marketcetera. The JDBC connection values are specified in ors.xml configuration file as JdbcUser, JdbcPassword, JdbcURL, JdbcDriver.
Tradebase Migration Setup
The preferred method to setup the database is to run the migration script in Tradebase.
Manual Database Setup (Optional)
If you prefer not to run the migration script, please see the manual database setup instructions.
Set up the build
Once you have installed Maven and Ant and downloaded the source code all you need to do is run the following command from inside the markecetera-platform directory into which you checked out the code:
$ mvn -f uberPom.xml install $ mvn install
The first time you run Maven it downloads a lot of internal plugins which may take a while. However, this command should compile, test and install all the Marketcetera Platform modules into your local Maven repository.
Note: Sometimes Maven quits in the middle of downloading its plugins the first time you run it. So we use this handy script the first time we compile for a particular user:
$ while true; do mvn install; done
This will run the compilation in a loop until all the maven plugins are downloaded. Just keep an eye on the terminal to stop the compilation once it succeeds.
Project Setup
Marketcetera Platform POM contains multiple modules and follows the standard Maven directory structure:
- Platform POM
- core - shared code
- ors - Order Routing System code
- orderloader - the OrderLoader code
- photon - the Photon GUI code - it's an Eclipse RCP application and is built with Eclipse and not Maven
- tradebase - the Tradebase web application - it's a Ruby on Rails application and is built with rake and not Maven
- util - collection of utility code
- util-test - collection of testing utilities
We follow the Maven directory layout guidelines, so the code is in <module>/src/main/java directories, and the tests are in <module>/src/test/java directories.
All the configuration files are in their corresponding <module>/src/main/resources directories.
Running modules from code
It is possible to run the OMS from code from command line using the exec:java Maven goal under the execute profile:
marketcetera-platform/source/ors$ mvn -Pexecute exec:java
This runs the ORS with the configuration specified in the exec-maven-plugin in the ors/pom.xml file. If necessary, either the POM can be modified, or override variables can be specified in the command line when running the exec:java goal.
If you want to use jconsole in order to examing the ORS via JMX, make sure your MAVEN_OPTS variable has the following setting:
export MAVEN_OPTS="-Xmx512m -Xms128m -XX:MaxPermSize=512m -Dcom.sun.management.jmxremote"
