Installing Gazpachoquest from the source
To perform the next step you must have Git installed. (Check that you have a git command before proceeding.) If you do not have a working Git installation, follow the instructions on the Git downloads page.
git clone https://github.com/antoniomaria/gazpachoquest.git cd gazpachoquest
- Java JDK 8. or higher.
- Apache Maven 3.3.3 or higher.
Ensure JAVA_HOME environment variable is set and points to your JDK installation and M2_HOME environment variable is set and points to your Maven installation.
mvn -pl tomee-assembly -am install
After this step gazpachoquest-rest-web.war will be generated under directory:
` $HOME/git/gazpachoquest/rest/rest-web/target/gazpachoquest-rest-web.war
The UI will be generated under directory:
$HOME/git/gazpachoquest/questionnaires-ui/target/gazpachoquest-questionnaires-ui.war
`
WAR means Web Application Archive. A WAR file is a zipped Java web application containing all the resources such as jar files, Java classes, Java server pages (JSP), static resources and configuration data. The default war configuration starts a in memory HSQL database ready to be deployed in a Servlet Container or J2EE container.
War | Tomcat 8 | TomEE |
---|---|---|
gazpachoquest-rest-web.war | X | X |
gazpachoquest-questionnaires-ui.war | X |
You can deploy Gazpachoquest to multiple environments using a single Web application archive (WAR) file. The WAR file can contain several configurations, each customizing the application to a particular target environment. The appropriate configuration is applied automatically when the WAR file is extracted on a servlet container.
This approach has the advantage that you only need to compile the webapp once. It is not necessary to create separate WAR files for each target environment.
Configuration resolution is based on localhost name according to InetAddress.getLocalHost().getHostName()
Take a copy of the default configuration file on a subfolder named as hostname:
cp $HOME/git/gazpachoquest/rest/rest-web/src/main/webapp/WEB-INF/config
mkdir myhostname
cp default/config.properties myhostname
Configure the config.properties according to your preferred configuration:
# Supported engines: postgres / mysql /hsql
db.engine.name=hsql
# Supported options: standalone / container
dbpool.managedBy=standalone
# Default JNDI resource if dbpool is managed by container
# jndi.name=jdbc/gazpachoquest
http.schema=http
http.port=80
http.host.alias=localhost
# Uncomment to override settings
# jdbc.driver.class=org.postgresql.Driver
# jdbc.url=jdbc:postgresql://localhost:5432/gazpachoquest
# jdbc.username=postgres
# jdbc.password=admin
# jdbc.driver.class=com.mysql.jdbc.Driver
# jdbc.url=jdbc:mysql://localhost:3306/gazpachoquest
# jdbc.username=root
# jdbc.password=admin