Skip to content

Building Civilizer

suewonjp edited this page Mar 18, 2017 · 9 revisions

If you want to build Civilizer on your own, you need the following as a minimum:

  • JDK (Java Development Kit) 1.7 or above
  • JAVA_HOME environment variable which points to your JDK installation directory

βœ”οΈ Using Gradle

You don't need to install Gradle or anything. Just execute the following command:
(Assume you are at the root directory of the source package)

  • Windows Users:
    • gradlew.bat all
      • If this doesn't work, check out you've correctly set JAVA_HOME environment variable.
  • Other OS Users:
    • ./gradle all

If you just want to build Civilizer from the latest source code, this is the easiest and preferred way.

All other methods require Maven installed on your system. Basically, you don't need to bother with installing and using it unless you think of developing and contributing some code.

βœ”οΈ Using Maven

First, install Maven on you system.

You can execute commands as follows at the root directory of the source package:

  • To compile the binaries and perform unit tests:
    • mvn test
  • To build a .WAR file:
    • mvn clean package
      • Run mvn clean package -Dmaven.test.skip=true to skip unit tests.
      • The output WAR can be found as {root directory}/target/civilizer.{version-number...}.war file.
      • You can deploy and run the .WAR file on Servlet Containers such as:
  • To compile the binary and load the application onto a Jetty server on the fly:
    • mvn jetty:run

βœ”οΈ Using Eclipse IDE (Maven required)

Among all the variations of Eclipse IDEs, Spring Tool Suite is recommended.

  1. Install the latest Maven integration in Eclipse (m2e) plugin.
  2. Run mvn clean package command from the command line after installing Maven.
  3. Import the project into Eclipse.
    • Use import an existing project into workspace menu
    • ( Don't use import an existing maven project into workspace )

βœ”οΈ Using shell scripts provided (Maven required)

Shell scripts are provided to build all the binaries/resources and package them all at once: ( You rarely use these scripts... )

The shell scripts invoke Maven commands underneath, so you need to first install it on your system.

  • Windows Users:
    • Run tools/build/build-all.bat from the command line.
    • Alternatively,
      1. install Babun
        • It is a shell application running on top of Cygwin. (Strongly recommended)
      2. Run tools/build/build-all.sh from the command line window powered by Babun.
  • Other OS Users:
    • Run tools/build/build-all.sh from the command line.
Clone this wiki locally