Commit 8b24237
authored
build: fix building in IntelliJ IDEA (#200)
For an improved supply chain security (see [XDev for example](https://xdev.software/en/news/detail/discovering-the-perfect-java-supply-chain-attack-vector-and-how-it-got-fixed) automatic annotation processor discovery should be disabled and annotation processors should be explicitly listed on the command line.
In Maven this can be done:
- If the list of processors is not empty, by adding an `<annotationProcessors>` configuration element.
- If the list of processors is empty, the above setting will cause an invalid `-processor ''` argument to be passed to the compiler. To fix that `-proc:none` needs to be provided.
The above procedure breaks IntelliJ IDEA compilation, since seeing a `-proc:none` not only disables annotation processing, but also causes IDEA to ignore the provided `--processor-path`.
We don't have annotation processors, but we have a [compiler `Plugin`](https://docs.oracle.com/javase/8/docs/jdk/api/javac/tree/com/sun/source/util/Plugin.html), which needs to be on the annotation processor path.
This PR solves these compatibility problems, by removing both the `-proc:none` and `-processor` arguments and _de facto_ **enables** the automatic discovery of annotation processors.
It adds a comment to re-enable the `annotationProcessor` element if an annotation processor is added in the future.
Closes #1991 parent 13d5673 commit 8b24237
1 file changed
+11
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
240 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
241 | 250 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| |||
0 commit comments