-
-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...-boot-jakarta/src/main/java/io/sentry/spring/boot/jakarta/SentrySpringVersionChecker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.sentry.spring.boot.jakarta; | ||
|
||
import org.apache.commons.logging.Log; | ||
import org.apache.commons.logging.LogFactory; | ||
import org.springframework.boot.SpringBootVersion; | ||
import org.springframework.boot.context.event.ApplicationContextInitializedEvent; | ||
import org.springframework.context.ApplicationListener; | ||
|
||
final class SentrySpringVersionChecker | ||
implements ApplicationListener<ApplicationContextInitializedEvent> { | ||
|
||
private static final Log logger = LogFactory.getLog(SentrySpringVersionChecker.class); | ||
|
||
@Override | ||
public void onApplicationEvent(ApplicationContextInitializedEvent event) { | ||
|
||
if (!SpringBootVersion.getVersion().startsWith("3")) { | ||
logger.warn("############################### WARNING ###############################"); | ||
logger.warn("## ##"); | ||
logger.warn("## !Incompatible Spring Boot Version detected! ##"); | ||
logger.warn("## Please see the sentry docs linked below ##"); | ||
logger.warn("## Choose your Spring Boot version and ##"); | ||
logger.warn("## install the matching dependency ##"); | ||
logger.warn("## ##"); | ||
logger.warn("## https://docs.sentry.io/platforms/java/guides/spring-boot/#install ##"); | ||
logger.warn("## ##"); | ||
logger.warn("#######################################################################"); | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
sentry-spring-boot-jakarta/src/main/resources/META-INF/spring.factories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.springframework.context.ApplicationListener=io.sentry.spring.boot.jakarta.SentrySpringVersionChecker |
30 changes: 30 additions & 0 deletions
30
sentry-spring-boot/src/main/java/io/sentry/spring/boot/SentrySpringVersionChecker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.sentry.spring.boot; | ||
|
||
import org.apache.commons.logging.Log; | ||
import org.apache.commons.logging.LogFactory; | ||
import org.springframework.boot.SpringBootVersion; | ||
import org.springframework.boot.context.event.ApplicationContextInitializedEvent; | ||
import org.springframework.context.ApplicationListener; | ||
|
||
final class SentrySpringVersionChecker | ||
implements ApplicationListener<ApplicationContextInitializedEvent> { | ||
|
||
private static final Log logger = LogFactory.getLog(SentrySpringVersionChecker.class); | ||
|
||
@Override | ||
public void onApplicationEvent(ApplicationContextInitializedEvent event) { | ||
|
||
if (!SpringBootVersion.getVersion().startsWith("2")) { | ||
logger.warn("############################### WARNING ###############################"); | ||
logger.warn("## ##"); | ||
logger.warn("## !Incompatible Spring Boot Version detected! ##"); | ||
logger.warn("## Please see the sentry docs linked below ##"); | ||
logger.warn("## Choose your Spring Boot version and ##"); | ||
logger.warn("## install the matching dependency ##"); | ||
logger.warn("## ##"); | ||
logger.warn("## https://docs.sentry.io/platforms/java/guides/spring-boot/#install ##"); | ||
logger.warn("## ##"); | ||
logger.warn("#######################################################################"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters