Table of Contents |
---|
KFS uses Ant Maven for deployments packaging and unit testing.
Anchor |
---|
...
|
...
|
...
Properties
Anchor |
---|
Configuration properties may be specified by certain files which are looked for automatically by the script. The first definition of a property will be used by the build, i.e. Ant does not work like many other things where the last value wins. There are three locations that that the build script attempts to load properties from, in the order specified:
${user.home}/kfs-build.properties
Info User Home Locations
- Unix:
/home/username/kfs-build.properties
- Mac OS X:
/Users/username/kfs-build.properties
- Windows XP:
C:/Documents and Settings/username/kfs-build.properties
- Windows Vista, Windows 7:
C:/Users/username/kfs-build.properties
- Unix:
- ${institution.build.properties.file} (location set in the above kfs-build.properties)
- ${build.environment}-build.properties
- The
build/properties
directory in the kfs project. You should not generally change the properties here. Override them in one of the above files.- build/properties/build.properties
- build/properties/build-foundation.properties
- build/properties/database.properties
- build/properties/directory.properties
- build/properties/logging.properties
- build/properties/batch.properties
- build/properties/email.properties
- build/properties/url.properties
- build/properties/rice.properties
- build/properties/spring.properties
- build/properties/web.properties
- build/properties/b2b.properties
have defaulted values which are included in the KFS war and may be overridden at runtime. There are skeleton config files located in kfs/src/main/config to aid in overriding the most common properties. To override:
- Copy the appropriate skel-config.properties file from kfs/src/main/config to a location external to the project (such as your home directory)
- Set any values you need to override and comment out or remove the other properties.
- Pass the location of your custom properties files to maven or tomcat on the command line via the following property:
-Dadditional.kfs.config.locations
property.
For ease of future upgrades, you should avoid modifying any of the delivered files under the kfs
directory. Instead, you can override any or all of those properties in the first two. For example...
- Create a second build properties file in the root of the project (e.g. sampleu-build.properties).
Ensure that your new properties file will be loaded by adding the following to your ${user.home}/kfs-build.properties file.
Code Block title example institution properties reference institution.build.properties.file=sampleu-build.properties
Build Target Overview
To deploy a KFS distribution, you can use the dist
or dist-local
targets of the KFS build.xml
Maven Command Overview
To create a deployable KFS war, you can use the mvn package
command. To execute the KFS unit tests, you can use the test-local
or continuous-integration
targets. The continuous-integration
target is intended for use within an automated testing tool like Jenkins. See the setup instructions and the help target in the build file itself for more information.
"dist" Targets Flow | Test Targets Flow |
---|---|
Directory & File Creation
KFS requires that certain external directories and files exist at runtime.
The settings and security directories must be created and populated
Info The goal of externalizing some of the application configuration is to allow for modification without a deployment. Also, the secure information contained in some of these files (e.g. database passwords) has different access requirements than code does.
- The logs and work (attachments, reports, staging) directories must be created
- Certain files must be added to the application server
The dist-local
target accounts for these external dependencies. It copies the files and folders in the build/external directory of the project to their expected locations. The expected locations are configurable via build properties. The configuration properties page lists the default values for the properties that control the expected locations.
The copies will only me made if the is.local.build
property is set. When not set, the build process assumes you are building a WAR file for an already configured server. So, you will want to review the dist-local
target for what gets copied. Review the table below for most of the files which are being copied.
Source | Destination | Notes |
---|---|---|
build/external/appserver/*.jar | ${appserver.lib.dir} |
|
${drivers.directory}/*.jar | ${appserver.lib.dir} |
|
build/log4j*.jar | ${appserver.lib.dir} | Only if the p6spy is enabled (i.e. the use.p6spy.local property is set) |
build/external/appserver/carol.properties | ${appserver.classes.dir} |
|
build/external/appserver/context.xml | ${appserver.localhost.dir} or META-INF directory in war |
|
build/external/work/* | ${external.work.directory} |
|
build/external/log4j.properties | ${settings.directory} |
|
build/external/security.properties | ${security.directory} |
|
build/external/rice.keystore | ${security.directory} | Note: you should never use this delivered file in a production environment. |
The dist-external
target will generate three files containing external dependencies that can be unpacked on a server:
File | Destination | Notes |
---|---|---|
settings.zip | ${settings.directory} | contains log4j.properties |
security.zip | ${security.directory} | contains rice.keystore and security.properties |
skel.zip | ${external.work.directory} | contains the base structure for the external dependencies/directory structure |
The dist-local
and dist
targets both generate / extract certain files that reside within the application itself, using the contents of the build/project directory.
...
Source
...
Destination
...
build/project/configuration.properties
...
work/src
...
build/project/spy.properties
...
work/src
...
build/project/OJB.properties
...
work/src
...
build/project/OJB-logging.properties
...
work/src
...
build/project/OJB-repository.xml
...
work/src
...
build/project/web.xml
...
work/web-root/WEB-INF
...
build/project/help.zip
...
work/web-root/static/help
...
build/project/xsd/*
...
work/web-root/static
...
build/external/appserver/rice-web-*.war (JSP/TAG portions)
...
work/web-root
...
build/external/appserver/rice-web-*.war (JAR files)
...
build/rice-lib
...
build/rice-lib
build/kfs-lib
...
mvn test
command. See the setup instructions and Maven Introduction to the Build Lifecycle documentation for more information.
Ant Target | Description | Maven Command |
clean | Remove all build output | clean |
clean-all | Delete all generated/extracted files within the project. | clean |
debug-dev | Starts up the included Tomcat server with KFS using Rice in bundled mode. | tomcat7:run (startup bundled app in tomcat instance) |
debug-dev2 | Starts up the included Tomcat server with KFS using Rice in embedded (Rice standalone) mode. | N/A |
dist | Builds the KFS war file for the current build.environment | package |
dist-local | Prepare local configuration files and tokenized resources and deploy tomcat context file on development workstation | N/A |
echo-properties | Print all build properties that have been set | N/A |
help | Describe public targets | N/A |
refresh-db | Refreshes the KFS and Rice database schema(s) for the current build environment | N/A |
refresh-kfs-db | Refreshes the KFS components of the database for the current build environment | N/A |
refresh-rice-db | Refreshes the Rice component of the database for the current build environment | N/A |
report | retrieve dependencies with ivy | N/A |
resolve | resolve dependencies with ivy | N/A |
run-dev | Starts up the included Tomcat server with KFS using Rice in bundled mode. | see debug-dev |
run-dev2 | Starts up the included Tomcat server with KFS using Rice in embedded (Rice standalone) mode. | NA |
run-liquibase-dir | Runs the directory of liquibase files pointed to by the 'dir.name' property into the main datasource. Files will be run in alphanumeric order. | N/A |
run-liquibase-file | Runs the liquibase file pointed to by the 'file.name' property into the main datasource. | N/A |
test-local | Run all unit tests and format results | test |
Include Page | ||||
---|---|---|---|---|
|