Copy link to clipboard
Copied
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:
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Folks, regarding your discussion, it's worth drawing out for consideration something that is NOT drawn out in the article above--though it IS in the table above.
Note that there IS in fact a "scan" option for the cfpm tool, which will tell one what packages are needed for a given code base.
I'm not at all denying how it could be helpful ALSO for the docs to clarify what package is needed for what tags/functions/script, but it's not quite as urgently a need/bug, given the availability of that scan feature, which may suffice for most such needs. It just wasn't clear from your comments if you were aware, and then if it might suffice for your needs. If you were and it does not, again I understand.
Copy link to clipboard
Copied
I'm not at all denying how it could be helpful ALSO for the docs to clarify what package is needed for what tags/functions/script, but it's not quite as urgently a need/bug, given the availability of that scan feature, which may suffice for most such needs. It just wasn't clear from your comments if you were aware, and then if it might suffice for your needs. If you were and it does not, again I understand.
By @Charlie Arehart
I disagree. The documentation to clarify what package is needed for what tag, function or script is an urgent need. It is in fact a must. I would go as far as to argue that such documentation is even more indispensable than the scan tool.
Consider a new ColdFusion project. What's the point of a scan tool if you discover afterwards that the packages you had implemented were not optimal? As far as this subject is concerned, scanning already-existing software is shutting the stable door after the horse has bolted.
What @Hemi345 and I suggest is to look to the future. To look to the new ColdFusion projects to come. They will need product documentation. With ColdFusion 2021, Adobe is essentially selling packages. Those are the product.
The client has a use-case or project in mind. The documentation is the usage instruction informing the client - beforehand - which package he or she will need.
Afterall the greatest optimizations in any software project are achieved in the design phase. Before a single line of code is written.
Copy link to clipboard
Copied
We do disagree.
No one needs urgently to know what features require what packages before development begins. The package mgr feature (and the offer of the zip deployment have the core server without any packages, to which one adds them) are NOT the primary way people will install cf. It's an optimization POSSIBILITY. No one MUST use it.
To be clear, the normal cf installer installs ALL packages by default (and sure, they could be removed if someone wanted to winnow down the package implementation.)
Again, sure, over time it could become more valuable to able to know from the docs what features require what packages. (Then again, the package naming is pretty clear about what major features would go with what packages.) For now, the scan feature should suffice for most situations.
But at this point, we're down to our opinions on the matter. The primary point of my first reply was simply to point out the scan feature, in case anyone reading the post here didn't know it existed.
Copy link to clipboard
Copied
The What's new in CF 2021 page states:
"Note: The GUI installer for the 2021 release is only temporary. We shall have only zip installers soon."
Unless the zip installer behavior changes to include all packages by default, I believe it's important to know what tags utilize which packages.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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 🙂
Copy link to clipboard
Copied
I got nothin.
Dave Watts, Eidolon LLC
Copy link to clipboard
Copied
Actually, I do have something! It's a long shot, but who doesn't have permissions to that folder? I don't know enough about how cfpm works to guarantee it's running as an administrator. The first thing I'd try is explicitly running that command shell as admin, then running cfpm from within that.
Dave Watts, Eidolon LLC
Copy link to clipboard
Copied
FWIW- I replicated this issue on a Windows machine using a site I have running via IIS. Ran the cmd prompt as administrator. First I tried to run the scan using a codebase in c:\inetpub\ with IIS setting up a site on localhost via wsconfig - nothing. Then I tried copying codebase in to c:\coldfusion2021\cfusion\wwwroot\ and using the CFBuilder for VSCode interface to set up a CF server with the built-in CF+Tomcat Application server - also a deadend trying to run scan that way. If there's a way to get this to work on Windows, I'd sure love to find out all the specifics! Good Luck.
Copy link to clipboard
Copied
Well, I at least feel better that it's not just me! 🙂
Copy link to clipboard
Copied
Just trying to use this scan tool as it is recommended in the lockdown guide. Windows 2022 and CF2021 I am getting this error about CODEBASEPATH not found. Anyone have any success yet making this work?
Copy link to clipboard
Copied
The documentation is incorrect, or at least it is for CF2023 - there is no CFSERVERURL argument. So it should work with just D:\vtsl