I think you cannot avoid it. Normal Scala / Integration in Java works as follows:
- Scala comes first since Java knows nothing about Scala.
- Scalac parses Java files and learns about visible elements.
- Scalac reads Scala files and generates class files.
- Java takes the last place and reads Java files plus class files created by Scala.
The obvious problem is that Scala does not know anything about Lombok annotation, so it cannot determine the elements generated by it.
If you have no dependency on Java before Scala, you can simply invert the order: let Java go first and Scala includes javac class output files in its class path.
Otherwise, I suppose you need to break it.
Daniel C. Sobral
source share