Skip to content

Commit

Permalink
Maven plugin downloads, formatting of code blocks
Browse files Browse the repository at this point in the history
This commit adds more information on quickly and
effectively using Maven. Also, I added ` ```sh`
fences to code blocks for shell commands. I also
added example of adding to shell configuration
files.
  • Loading branch information
aj-stein-gsa committed Sep 5, 2024
1 parent 5167904 commit 7e79016
Showing 1 changed file with 32 additions and 10 deletions.
42 changes: 32 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,54 @@ This project is in the worldwide [public domain](LICENSE.md) and as stated in [C
### Installing pre-built Java package

1. Make a directory to install oscal-cli and cd into it. The example below uses the directory `/opt/oscal-cli`. Use your preferred directory.

```sh
mkdir -p /opt/oscal-cli
```
mkdir -p /opt/oscal-cli && cd /opt/oscal-cli
```
NOTE:

2. Download the zipped oscal-cli Java package. Download your preferred version, but we recommend [the latest stable release on the Maven Central repository](https://central.sonatype.com/artifact/dev.metaschema.oscal/oscal-cli/).
2. Download the zipped oscal-cli Java package to the install directory. Download your preferred version, but we recommend [the latest stable release on the Maven Central repository](https://central.sonatype.com/artifact/dev.metaschema.oscal/oscal-cli/). You can use [the Maven tool](https://maven.apache.org/) instead of in place of additional command line tools (i.e. `curl`; `wget`; etc.) or browser to craft URLs for a specific version.

3. Extract oscal-cli into the directory.
```sh
mvn \
org.apache.maven.plugins:maven-dependency-plugin:LATEST:copy \
-DoutputDirectory=/opt/oscal-cli \
-DremoteRepositories=https://repo1.maven.org/maven2 \
-Dartifact=dev.metaschema.oscal:oscal-cli-enhanced:LATEST:zip:oscal-cli
```
unzip cli-core-1.0.1-oscal-cli.zip

3. Move, extract oscal-cli, and delete the zipped package from the install directory.

```sh
cd /opt/oscal-cli
unzip *.zip
rm *.zip
```

4. (Recommended) Add oscal-cli's directory to your path.
```

```sh
# temporarily add oscal-cli to your terminal's instance path
PATH=$PATH:/opt/oscal-cli/bin

# add oscal-cli to your environment (e.g., all terminals)
export PATH=$PATH:/opt/oscal-cli/bin
```
NOTE: You can also add oscal-cli's directory to your path in shell profile to make oscal-cli permanently available.

## Running
5. You can optionally add oscal-cli's directory to your path in shell profile (i.e. [`$HOME/.bashrc`](https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html); [`$HOME/.zshrc`](https://zsh.sourceforge.io/Guide/zshguide02.html); etc.) to make oscal-cli permanently available.

Run help to make sure everything work
```sh
# You do not need to use both, pick one.
# Use the command below for bash shells.
echo 'export PATH=$PATH:/opt/oscal-cli/bin' >> ~/.bashrc
# Use this command for zsh shells.
echo 'export PATH=$PATH:/opt/oscal-cli/bin' >> ~/.zshrc
```

## Running

Run help to make sure everything works.

```sh
# if oscal-cli directory added to your path
oscal-cli --help

Expand Down

0 comments on commit 7e79016

Please sign in to comment.