Skip to content

corgibytes/freshli-agent-java

Repository files navigation

Freshli Agent: Java

This application is used by the freshli CLI to detect and process manifest files from the Java ecosystem.

Building

With Docker

Make sure you have a recent version of Docker installed, and then run the following.

docker build -t freshli-agent-java . 

Without Docker

Using bin/build.rb

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 via winget install RubyInstallerTeam.RubyWithDevKit.3.0. Please create an issue if you see errors when running the build or the tests using the scripts in the bin directory or when running bundle exec cucumber.

On macOS or Linux:

bin/build.rb

On Windows:

ruby .\bin\build.rb

Using Gradle

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.

Running

With Docker

Assuming the Docker container has been built following the instructions above, the following command will run the application

docker run freshli-agent-java --help

Without Docker

Running with Gradle

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"

Running from Distribution Directory

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

Running Tests

Dependencies

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.

Using bin/test.rb

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

Running Directly

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

About

Freshli Java Agent - used to detect and process dependency manifest files from the Java ecosystem

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published