So I added these maven dependencies in my project which will allow me to encode my logs in JSON. After doing this I reloaded maven on IntelliJ and I was able to run the Main class and use these dependencies:
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>7.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.janino</groupId>
<artifactId>janino</artifactId>
<version>2.6.1</version>
</dependency>
When I do mvn clean install -DskipTests
and run the exported jar then I get this error:
2023-01-11 13:07:54 13:07:54,863 |-ERROR in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Could not create component [encoder] of type [net.logstash.logback.encoder.LogstashEncoder] java.lang.ClassNotFoundException: net.logstash.logback.encoder.LogstashEncoder
Would someone know why the exported jar complains about not finding this dependency although when running the main class the dependency seems to be in use? Thanks in advance for the help