Conversation
… with IDEA 261+ (#1279) MavenHelper.getMavenIdByMaven() previously accessed mavenProject.mavenId directly, which references org.jetbrains.idea.maven.model.MavenId in its bytecode. In IntelliJ IDEA IU-261.22158.121, this class is no longer resolvable from the plugin classloader, causing NoSuchClassError at runtime. This fix uses reflection to call getMavenId() and access groupId/artifactId/ version properties, avoiding any compile-time reference to the MavenId class.
Review Summary by QodoUse reflection to access MavenId for IDEA 261+ compatibility
WalkthroughsDescription• Use reflection to access MavenId avoiding binary incompatibility • Resolves NoSuchClassError in IntelliJ IDEA 261+ versions • Prevents direct compile-time reference to MavenId class • Maintains backward compatibility with earlier IDEA versions Diagramflowchart LR
A["Direct MavenId access"] -->|"causes NoSuchClassError"| B["IDEA 261+ incompatibility"]
C["Reflection-based access"] -->|"avoids compile-time reference"| D["Compatible with all versions"]
A -.->|"replaced by"| C
File Changes1. idea-plugin/src/main/kotlin/com/itangcent/idea/utils/MavenHelper.kt
|
Code Review by Qodo
1. Reflection failures unlogged
|
|
📦 Plugin has been packaged for this PR. You can download |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #617 +/- ##
===============================================
+ Coverage 53.908% 53.987% +0.079%
+ Complexity 2366 2350 -16
===============================================
Files 259 259
Lines 14699 13544 -1155
Branches 3248 3256 +8
===============================================
- Hits 7924 7312 -612
+ Misses 5331 4787 -544
- Partials 1444 1445 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 160 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This PR cherry-picks a fix from easy-yapi to address binary incompatibility with IntelliJ IDEA 261+.
Changes
Source
Cherry-picked from easy-yapi commit f99e8c7c
Related