This application is used by the freshli
CLI to detect and process manifest files from the Java ecosystem.
Make sure you have a recent version of Docker installed, and then run the following.
docker build -t freshli-agent-java .
Assuming you have a recent version of Ruby installed, and you're able to install RubyGems with being logged in as root, then you can use the bin/build.rb
script to build the application.
⚠️ Note for Windows Users Ruby version 3.1 might not work, because of compatibility issues with one of the libraries that is used by the Cucumber/Aruba testing tool. All Ruby 3.0 versions are suspected to work. Testing has been done with the version of ruby that can be installed viawinget install RubyInstallerTeam.RubyWithDevKit.3.0
. Please create an issue if you see errors when running the build or the tests using the scripts in thebin
directory or when runningbundle exec cucumber
.
On macOS or Linux:
bin/build.rb
On Windows:
ruby .\bin\build.rb
Make sure you have JDK version 17 or later installed and have your JAVA_HOME
environment varibale set appropriately.
Run the following command to create a complete deployable distribution for the project.
On macOS or Linux:
./gradlew installDist
On Windows:
.\gradlew.bat installDist
This will create build/install/freshli-agent-java
. Within that folder, the bin
directory contains wrappers for running the application. Adding the full path to that bin
directory to the PATH
environment variable will enable you to run freshli-agent-java
from any directory.
Assuming the Docker container has been built following the instructions above, the following command will run the application
docker run freshli-agent-java --help
It's possible to instruct Gradle to run the command for you.
On macOS and Linux:
./gradle run --args="--help"
On Windows:
`.\gradlew.bat run --args="--help"
You can run the program from the distribution that's created by the installDist
Gradle task.
On macOS and Linux:
./build/install/freshli-agent-java/bin/freshli-agent-java.bat --help
On Windows:
.\build\install\freshli-agent-java\bin\freshli-agent-java --help
The cyclonedx
CLI command needs to be in your PATH
for the tests to pass. You'll need to download the version of the command that matches your platform, and rename it to cyclonedx
before placing its directory in the PATH
environment variable.
You can run both the application's unit and integration tests that are written in Kotlin and the application's acceptance tests that are written using Cucumber and Aruba by running:
On macOS and Linux:
bin/test.rb
On Windows:
ruby .\bin\test.rb
The application's unit tests can be run with:
On macOS and Linux:
./gradlew test
On Windows:
.\gradlew.bat test
And the application's acceptance tests can be run with:
bundle exec cucumber