Blog

Artifacts Make A Difference

Nathaniel Francis February 11, 2015

Spread the word

Nathaniel Francis

February 11, 2015

Spread the word


Share your thoughts

Let's keep that around

One of the neat "under the hood" features of CommandBox is artifacts. Artifacts are a copy of each package that gets downloaded with CommandBox. This is good for you and for the internet because once you have a package in your artifacts, you don't need to download it again. Artifacts are key to CommandBox efficiency.

We might need that again

The next time you download a package from ForgeBox, CommandBox reads the box.json file for that package's dependencies. Then, it checks to see if we already have a copy of those dependencies in the artifacts. If the dependency is in the artifacts, CommandBox just uses it. If not, then CommandBox calls to ForgeBox to get that dependency. That's efficiency.

Where are these Artifacts you speak of?

By default, CommandBox stores the artifacts in the <user home>/.CommandBox/artifacts/ folder. You can find them there.

Excess baggage

As time goes on, and you do more and more development with CommandBox, the artifacts may develop a bit of baggage. This would happen when packages and package dependencies get newer versions. Say ColdBox 4.3 has TestBox 2.5 as it's dependency, but our Artifacts have TestBox 1.7, 1.9, and 2.1 in them (just a hypothetical). Those old, outdated artifacts are just taking up space. You might wanna get rid of that excess baggage. The CLI command for that is:

artifacts clean

Or if you are running CommandBox from your OS's native shell:

box artifacts clean

There. Now you have a clean slate. Baggage gone. Unfortunately, now you'll have to rebuild your artifacts with your next CommandBox package downloads, which will take a little more time on your next few setups.

Being choosy

Cleaning out your whole artifacts collection may be a little excessive for some folk. We have other means.

Start by entering the following command:

artifacts list

Or if you are running CommandBox from your OS's native shell:

box artifacts list

This will list out the artifacts that you have stored in your local artifacts collection. Then, you can delete selected artifacts with the following command:

artifacts remove <package-name>

Or if you are running CommandBox from your OS's native shell:

box artifacts remove <package-name>

This command is rather flexible. <package-name> can be a single package (ex: testbox), or a comma-delimited-list of packages (ex: testbox, awesome-security-interceptor, something-else, etc.). You can even include specific versions of a package that you want removed (ex: testbox 1.2.0.0).

So, if removing ALL your artifacts is not your style, you can be choosy with what you want to keep in your artifacts.

It makes a difference

Back in CBDW2014 (ColdBox Developer's Week 2014), I bet that Brad Wood could setup a fresh ColdBox 4.0 site in under a minute. He beat my expectations. But to make it a fair contest, he chose to clear his artifacts before doing so (nice guy). Later, he ran the same test with those artifacts in place (expected Brad Wood curiosity). For a standard, vanilla ColdBox 4.0 setup it made around 20 seconds difference in setup time, not to mention the data advantage of not having to re-download those package dependencies. It makes a difference. It enhance performance and cuts down setup times.

You may never notice it, but the artifacts are one more way that CommandBox streamlines your CFML workflow.

Add Your Comment

Recent Entries

ColdBox 7.2.0 Released

ColdBox 7.2.0 Released

ColdBox, a widely used development platform for ColdFusion (CFML), has unveiled version 7.2. Packed with compelling new features, bug fixes, and enhancements, this release is designed to empower developers by boosting productivity, refining scheduled task capabilities, and enhancing the overall reliability and efficiency of application development. This article will delve into the key highlights of ColdBox 7.2 and elucidate how these advancements can positively impact developers in their daily coding endeavors.

Luis Majano
Luis Majano
November 20, 2023
Into the Box 2023 Series on CFCast

Into the Box 2023 Series on CFCast

Excitement is in the air as we unleash the highly anticipated ITB 2023 series exclusively for our valued CFCast subscribers – and the best part? It's FREE for CFCast members! Now is the perfect time if you haven't joined the CFCast community yet. Plus, we've got an incredible End-of-Year deal that's too good to miss

Maria Jose Herrera
Maria Jose Herrera
November 20, 2023
Ortus Deals are Finally Here!

Ortus Deals are Finally Here!

The much-anticipated Ortus End-of-the-Year Sale has arrived, and it's time to elevate your development experience! Whether you're a seasoned developer, a tech enthusiast, or someone on the lookout for top-notch projects, Ortus has something special in store for you. Brace yourself for incredible discounts across a wide array of products and services, including Ortus annual events, books, cutting-edge services, and more.

Maria Jose Herrera
Maria Jose Herrera
November 15, 2023