Aias00 opened a new issue, #7477:
URL: https://github.com/apache/shenyu/issues/7477

   ## Description
   
   The project pins Spring Boot 3.3.1 in the root POM (`pom.xml:140`). 
`shenyu-examples-common` still registers its shared example configuration only 
through legacy `EnableAutoConfiguration` metadata:
   
   - 
`shenyu-examples/shenyu-examples-common/src/main/resources/META-INF/spring.factories:2`
   - 
`shenyu-examples/shenyu-examples-common/src/main/resources/META-INF/spring.factories:3`
   
   The module does not contain 
`META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports`.
   
   This matters on Boot 3.3.1. The local `spring-boot-autoconfigure-3.3.1.jar` 
shows `AutoConfigurationImportSelector#getCandidateConfigurations()` loading 
`ImportCandidates` for 
`org.springframework.boot.autoconfigure.AutoConfiguration`, and the failure 
message names 
`META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports`.
 It no longer reads `EnableAutoConfiguration` entries from `spring.factories` 
for candidate auto-configurations.
   
   The configuration is not recovered by component scanning. Example 
applications use packages such as `org.apache.shenyu.examples.springmvc`, while 
the shared configuration is in the sibling package 
`org.apache.shenyu.examples.common.aop`. For example, 
`shenyu-examples-springmvc` depends on `shenyu-examples-common` 
(`shenyu-examples/shenyu-examples-springmvc/pom.xml:47-50`) and uses `@Log` on 
`HttpTestController` 
(`shenyu-examples/shenyu-examples-springmvc/src/main/java/org/apache/shenyu/examples/springmvc/controller/HttpTestController.java:100`),
 but its `@SpringBootApplication` default scan does not include 
`org.apache.shenyu.examples.common.aop`.
   
   ## Impact
   
   `InterceptorConfiguration` is not imported 
(`shenyu-examples/shenyu-examples-common/src/main/java/org/apache/shenyu/examples/common/aop/InterceptorConfiguration.java:23-31`),
 so the `LogInterceptor` aspect bean is not registered 
(`shenyu-examples/shenyu-examples-common/src/main/java/org/apache/shenyu/examples/common/aop/LogInterceptor.java:27-46`).
 The affected `@Log` annotations across Spring MVC, Spring Cloud, Dubbo, gRPC, 
SOFA, TARS, and WebSocket examples no longer run the intended before/after 
advice.
   
   The impact is limited to example applications and demo/logging behavior, so 
I rate this low severity.
   
   ## Suggested fix
   
   Add the modern Boot metadata file:
   
   ```text
   
shenyu-examples/shenyu-examples-common/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
   ```
   
   with:
   
   ```text
   org.apache.shenyu.examples.common.aop.InterceptorConfiguration
   ```
   
   Optionally annotate the configuration with `@AutoConfiguration` to match 
Spring Boot 3 conventions.
   
   ## Related existing issues
   
   Related but distinct from #7310 and PR #7398. Those cover removing legacy 
Spring Boot starter metadata from non-client starters and explicitly retain 
examples metadata. This issue is the remaining Boot 3 runtime gap in 
`shenyu-examples-common`.
   
   
   ## Reviewed Revision And Validation
   
   Apache ShenYu 2.7.2-SNAPSHOT, master at 
a89b6a2338c24e978428b731e8f1edce86022418. Severity: low. Confidence: high.
   
   Two reviews checked Boot3 candidate loading and a concrete Spring MVC 
example whose default scan excludes examples.common.aop.
   
   Current source references:
   
   - 
`shenyu-examples/shenyu-examples-common/src/main/resources/META-INF/spring.factories:2`
   - 
`shenyu-examples/shenyu-examples-common/src/main/java/org/apache/shenyu/examples/common/aop/InterceptorConfiguration.java:23`
   - `pom.xml:140`
   
   No implementation fix or full deployed end-to-end validation was performed 
by this review. Source-flow and runtime evidence are distinguished above.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to