usnistgov / swid-tools

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

Build failure for current swid-repo-client #7

Closed ajnelson-nist closed 2 years ago

ajnelson-nist commented 3 years ago

Describe the bug

The build for swid-repo-client fails, seemingly because of a missing dependency.

Who is the bug affecting?

Builders of swid-repo-client.

What is affected by this bug?

swid-repo-client fails to build.

When does this occur?

Today.

How do we replicate the issue?

  1. Clone swid-tools repository.
  2. Change directory to the swid-repo-client source directory.
  3. Run command mvn clean install.

The installation process ends with this log snippet:

...
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.25/plexus-interpolation-1.25.jar (85 kB at 99 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.6/commons-codec-1.6.jar (233 kB at 125 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  03:00 min
[INFO] Finished at: 2021-01-28T16:08:47-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:3.2.0:single (make-assembly-bin) on project swid-repo-client: Execution make-assembly-bin of goal org.apache.maven.plugins:maven-assembly-plugin:3.2.0:single failed: Plugin org.apache.maven.plugins:maven-assembly-plugin:3.2.0 or one of its dependencies could not be resolved: Could not find artifact gov.nist.secauto.swid:swid-maven-plugin:jar:0.6.2-SNAPSHOT in apache.snapshots (https://repository.apache.org/snapshots) -> [Help 1]

Expected behavior (i.e. solution)

I expect the build to complete.

Other Comments

Issue encountered in up-to-date macOS, maven 3.6.3.

ajnelson-nist commented 3 years ago

Scope expansion: This same dependency issue also affects swidval.

ajnelson-nist commented 2 years ago

The issue is there is an erroneous version reference in swidval/pom.xml. 0.6.2-SNAPSHOT is referenced, but does not exist here:

https://repo1.maven.org/maven2/gov/nist/secauto/swid/swid-maven-plugin/

This branch (in PR 10) fixes the build issue for swidval and swid-repo-client, but I encountered an error using the built swidval jar to validate a SWID file. Shell transcript follows:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: gov/nist/secauto/decima/module/cli/commons/cli/OptionValidator
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
    at java.lang.Class.getMethod0(Class.java:3018)
    at java.lang.Class.getMethod(Class.java:1784)
    at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:650)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:632)
Caused by: java.lang.ClassNotFoundException: gov.nist.secauto.decima.module.cli.commons.cli.OptionValidator
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    ... 7 more

I'm not sure whether this is a build error or a classpath error. Nor am I sure whether the referenced swid-maven-plugin``0.6.2-SNAPSHOT version exists or not. @david-waltermire-nist , this issue needs your attention to resolve.