Packaging & Publishing
Build, package, and publish your BoxLang module to ForgeBox
Build your module for distribution and publish it to ForgeBox so others can install it via CommandBox.
Build Output
Run the Gradle build:
./gradlew buildOutput is in build/module/:
build/module/
├── box.json
├── changelog.md
├── readme.md
├── ModuleConfig.bx
├── libs/
│ └── my-module-all.jar # Shadow JAR with all dependencies
├── bifs/
│ └── *.bx # Any BoxLang BIFs
├── components/
│ └── *.bx # Any BoxLang components
└── modules/ # Optional: modules bundled inside this one
├── child-module/ # a full module folder
└── helper.jar # or a module shipped as a single JARThe shadow JAR bundles your Java code AND all dependencies into a single artifact.
No build step required. Your module IS the distributable:
my-module/
├── box.json
├── ModuleConfig.bx
├── bifs/ # BoxLang BIFs
├── components/ # BoxLang components
├── interceptors/ # BoxLang interceptors
├── libs/ # External JARs (libraries on your classpath)
├── modules/ # Optional: modules bundled inside this one
└── public/ # Web assetsSimply zip the directory for distribution.
Distribution Files
Ensure these files are present in your distribution:
box.json
Package metadata
✅
ModuleConfig.bx
Module descriptor
✅
readme.md
Module documentation
⚠️
changelog.md
Release notes
⚠️
libs/
JAR dependencies
If applicable
The ignore Pattern
Use box.json ignore to exclude development files from distribution:
Version Management
Use semantic versioning (MAJOR.MINOR.PATCH):
MAJOR — Breaking changes
MINOR — New features (backward compatible)
PATCH — Bug fixes (backward compatible)
For Gradle projects, set the version in gradle.properties:
For version placeholders during development, use @build.version@:
Publishing to ForgeBox
Module Metadata for ForgeBox
Ensure your box.json includes ForgeBox-specific fields:
Installation After Publishing
Once published, users can install your module:
Or declare it as a dependency in their box.json:
Next Steps
Testing — TestBox integration and CI/CD patterns
Troubleshooting — Common issues and solutions
Last updated
Was this helpful?
