I have Spring-boot application with the next plugins and dependencies:
<!--...-->
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.8</version>
<scope>provided</scope>
</dependency>
<!--...-->
<build>
<finalName>service-api</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
<configuration>
<descriptors>
<descriptor>service-api.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.alexecollins.docker</groupId>
<artifactId>docker-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
And the text 2 classes for testing lombok in my app:
import lombok.Data;
@Data
public class TestDto {
private String testStr;
}
And
public class TestCall {
public void testLombok() {
TestDto dto = new TestDto();
dto.setTestStr("My Test String.");
System.out.println(dto);
}
}
So, when I run spring-boot:run from the plugin or even a simple command mvn compile, I have the next error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project service-api: Compilation failure: Compilation failure: [ERROR] D:\Projects\??????\service-api\src\main\java\TestCall.java:[7,-1] [ERROR] 1. ERROR in D:\Projects\???????\service-api\src\main\java\TestCall.java (at line 7) [ERROR] dto.setTestStr("My Test String."); [ERROR] ^^^^^^^^^^ [ERROR] The method setTestStr(String) is undefined for the type TestDto [ERROR] ---------- [ERROR] 1 problem (1 error) [ERROR] [ERROR] Found 1 error and 0 warnings.
It seems the lombok features don't work on spting plugin. However if I use a standard maven-compiler-plugin(version 3.5.1) everything is working correctly. But for now we want to use spring boot embedded container and we are not ready to change our build workflow. Is it possible to do something with this issue? May be I should include some special dependencies or something like that?