Java - sgml/signature GitHub Wiki
Maven 3 to Maven 4
Maven 3 API
| Aspect | Backwards Compatibility | Error Message Limitations |
|---|---|---|
| Direct Model Mutation | Fully compatible with legacy plugins that directly altered the project model. | Errors were often vague; mutation failures surfaced as generic build errors without clear cause. |
| Execution Order Sensitivity | Legacy builds often relied on plugin execution order; Maven 3 preserved this behavior. | Misordered plugin execution produced confusing stack traces, with little guidance on root cause. |
| Reflection and Internal Access | Permitted use of internal APIs and reflection, so older plugins continued to function. | Failures from reflection hacks were opaque, often surfacing as NullPointerException or classpath errors. |
| Global Mutable State | Allowed shared mutable state across plugins, maintaining compatibility with older plugin designs. | Conflicts in global state produced non‑deterministic errors that were difficult to reproduce or diagnose. |
| Redundant Dependency Resolution | Supported repeated dependency resolution triggered by mutations, matching legacy expectations. | Dependency resolution errors repeated across phases, making logs noisy and hard to interpret. |
Maven 4 API
| Aspect | Backwards Compatibility | Error Message Limitations |
|---|---|---|
| Immutable Project Model | Legacy plugins that mutate the model directly are not compatible; requires adaptation. | Clearer errors, but sometimes overly strict: legacy plugins fail with hard immutability violations. |
| Explicit Mutation Hooks | Provides new extension points, but older plugins that relied on uncontrolled mutation must be refactored. | Errors point to missing or misused hooks, but can be verbose and intimidating for new developers. |
| Deterministic Build State | Legacy reliance on plugin order is broken; builds are now reproducible by design. | Errors highlight reproducibility violations, but may lack actionable advice for fixing plugin logic. |
| Scoped Extension Points | Backwards compatibility requires plugins to adopt new scoped APIs; global mutable state is no longer supported. | Misuse of scopes produces detailed errors, but sometimes too technical for plugin authors unfamiliar with internals. |
| Efficient State Handling | Legacy inefficiencies (like repeated dependency resolution) are eliminated; plugins must adapt to immutable models. | Errors about redundant state copies are clearer, but can overwhelm with low‑level detail in logs. |
IntelliJ IDEA Checklist for Upgrading Java 8 → Java 18
| Task | Substeps | Help URL |
|---|---|---|
| Set project SDK to Java 18 | - Open "File → Project Structure" - Select "Project" tab - Set "Project SDK" to Java 18 - Set "Project language level" to 18 | https://www.jetbrains.com/help/idea/sdk.html |
| Enable inspections for deprecated APIs | - Go to "Settings → Editor → Inspections" - Enable "Java → Deprecated API usage" - Run "Code → Inspect Code" on project | https://www.jetbrains.com/help/idea/inspections-settings.html |
| Highlight new syntax features | - Ensure "Project language level" is set to 18 - Write sample code using var, text blocks, records - Verify IDE highlights errors if level mismatch | https://www.jetbrains.com/help/idea/configuring-language-level.html |
| Apply quick fixes and refactors | - Place cursor on warning - Press "Alt+Enter" for quick fix - Use "Refactor → Refactor This" for batch changes | https://www.jetbrains.com/help/idea/refactoring-source-code.html |
| Update build tools (Maven/Gradle) | - Open "pom.xml" or "build.gradle" - Set "maven.compiler.source" / "target" or "java { toolchain { languageVersion = 18 } }" - Sync project with IDE | https://www.jetbrains.com/help/idea/maven-support.html https://www.jetbrains.com/help/idea/gradle.html |
| Run static analysis | - Use "Analyze → Inspect Code" - Review warnings for illegal reflective access or outdated APIs - Apply suggested fixes | https://www.jetbrains.com/help/idea/code-inspection.html |
| Migrate to modules (JPMS) if needed | - Create "module-info.java" in "src/main/java" - Define "requires" and "exports" clauses - Use IDE quick fixes for missing module declarations | https://www.jetbrains.com/help/idea/creating-modules.html |
| Upgrade testing support | - Add JUnit 5 dependency in Maven/Gradle - Use IDE quick fix to replace "@Test" imports - Run tests with IntelliJ's JUnit 5 runner | https://www.jetbrains.com/help/idea/testing.html |
Useful URLs
- Keyboard shortcuts: https://www.jetbrains.com/help/idea/keyboard-shortcuts-you-cannot-miss.html
- Community support URL: https://intellij-support.jetbrains.com/hc/en-us/community/topics
- Maven author's personal blog (Jason van Zyl): https://jvanzyl.wordpress.com/
- Gradle author's personal blog (Hans Dockter): https://hansdockter.com/
- JUnit author's personal blog (Kent Beck): https://www.kentbeck.com/
- IntelliJ Store URL: https://www.jetbrains.com/store/idea/