Modularization reduces the complexity of a system. More formally, we can define modularization as dividing any system into independent functional units to allow replacement and/or removal of these units.
ColdFusion in all its versions installed all components, such as, datasource, language, pdf, Solr, etc., by default. You did not have an option to pick and choose the component or package that you’d want, or to remove the package. This meant that a lot of packages were left unused if they are not related to your application(s), leading to unnecessary consumption of system resources.
In Adobe ColdFusion (2021 release), you can install ColdFusion features as packages for a specific purpose. For example, you want to execute oracle database operations, you can install the oracle package. You can also uninstall the package if it is not required in future. This means that you have a lightweight base version of ColdFusion and depending on your use, you can add or remove the packages. You need not restart ColdFusion for the changes to take effect.
- The size of the installer now stands at 146 MB for core ColdFusion services, which also includes JRE. The size will decrease further in future releases.
- The size on disk is now reduced by ~300% and the runtime memory (for core packages) is now reduced by ~350%. The disk size may increase once you install the other packages.
- The startup time has decreased by ~400%.
In the ColdFusion Administrator, click Package Manager, and you can see the options to manage the packages.
The Packages page contains the following sections.
Check for updates to the core packages. Click the button Check for Updates and see a list of available updates.
The Installed Packages section lists all packages that are already installed. Select a package and uninstall the package. You can also uninstall all the installed packages and check if any packge needs an update.
The Available Packages section lists packages that are not yet installed. Click Install All to install the packages simultaneously.
The Settings page contains the following options to specify update preferences such as update notifications or if to automatically check for updates.
If you have set up a local update site, you can also specify URL of that site to get updates.
Click Auto-Check to see if any package updates are available for installation. You will receive a notification when a new update is available for download.
Provides options to specify update preferences such as update notifications or automatically check for updates.
If you have set up a local update site, specify the URL of that site to get updates.
If you have set up a local site for packages, specify the URL to receive the updates.
If you host the packages on a server that is behind a proxy server, then provide these details:
- Proxy host
- Proxy port
- Proxy username
- Proxy password
Using the ColdFusion Package Manager (cfpm), you can install, uninstall, list all the packages that are currently installed and get the list of available ColdFusion packages, and much more.
Navigate to CFHOME/cfusion/bin and enter cfpm.bat
You are now in the cfpm prompt.
Installs a new package. If VERSION is not specified, then the latest version of the package will be installed. You can also specify comma-separated packages to install multiple packages.
Installs all the packages available in the repo.
|update ALL||Updates the server hotfix and all the installed packages to the latest version.|
Updates all installed packages to the latest versions.
Uninstalls all packages that were installed.
Uninstalls a package from the system. You can specify comma-separated packages to uninstall the packages.
Lists all installed packages.
Lists all available packages in the repo.
Prints the package-related information on the console.
Prints the usage of all commands on the console.
scan CODEBASEPATH CFSERVERURL
Scans code at the given PATH and finds all packages to be installed.
scanandinstall CODEBASEPATH CFSERVERURL
Scans code at the given PATH and installs all required packages.
Clones the repository of the packages to the specified path.
q or quit
Exits the cfpm console.
cls or clear
Clears the cfpm console.
Purges the Felix cache. Felix stores all installed bundles into a bundle cache directory. By default, Felix creates a cache directory, called felix-cache, in your current working directory. For more information, see Apache Felix framework.
Run this command to clear the bundle cache. You must stop ColdFusion server, run purgecache, and then restart ColdFusion.
|export EXPORT_FILEPATH||Exports all the installed packages to a file.|
|import IMPORT_FILEPATH||Imports all the specified packages in the file into the server.|
To see the information about a package, enter the following command:
For example, if you view the information about the package pdf and its dependencies, enter
If a package is not installed, the information about it will be colored yellow. In this example, cfmongodb isn't installed, so the information shows up in yellow color.
In the prompt, to see the list of all packages that are installed, enter list.
You can see the list of packages, as shown below:
To install a package, enter the name of the package after install, for example,
For example, to install Azure Blob, enter the command below:
You can also specify a comma-separated list of packages after install, for example,
If the package being installed has any other dependent packages, it automatically installs them as well.
You can also specify the version of the package while installing the package.
To uninstall a package, enter the name of the package after uninstall, for example,
Uninstalling a package does not uninstall its dependent packages. You must uninstall the dependent packages manually.
You can uninstall packages in their order of dependent packages.
For example, to uninstall Azure Blob, enter the command below:
ColdFusion is modularized and only contains the core by default. It can be pretty difficult task to identify the list of packages that must be installed in order to run the application successfully.
The code scanner comes to the rescue and automatically scans through the specified code base and returns the list of required packages to be installed.
Enter the following command:
scan <path_to_your_code_base> http://[CF_SERVER_HOST]:port
In addition, you can scan the code base and install the recommended packages in one go as well. Enter the following command:
scanandinstall <path_to_your_code_base> http://[CF_SERVER_HOST]:port
For example, scanandinstall <code_base/wwwroot/cfm> http://localhost:8500.
It may happen that you may be behind a firewall or do not have an active internet connection, which results in packages not getting installed.
In this release, we’ve introduced the command downloadrepo, using which you can download the complete repo (all packages) to a specified location and host it on any web server locally.
Enter the command:
For example, downloadrepo C:\packagerepo.
Once the repository is downloaded and hosted on the web server. It can be used by ColdFusion server to act as the online repository. You can switch the repository location using the ColdFusion administrator.
Steps to use the local repository:
- Download the repository and host it on a web server as mentioned above.
- Log in to ColdFusion administrator.
- Navigate to Package Manager > Settings
- Update the Package Site to http://<LOCAL_WEB_SERVER>/packagerepo/bundlesdependency.json
- Submit changes
- Restart ColdFusion server.
Export the current state of a server. It can be imported to another instance of another ColdFusion instance or server.
The contents of the file are shown below:
# #Thu Sep 17 13:41:19 GMT+05:30 2020 server_hotfix_updatelevel=0 packages=awssqs\:2021.0.0.322293,awssns\:2021.0.0.322293,azureservicebus\:2021.0.0.322293,awsdynamodb\:2021.0.0.322293,pdf\:2021.0.0.322293,felixclassloader\:2021.0.0.322293,report\:2021.0.0.322293,awss3\:2021.0.0.322293,document\:2021.0.0.322293,image\:2021.0.0.322293,chart\:2021.0.0.322293,spreadsheet\:2021.0.0.322293,presentation\:2021.0.0.322293,adminapi\:2021.0.0.322293,administrator\:2021.0.0.322293
Import the state of server from a file to install all packages that are mentioned in the file being imported.
In this section, we shall discuss a few package update workflows where you will upgrade or downgrade core verion or packages. Here are some instances when you'll update or downgrade a package.
- You have installed ColdFusion core package and want to update or downgrade the package.
- You have installed ColdFusion core package and a second package, for example, chart. Now a new version is available for chart, which is compatible with the already installed core package. Your intent is to update the chart package.
- You have installed ColdFusion core package and a second package, for example, chart. Now a new version is available for chart, which is not compatible with the already installed core package.
Your intent is to update the core package along with the chart package.
- You want to downgrade the chart package to the previous version, which means that you must first downgrade the core package.
- You've intalled the ColdFusion core package and 10 different packages. If there are updates available for five packages, of which three packages are compatible with the installed core package, then you must update the core package along with all the five packages.
- You've installed the ColdFusion core package and 10 different packages. If there is a package that is not compatible with the core package, then you must update the package to its latest version.
Note: When you install ColdFusion using the GUI installer, the by default, all packages are installed, which are updated to the latest version of ColdFusion.
|Action||ColdFusion Package Manager||ColdFusion Administrator|
|Update a single package
||In the section Installed Packages, select a package, and in the Available Versions drop-down, choose the version that you want to update to.
|Update multiple packages||
|Update all packages||
For updating or downgrading the core server or packages, use the command,
install <package name>:<lower package version>
For example, you have installed the package chart v2021.0.0.323100, which depends on the latest core package. Now you want to downgrade the package to v2021.0.0.323099, which depends on the previous version of the core package.
Then, use the command- install chart:2021.0.0.323099
The command will
- Uninstall the core update.
- Uninstall the latest version of the chart package.
- Install the latest version of the chart package.
It is easier to automate the process of package installation or uninstallation using the CFPM non-interactive mode.
Open the command prompt, navigate to the coldFusion/cfusion/bin folder, and enter:
cfpm COMMAND ARGUMENTS
For example: C:\ColdFusion\cfusion\bin>cfpm install <package_name>