adobe / adobe/aem-project-archetype

Duplicate SLF4J bindings on Core when executing tests

Open
#741 2 comments 0 reactions 1 assignee Claimed by @cziegeler View on GitHub
Dominant language
JavaScript
Stars
596
Forks
431
Avg merge
10d 6h
Merged PRs (30d)
1

Description

### Expected Behaviour

`mvn test` does not emit any warning

### Actual Behaviour

The following warning is emitted

```
...
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ mysite.core ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.mysite.core.filters.LoggingFilterTest
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/konradwindszus/.m2/repository/uk/org/lidalia/slf4j-test/1.0.1/slf4j-test-1.0.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/konradwindszus/.m2/repository/com/adobe/aem/aem-sdk-api/2021.6.5540.20210615T210737Z-210527/aem-sdk-api-2021.6.5540.20210615T210737Z-210527.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [uk.org.lidalia.slf4jtest.TestLoggerFactory]
...
```

### Cause

Both the aem-sdk-api dependency (https://github.com/adobe/aem-project-archetype/blob/fc1b073d5628d0f2f3a91adf3b96cace31d133f3/src/main/archetype/core/pom.xml#L169) and lidalia (https://github.com/adobe/aem-project-archetype/blob/fc1b073d5628d0f2f3a91adf3b96cace31d133f3/src/main/archetype/core/pom.xml#L85) contain a SLF4J implementation.

I recommend to get rid of Lidalia (https://github.com/Mahoney/lidalia-slf4j-ext) as it seems basically dead (last release in 2013) and also cover pretty much an edge case (i.e. no a good example to place into a generic archetype).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.