You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2020/06/13 14:00:00 UTC
[jira] [Closed] (VELOCITY-929) Improper SLF4J dependency
[ https://issues.apache.org/jira/browse/VELOCITY-929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Osipov closed VELOCITY-929.
-----------------------------------
Resolution: Invalid
Here is the tree:
{noformat}
[INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ velocity-engine-core ---
[INFO] org.apache.velocity:velocity-engine-core:jar:2.3-SNAPSHOT
[INFO] +- org.apache.commons:commons-lang3:jar:3.9:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.7.30:compile
[INFO] +- junit:junit:jar:4.13:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.hsqldb:hsqldb:jar:2.5.0:test
[INFO] +- commons-io:commons-io:jar:2.6:compile
[INFO] \- org.slf4j:slf4j-simple:jar:1.7.30:test
{noformat}
It is perfectly fine in compile scope. This is how it should be. Client has to add bindings at runtime.
> Improper SLF4J dependency
> -------------------------
>
> Key: VELOCITY-929
> URL: https://issues.apache.org/jira/browse/VELOCITY-929
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 2.2
> Reporter: Mantas Gridinas
> Priority: Minor
>
> Currently, velocity-engine-core defines a transitive dependency of "slf4j-api" as a compile time dependency, rather than a non-transitive compile time dependency as seen by snippet below
> {code:xml}
> <dependency>
> <groupId>org.slf4j</groupId>
> <artifactId>slf4j-api</artifactId>
> <version>1.7.30</version>
> <scope>compile</scope>
> </dependency>
> {code}
> Instead, the dependency's scope should be provided. This prevents classpath races and leaves it up to the user/developer to pull in the necessary slf4j API dependency for their project.
> Currently I use the following workaround to exclude the slf4j dependency
> {code:xml}
> <dependency>
> <groupId>org.apache.velocity</groupId>
> <artifactId>velocity-engine-core</artifactId>
> <version>2.2</version>
> <exclusions>
> <exclusion>
> <groupId>org.slf4j</groupId>
> <artifactId>slf4j-api</artifactId>
> </exclusion>
> </exclusions>
> </dependency>
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org