Maven混合編譯groovy和lombok
阿新 • • 發佈:2018-11-09
專案中用到lombok 後面又引入groovy 發現編譯打包的時候,報錯。解決辦法如下:
pom.xml新增如下配置
<plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <compilerId>groovy-eclipse-compiler</compilerId> <verbose>true</verbose> <fork>true</fork> <compilerArguments> <javaAgentClass>lombok.launch.Agent</javaAgentClass> </compilerArguments> </configuration> <dependencies> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-eclipse-compiler</artifactId> <version>2.9.1-01</version> </dependency> <!-- for 2.8.0-01 and later you must have an explicit dependency on groovy-eclipse-batch --> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-eclipse-batch</artifactId> <version>2.3.7-01</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.16.4</version> </dependency> </dependencies> </plugin>