|
35 | 35 | <version>1.26.0-SNAPSHOT</version>
|
36 | 36 | </parent>
|
37 | 37 | <dependencies>
|
38 |
| - <dependency> |
39 |
| - <groupId>org.springframework.boot</groupId> |
40 |
| - <artifactId>spring-boot-starter-web</artifactId> |
| 38 | + <!-- |
| 39 | + Exclude problematic versions from the parent: |
| 40 | +
|
| 41 | + The parent POM includes newer versions of SLF4J (2.x) and Logback (1.5.x) |
| 42 | + that are not compatible with the Spring Boot 2.7.x logging setup, which |
| 43 | + relies on SLF4J 1.7.x and Logback 1.2.x. If these newer versions remain, |
| 44 | + they cause runtime errors due to classes like org/slf4j/impl/StaticLoggerBinder |
| 45 | + no longer existing where Spring Boot expects them. |
| 46 | +
|
| 47 | + By excluding these dependencies, we ensure that our module only uses versions |
| 48 | + of SLF4J and Logback that align with the Spring Boot ecosystem. This approach |
| 49 | + helps prevent `NoClassDefFoundError` issues and ensures stable, expected |
| 50 | + logging behavior within this module. |
| 51 | + --> <dependency> |
| 52 | + <groupId>com.iluwatar</groupId> |
| 53 | + <artifactId>java-design-patterns</artifactId> |
| 54 | + <version>1.26.0-SNAPSHOT</version> |
| 55 | + <exclusions> |
| 56 | + <exclusion> |
| 57 | + <groupId>org.slf4j</groupId> |
| 58 | + <artifactId>slf4j-api</artifactId> |
| 59 | + </exclusion> |
| 60 | + <exclusion> |
| 61 | + <groupId>ch.qos.logback</groupId> |
| 62 | + <artifactId>logback-classic</artifactId> |
| 63 | + </exclusion> |
| 64 | + <exclusion> |
| 65 | + <groupId>ch.qos.logback</groupId> |
| 66 | + <artifactId>logback-core</artifactId> |
| 67 | + </exclusion> |
| 68 | + </exclusions> |
41 | 69 | </dependency>
|
| 70 | + |
| 71 | + <!-- Add Spring Boot starters --> |
42 | 72 | <dependency>
|
43 | 73 | <groupId>org.springframework.boot</groupId>
|
44 |
| - <artifactId>spring-boot-starter-test</artifactId> |
45 |
| - <scope>test</scope> |
| 74 | + <artifactId>spring-boot-starter-web</artifactId> |
46 | 75 | </dependency>
|
| 76 | + |
47 | 77 | <dependency>
|
48 | 78 | <groupId>org.springframework.boot</groupId>
|
49 | 79 | <artifactId>spring-boot-starter-data-jpa</artifactId>
|
50 | 80 | </dependency>
|
| 81 | + |
51 | 82 | <dependency>
|
52 | 83 | <groupId>com.h2database</groupId>
|
53 | 84 | <artifactId>h2</artifactId>
|
54 | 85 | <scope>runtime</scope>
|
55 | 86 | </dependency>
|
56 | 87 |
|
| 88 | + <!-- Force recommended SLF4J and Logback versions if you must specify them explicitly --> |
| 89 | + <dependency> |
| 90 | + <groupId>org.slf4j</groupId> |
| 91 | + <artifactId>slf4j-api</artifactId> |
| 92 | + <version>1.7.36</version> <!-- A version compatible with Spring Boot 2.7.x --> |
| 93 | + </dependency> |
| 94 | + |
| 95 | + <dependency> |
| 96 | + <groupId>ch.qos.logback</groupId> |
| 97 | + <artifactId>logback-classic</artifactId> |
| 98 | + <version>1.2.11</version> <!-- A version compatible with Spring Boot 2.7.x --> |
| 99 | + </dependency> |
| 100 | + |
| 101 | + <dependency> |
| 102 | + <groupId>ch.qos.logback</groupId> |
| 103 | + <artifactId>logback-core</artifactId> |
| 104 | + <version>1.2.11</version> |
| 105 | + </dependency> |
| 106 | + |
57 | 107 | </dependencies>
|
58 | 108 |
|
| 109 | + |
59 | 110 | <build>
|
60 | 111 | <plugins>
|
61 | 112 | <plugin>
|
|
0 commit comments