RunningTheDemo

Martin Grigorov edited this page Feb 22, 2015 · 7 revisions

Running the Demo

Notes

Brix uses Apache Maven as the build tool. Apache Maven should be installed and properly configured for any source-related commands below. If for any reason unit tests are failing during the Maven build they can be skipped by appending -Dmaven.test.skip=true to the mvn command line

Running Brix

There are three main ways to run Brix:

  • Running the Maven Jetty plugin. This is the simplest option.
  • Running from within the IDE (e.g. Eclipse). This is the best option for those who are interested in learning the internals of Brix by stepping through the code.
  • Deploying the WAR file to a servlet container. For those that already have a running servlet container.

Maven Jetty Plugin

Checkout and build the code

git clone git://github.com/brix-cms/brix-cms.git brix
cd brix
git checkout master
mvn clean install
Run the Maven Embedded Jetty Container
cd brix-demo
mvn jetty:run

The url will be http://localhost:8080/index.html

Inside Eclipse

Setting up Eclipse for Maven

Before importing projects into Eclipse, you may need to add a classpath variable to point to your maven repository. Window->Preferences->Java->Build Path->Classpath Variables. Click New. For the name, enter M2_REPO For the value, enter your maven repository path, i.e. C:/Documents and Settings/joeuser/.m2/repository/

Setting up Brix in Eclipse

Checkout the code and generate the Eclipse project files.

git clone git://github.com/brix-cms/brix-cms.git brix
cd brix
mvn eclipse:eclipse -DdownloadSources=true

Import projects into Eclipse (File > Import... > Existing Projects into Workspace) Right click StartBrixDemo.java in brix-demo/src/test/java and select Run/Debug as a Java Application Eclipse will start a Jetty server. Brix will be available at http://localhost:8080

WAR Deployment

Download or build the WAR

  • Option 1: Download from the Downloads section of this site, or
  • Option 2: Checkout the code and build the war.
git clone git://github.com/brix-cms/brix-cms.git brix
cd brix
mvn clean package

The built WAR will be available in brix/brix-demo/target/brixdemo.war Deploy the WAR Follow instructions for the Servlet container of your choice (e.g., Apache Tomcat) on how to deploy the WAR file. The url for the demo will be http://localhost:8080/brixdemo

####Deploying in an Application Server Some application servers, like JBoss, do not like WAR files with packaged logging dependencies. If you get a logging-related error when deploying remove log4j and slf4j jars from WAR's WEB-INF directory. (WAR is just a ZIP file so you can use your favorite ZIP tool to nuke the jars)

###Configuring Demo By default, Brix Demo will create and initialize a new JCR repository in a temporary directory. This behavior can be changed by editing the brixdemo.jcr.url location inside brix/demo/application.properties file.

The url is of form file://<path>

  • Example of a Windows path: file://c:/tmp/brix
  • Example of a Linux/OSX path: file:///tmp/brix
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.