structurizr / cli

A command line utility for Structurizr.
https://docs.structurizr.com/cli
Apache License 2.0
492 stars 75 forks source link

Docker image misses SLF4J #84

Closed dgutson closed 1 year ago

dgutson commented 1 year ago

When adding theme default in the views, running the CLI from the docker image throws

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
dgutson commented 1 year ago

Is this related? I pulled the latest docker image and got this

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
        at com.structurizr.Workspace.<clinit>(Workspace.java:24)
        at com.structurizr.dsl.WorkspaceParser.parse(WorkspaceParser.java:21)
        at com.structurizr.dsl.StructurizrDslParser.parse(StructurizrDslParser.java:375)
        at com.structurizr.dsl.StructurizrDslParser.parse(StructurizrDslParser.java:125)
        at com.structurizr.cli.export.ExportCommand.run(ExportCommand.java:122)
        at com.structurizr.cli.StructurizrCliApplication.run(StructurizrCliApplication.java:37)
        at com.structurizr.cli.StructurizrCliApplication.main(StructurizrCliApplication.java:82)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        ... 7 more
dgutson commented 1 year ago

I confirmed this is related. This issue does not happen with a previous image, 1.20.1.

simonbrowndotje commented 1 year ago

It's related to a change of build process rather than the missing SLF4J library ... I switched to building the CLI as a part of the structurizr.com build pipeline this afternoon, so CLI changes are available immediately rather than having to wait for a manual release against specific versions of dependencies released to Maven Central. But it turns out that the commons-logging library was missing. That's now been fixed (https://github.com/structurizr/cli/commit/2dbbfbe8eea77d1cbe306bcd33a14b96490f30d3), and structurizr/cli:latest should work now.

dgutson commented 1 year ago

Confirmed. Thanks.