usnistgov / swid-tools

https://pages.nist.gov/swid-tools/
Other
13 stars 10 forks source link

swidval fails to run (commit 33cffbb4) #11

Closed ajnelson-nist closed 2 years ago

ajnelson-nist commented 2 years ago

Describe the bug

Running swidval-0.6.2-SNAPSHOT.jar raises a class-not-found error immediately.

Who is the bug affecting?

All swidval jar-file runners.

What is affected by this bug?

swival.

When does this occur?

Runtime.

How do we replicate the issue?

Steps to reproduce the behavior:

  1. Clone repository, state 33cffbb4.
  2. cd to repository root.
  3. Build swidval-0.6.2-SNAPSHOT.jar by running mvn clean install.
  4. Run swidval/target/swidval-0.6.2-SNAPSHOT.jar with or without arguments.

Bash transcript of last step:

$ java -jar .../swid-tools/swidval/target/swidval-0.6.2-SNAPSHOT.jar -h
Error: Unable to initialize main class gov.nist.secauto.swid.swidval.Application
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException

Expected behavior (i.e. solution)

swidval should run.

Other Comments

I'm not sure if this is a classpath error. It would be helpful if a Bash runner could be generated as a build artifact, a swidval.sh akin to swidval/target/swidval-0.6.2-SNAPSHOT-swidval/swidval.bat.

david-waltermire commented 2 years ago

@ajnelson-nist Try the latest build. There should be a swidval script in the bin folder. I also fixed the classpath in the JAR manifest that was causing the above.

ajnelson-nist commented 2 years ago

This now runs and generates a report. However, there is a behavior that I think is a regression. I'll file another Issue.