Table of Contents
- About
- Setup Environment
- Compiling
- Create Jar for Fenix Scripts
- Create Manual SQL Updates
- Reading Artifacts From Internal Repo
#About
Fenix Webapp is the aggregator project for IST's Fenix Installation.
#Setup Environment
- Create a configuration file using
mvn bennu:generate-configuration
. This generatessrc/main/resources/configuration.properties
, which should be customized to best suit your needs. - Copy
src/main/resources/fenix-framework.properties.sample
tosrc/main/resources/fenix-framework.properties
. - Modify both files accordingly
export JAVA_OPTS="-server -Xms256m -Xmx1024m -XX:PermSize=384m"
export MAVEN_OPTS="$JAVA_OPTS"
#Compiling
There are three ways to compile the Fenix Webapp.
This is the approach best suited for development. Instead of packaging the Webapp, it is possible to run Tomcat directly in Maven.
To run the webapp, using tomcat7-maven-plugin
, add the following to your MAVEN_OPTS
environment property:
-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false
And then, run the webapp using:
mvn clean tomcat7:run
or
mvn tomcat7:run
To run the embedded Tomcat with the Debugger, add the followwing to your MAVEN_OPTS
environment property:
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
You can change the suspend=n
to suspend=y
if debugging the startup process is required.
This approach is well suited for development, as it does not create a War file.
mvn clean prepare-package war:exploded
This creates the exploded Webapp in target/fenix-webapp-1.0.0-SNAPSHOT
.
To run the Webapp in a standalone Tomcat installation, simply create a Symlink using:
ln -s $(pwd)/target/fenix-webapp-1.0.0-SNAPSHOT <tomcat>/webapps/fenix
This approach is the one used for production environments. Simply run:
mvn clean package
The generated War file is located in target/fenix-webapp-1.0.0-SNAPSHOT.war
To create the Jar required for Fenix Scripts (Which contains the necessary Base classes and configuration files), simply run:
mvn clean test -Pjar
This creates deploy/fenix-webapp-1.0.0-SNAPSHOT.jar
Schema updates are now automatically handled. However, if you find yourself in need of meddling with the schema update process, and need to know what the Framework is doing, you can run:
mvn clean test -PSQLUpdateGenerator
Which will create the file etc/database_operations/updates.sql
In order to use the -Pproduction
profile, it is necessary to have maven configured with username and password.
The two files involved in this setup are:
1. ~/.m2/settings.xml
2. ~/.m2/settings-security.xml
- Run the following command to create your own master password so that
~/.m2/settings.xml
does not contain plain text passwords
mvn --encrypt-master-password
This will generate something like this: {jSMOWnoPFgsHVpMvz5VrIt5kRbzGpI8u+9EF1iFQyJQ=}
- Save the output in the
~/.m2/settings-security.xml
file
<settingsSecurity>
<master>{jSMOWnoPFgsHVpMvz5VrIt5kRbzGpI8u+9EF1iFQyJQ=}</master>
</settingsSecurity>
- Run the following command input the password of the user you have for the
dsi-maven-artifacts
repo.
mvn --encrypt-password
This will generate something like this: {COQLCE6DU6GtcS5P=}
- Add the following section in the
~/.m2/settings.xml
file
<settings>
<servers>
<server>
<id>dsi-maven-artifacts</id>
<username>foo</username>
<password>{COQLCE6DU6GtcS5P=}</password>
</server>
</servers>
</settings>