Commit e7ea166
committed
Fix javac plugin compilation under JDK 17+
JavaToolchainPlugin (now removed) used to mask two JDK-17+ issues in the
javacPlugin project by pinning its compile JDK to 11 and stripping flags
from the doc task. With the plugin gone, both issues surface:
1. JDK 14 added Plugin.autoStart(), so JDK 17/21 javac eagerly enumerates
ServiceLoader<Plugin> providers from the compile classpath. During
incremental compilation our META-INF/services/com.sun.source.util.Plugin
descriptor lives on the classpath but SemanticdbPlugin.class isn't
built yet, so ServiceLoader throws 'Provider ... not found'.
Fix: move the descriptor from src/main/resources/ to
src/main/assembly-resources/ and inject that directory only into the
assembled fat jar via 'assembly / fullClasspath'. The descriptor is
absent from the compile classpath but still bundled in the published
jar.
2. javadoc rejects the '-g' flag that was previously added via
'javacOptions += "-g"'. The old plugin worked around this with
'(doc / javacOptions) --= List("-g")'.
Fix: scope '-g' to 'Compile / javacOptions' so it never reaches the
doc task.1 parent ab315b6 commit e7ea166
2 files changed
Lines changed: 10 additions & 1 deletion
File tree
- semanticdb-javac/src/main/assembly-resources/META-INF/services
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
128 | 137 | | |
129 | 138 | | |
130 | 139 | | |
| |||
0 commit comments