Skip to main content
Community Manager
December 22, 2020
Question

ColdFusion Package Manager (CFPM)- Install only what you need

  • December 22, 2020
  • 2 replies
  • 3320 views

In ColdFusion (2021 release), you can now install only the services your application needs and nothing more. Modularisation lets you continuously integrate small pieces of code and deliver applications quickly and seamlessly.

 

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.

 

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. 

 

In this blog, I shall write about installing ColdFusion packages via command line:

  • Interactively
  • Non-interactively

 

There is also a third way to instal packages, via the ColdFusion Administrator, which I shall discuss in a future blog.

 

Start CFPM from command line

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.

 

List of commands

Command

Description

install PACKAGENAME[:VERSION]

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.

install ALL

Installs all the packages available in the repo.

update ALL Updates the server hotfix and all the installed packages to the latest version.

update packages

Updates all installed packages to the latest versions.

uninstall ALL

Uninstalls all packages that were installed.

uninstall PACKAGENAME

Uninstalls a package from the system. You can specify comma-separated packages to uninstall the packages.

list

Lists all installed packages.

listall

Lists all available packages in the repo.

info PACKAGENAME

Prints the package-related information on the console.

help

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.

downloadrepo DOWNLOAD_PATH

Clones the repository of the packages to the specified path.

q or quit

Exits the cfpm console.

cls or clear

Clears the cfpm console.

purgecache

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.

 

For ore information, see Adobe help on ColdFusion Package Manager.

Install a package

Installing a package is easy. Simply enter the name of the package or packages (comma-separated) after install.

cfpm>install azureblob

cfpm>install awss3,awssqs,awssns

Uninstall a package

To uninstall a package, enter the name of the package after uninstall, for example,

cfpm>uninstall awss3

Uninstalling a package does not uninstall its dependent packages. You must uninstall the dependent packages manually.

 

Non-interactive mode

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>

 

Try out CFPM today and see how it greatly reduces all complexities. Give us our feedback and how we can improve CFPM in future iterations.

This topic has been closed for replies.

2 replies

Participating Frequently
July 26, 2023

I can't get the SCAN function to work.  It doesn't seem to recognize my CODEBASEPATH.  

That is the path to all my code for my website.  I really want to remove any unnecessary packages, but can't do that if I can't figure out which ones are being used.  Any suggestions on what I'm doing wrong?

Community Expert
July 26, 2023

This is a really dumb question on my part. I assume you're using Windows. I have NEVER used the cfpm command-line tool. Have you tried using Windows file path notation instead, like "d:\vtsl"? Maybe you need a slash at the end, like "d:\vtsl\"? What happens if you exit cfpm, can you navigate to d:\vtsl? OK, sorry, that's three dumb questions. But try them out and see what happens!

 

Dave Watts, Eidolon LLC

Dave Watts, Eidolon LLC
Participating Frequently
July 27, 2023

Never a dumb question... I tried every different iteration of path notation I could think of, including UNIX.  Thought maybe it was case sensitive, so I copy/pasted from the Windows directory.  Double quotes threw an error about character not allowed, Single quote didn't throw that error but still gave me CODEBASEPATH not found.  Ran as administrator, and verified that the Administrator I'm logged in as, as well as the Administrator group, had full permissions for the D:/vtsl folder.    I'm definitely at the wtf stage 🙂

 

Participating Frequently
April 8, 2021

If you could point me to some documentation that explains package dependencies for certain tags/functions and CF administrator sections, that would be great.  Some dependencies are obvious, but some not so much and I haven't found anything like this.  I believe there should be an additional heading "PACKAGE DEPENDENCY" added to the reference in addition to DESCRIPTION, CATEGORY, SYNTAX (e.g., https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-r-s/cfsearch.html ) that explains any package(s) that need to be installed for that tag to function.

BKBK
Community Expert
Community Expert
May 9, 2021

Good point, @Hemi345 .

"Install only what you need" assumes you know beforehand which package to install. However, even seasoned ColdFusion professionals may not know offhand which package is required for which tag or function. So, you're right.

 

The times, they are a-changin'. With the arrival of modularisation in ColdFusion 2021, some changes are mandatory. Universally in the ColdFusion space. For example, the documentation on each tag or function has to be revised to include the package(s) required.

 

You should submit a feature-request. Include in it a link to this discussion.