Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

KFS uses Ant Maven for deployments packaging and unit testing.

Anchor

...

props

...

props

...

Properties

...

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:

  1. ${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
  2. ${institution.build.properties.file} (location set in the above kfs-build.properties)
  3. ${build.environment}-build.properties
  4. The build/propertiesdirectory 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:

  1. Copy the appropriate skel-config.properties file from kfs/src/main/config to a location external to the project (such as your home directory)
  2. Set any values you need to override and comment out or remove the other properties. 
  3. 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...

  1. Create a second build properties file in the root of the project (e.g. sampleu-build.properties).
  2. Ensure that your new properties file will be loaded by adding the following to your ${user.home}/kfs-build.properties file.

    Code Block
    titleexample 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 

Anchor
maven
maven
Maven Command Overview

...

build/rice-lib
build/kfs-lib

...

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

Image Removed

Image Removed

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:

FileDestinationNotes
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

mvn test command.  See the setup instructions and Maven Introduction to the Build Lifecycle documentation for more information.


DescriptionMaven Command
Remove all build outputclean
Run all unit tests and format resultstest
Create artifacts and install them in ~/.m2/repositoryinstall
Builds the KFS war filepackage

Anchor
skip_help
skip_help
Skip Help

For iterative development, you may add -Dhelp.skip=true to the build command line. This skips the unpacking and deployment of the help files, significantly reducing the build time. 

Anchor
install_node
install_node
Installing Node

You will want to install both NodeJS and the yarn package manager before building the front end. You can install node by going to the node web page, https://nodejs.org/, and downloading the appropriate installer for your operating system.  On Mac OS X, you can install the Homebrew package manager and install NodeJS and yarn via that. On Linux, NodeJS is usually available via your operating system package manager.

Anchor
install_yarn
install_yarn
Installing Yarn

Yarn is the node package manager that is used within KFS. You can get an installer from its website https://yarnpkg.com/ or use Homebrew on OS X.

Anchor
webpack
webpack
Webpack

Before running Financials, Webpack needs to run to create a file named bundle.js that has all of the React components in it.  When built, this file is located at kfs-web/src/main/webapp/build/bundle.js.  If this isn’t done, the user interface will not render properly.  The maven pom for the kfs-web module of Financials has a step that will download NodeJS, yarn and Webpack and build the bundle.js for you.  To do this, run the following maven command:


Code Block
mvn frontend:yarn@yarn-build -pl kfs-web


If you install NodeJS, yarn and Webpack outside of Financials, you can run a Webpack in a mode called “watch”.  This will look for changes to the script files and create the bundle if the files change.  This feature is not available when running maven. Once node and yarn is installed, you can use yarn to install webpack.  To do this, follow these steps:


Code Block
npm login --registry https://npm.kuali.co
cd kfs-web/src/main/webapp
yarn install


This command reads the package.json file in this directory and installs the modules specified into the node_modules folder. 

Warning

The node_modules directory does not get removed during a mvn clean. If there have been significant changes to the node dependencies or versions then this can lead to unexpected errors. You can either manually delete the node_modules directory or run 'git clean -df'. After clearing the node_modules directory you will need to run yarn install again to re-download the node dependencies. (running yarn install after deleting node_modules is more time consuming since it has to re-download all of the dependencies instead of just the changed ones)


After the webpack module is installed, you can run one of the following commands from inside the webapp directory:


  • yarn watch - This command will build the bundle.js file then monitor the filesystem for changes to the script files.  It will rebuild the bundle.js file if any scripts change.

  • yarn build - This command will build the bundle.js file then exit.  It performs the same work that the maven command performs.

Include Page
Include Footer
Include Footer