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

BoxLang 1.0.0 Beta 23 Launched

BoxLang 1.0.0 Beta 23 Launched

The latest release of BoxLang, Beta 23, marks a significant step forward in our journey to create the ultimate dynamic language for the JVM. Packed with powerful new features, important bug fixes, and thoughtful optimizations, this update is designed to make your development experience smoother, faster, and more reliable, especially after now starting to take 100s of comments and bug reports from our community.

Luis Majano
Luis Majano
November 23, 2024
TestBox Latest Updates and News!

TestBox Latest Updates and News!

We’re thrilled to have launched the new TestBox website and TestBox 6.0! If you haven’t had a chance to explore yet, visit TestBox to discover updated documentation, powerful resources, and features that make testing more efficient than ever.

Maria Jose Herrera
Maria Jose Herrera
November 21, 2024
Is Your ColdFusion Application Ready for the Future?

Is Your ColdFusion Application Ready for the Future?

In a rapidly evolving digital world, maintaining performance, security, and scalability for ColdFusion applications is more challenging than ever. Whether you're using Lucee or Adobe ColdFusion, legacy systems can become a bottleneck for growth, innovation, and user satisfaction. The need to future-proof your ColdFusion applications has never been more critical.

But where do you start?


The Hidden Costs of an Outdated ColdFusion Application

As you...

Cristobal Escobar
Cristobal Escobar
November 21, 2024