|
| 1 | +# Changes Made for SonarQube 24.12 Compatibility |
| 2 | + |
| 3 | +This document summarizes all changes made to enable the Flutter plugin to work with SonarQube 24.12.0.100206 Community Edition. |
| 4 | + |
| 5 | +## Files Modified |
| 6 | + |
| 7 | +### 1. `/pom.xml` (Root POM) |
| 8 | + |
| 9 | +**Changes:** |
| 10 | + |
| 11 | +- Updated `jdk.min.version` from `1.9` to `17` |
| 12 | +- Updated `sonar.version` from `7.9` to `10.8.0.96604` |
| 13 | + |
| 14 | +**Reason:** |
| 15 | +SonarQube 10.x and above require Java 17 as the minimum version, and the plugin API needs to match the SonarQube server version for compatibility. |
| 16 | + |
| 17 | +```xml |
| 18 | +<!-- Before --> |
| 19 | +<jdk.min.version>1.9</jdk.min.version> |
| 20 | +<sonar.version>7.9</sonar.version> |
| 21 | + |
| 22 | +<!-- After --> |
| 23 | +<jdk.min.version>17</jdk.min.version> |
| 24 | +<sonar.version>10.8.0.96604</sonar.version> |
| 25 | +``` |
| 26 | + |
| 27 | +### 2. `/sonar-flutter-plugin/pom.xml` |
| 28 | + |
| 29 | +**Changes:** |
| 30 | + |
| 31 | +- Updated `sonar-packaging-maven-plugin` from `1.18.0.372` to `1.23.0.740` |
| 32 | +- Added `<requiredForLanguages>dart</requiredForLanguages>` configuration |
| 33 | + |
| 34 | +**Reason:** |
| 35 | +The newer packaging plugin version is compatible with SonarQube 10.x and properly handles plugin metadata. The `requiredForLanguages` helps SonarQube understand which language this plugin supports. |
| 36 | + |
| 37 | +```xml |
| 38 | +<!-- Before --> |
| 39 | +<plugin> |
| 40 | + <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> |
| 41 | + <artifactId>sonar-packaging-maven-plugin</artifactId> |
| 42 | + <version>1.18.0.372</version> |
| 43 | + <extensions>true</extensions> |
| 44 | + <configuration> |
| 45 | + <pluginClass>fr.insideapp.sonarqube.flutter.FlutterPlugin</pluginClass> |
| 46 | + <pluginName>Flutter</pluginName> |
| 47 | + </configuration> |
| 48 | +</plugin> |
| 49 | + |
| 50 | +<!-- After --> |
| 51 | +<plugin> |
| 52 | + <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> |
| 53 | + <artifactId>sonar-packaging-maven-plugin</artifactId> |
| 54 | + <version>1.23.0.740</version> |
| 55 | + <extensions>true</extensions> |
| 56 | + <configuration> |
| 57 | + <pluginClass>fr.insideapp.sonarqube.flutter.FlutterPlugin</pluginClass> |
| 58 | + <pluginName>Flutter</pluginName> |
| 59 | + <requiredForLanguages>dart</requiredForLanguages> |
| 60 | + </configuration> |
| 61 | +</plugin> |
| 62 | +``` |
| 63 | + |
| 64 | +## Already Fixed (from develop branch) |
| 65 | + |
| 66 | +### 3. `/dart-lang/src/main/java/fr/insideapp/sonarqube/dart/lang/Dart.java` |
| 67 | + |
| 68 | +This file was already updated in commit `5e8da41` to fix issue #212 (source files not indexed with SonarQube 10.4+). |
| 69 | + |
| 70 | +**Key changes:** |
| 71 | + |
| 72 | +- Added `FILE_SUFFIXES` constant with `.dart` suffix |
| 73 | +- Added `FILE_SUFFIXES_KEY` for configuration |
| 74 | +- Modified `getFileSuffixes()` to read from configuration |
| 75 | + |
| 76 | +**Reason:** |
| 77 | +SonarQube 10.4+ requires explicit file suffix configuration for language plugins. Without this, Dart files won't be properly indexed. |
| 78 | + |
| 79 | +### 4. `/sonar-flutter-plugin/src/main/java/fr/insideapp/sonarqube/flutter/FlutterPlugin.java` |
| 80 | + |
| 81 | +This file was already updated in commit `5e8da41`. |
| 82 | + |
| 83 | +**Key changes:** |
| 84 | + |
| 85 | +- Added property definition for `Dart.FILE_SUFFIXES_KEY` |
| 86 | +- Added `GENERAL_SUBCATEGORY` constant |
| 87 | + |
| 88 | +**Reason:** |
| 89 | +Exposes the file suffix configuration to users through SonarQube UI, allowing customization if needed. |
| 90 | + |
| 91 | +## Build Files Created |
| 92 | + |
| 93 | +### 5. `/build-plugin.sh` |
| 94 | + |
| 95 | +**Purpose:** |
| 96 | +Automated build script that: |
| 97 | + |
| 98 | +- Checks for Maven installation |
| 99 | +- Validates Java version (must be 17+) |
| 100 | +- Builds the plugin |
| 101 | +- Provides installation instructions |
| 102 | + |
| 103 | +**Usage:** |
| 104 | + |
| 105 | +```bash |
| 106 | +./build-plugin.sh |
| 107 | +``` |
| 108 | + |
| 109 | +## Documentation Created |
| 110 | + |
| 111 | +### 6. `/SONARQUBE_24_MIGRATION.md` |
| 112 | + |
| 113 | +**Purpose:** |
| 114 | +Comprehensive migration guide that includes: |
| 115 | + |
| 116 | +- What changed and why |
| 117 | +- Prerequisites |
| 118 | +- Build instructions |
| 119 | +- Installation steps |
| 120 | +- Testing procedures |
| 121 | +- Troubleshooting guide |
| 122 | + |
| 123 | +## Compatibility Matrix |
| 124 | + |
| 125 | +| SonarQube Version | Plugin Version | Java Version | Status | |
| 126 | +|-------------------|----------------|--------------|--------| |
| 127 | +| 7.9 - 9.9 | v0.0.4 (released) | 11 | ✅ Supported | |
| 128 | +| 10.0 - 10.3 | develop branch | 17 | ⚠️ Untested | |
| 129 | +| 10.4+ | develop branch | 17 | ✅ Fixed in commit 5e8da41 | |
| 130 | +| 24.12 | develop + updates | 17 | ✅ After these changes | |
| 131 | + |
| 132 | +## Testing Checklist |
| 133 | + |
| 134 | +Before deploying to production, test the following: |
| 135 | + |
| 136 | +- [ ] Plugin loads successfully in SonarQube 24.12 |
| 137 | +- [ ] Dart files are recognized and indexed |
| 138 | +- [ ] dartanalyzer/dart analyze rules are applied |
| 139 | +- [ ] Test reports are imported correctly |
| 140 | +- [ ] Coverage reports are processed |
| 141 | +- [ ] Multi-module projects work |
| 142 | +- [ ] Custom analysis_options.yaml can be used |
| 143 | + |
| 144 | +## Rollback Plan |
| 145 | + |
| 146 | +If the updated plugin doesn't work: |
| 147 | + |
| 148 | +1. **Stop SonarQube** |
| 149 | +2. **Remove new plugin:** |
| 150 | + |
| 151 | + ```bash |
| 152 | + rm $SONARQUBE_HOME/extensions/plugins/sonar-flutter-plugin-0.0.5.jar |
| 153 | + ``` |
| 154 | + |
| 155 | +3. **Restore old plugin** (if you kept a backup) |
| 156 | +4. **Restart SonarQube** |
| 157 | + |
| 158 | +## Next Steps |
| 159 | + |
| 160 | +1. **Build the plugin** using `./build-plugin.sh` |
| 161 | +2. **Test in a non-production environment** first |
| 162 | +3. **Monitor SonarQube logs** during first analysis |
| 163 | +4. **Verify results** match expected behavior |
| 164 | +5. **Deploy to production** after successful testing |
| 165 | + |
| 166 | +## Known Limitations |
| 167 | + |
| 168 | +- Plugin has been tested up to SonarQube 10.4 in the community |
| 169 | +- SonarQube 24.12 is a newer version, so some edge cases may exist |
| 170 | +- Always test thoroughly in your environment before production deployment |
| 171 | + |
| 172 | +## Support Resources |
| 173 | + |
| 174 | +- **Official Documentation:** <https://github.com/insideapp-oss/sonar-flutter> |
| 175 | +- **Issue Tracker:** <https://github.com/insideapp-oss/sonar-flutter/issues> |
| 176 | +- **SonarQube Community:** <https://community.sonarsource.com/> |
0 commit comments