Build

KFS uses Maven for packaging and unit testing.

Properties

Configuration 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. 

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 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

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. 

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.

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.

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:


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:


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. 

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.

 

 

Kuali documentation is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. 

Kuali software is licensed for use pursuant to the Affero General Public License, version 3.

 Copyright © 2014 Kuali, Inc. All rights reserved. 

Portions of Kuali are copyrighted by other parties as described in the Acknowledgments screen. 

Kuali ® is a registered trademark of the Trustees of Indiana University.