I am currently developing a microservice application and so far I have been using Windows 10. However, recently I have changed my set up into mac. After installing Java + Maven and trying to compile the projects, I am experiencing compilation issues on most of them. 2 of them compile without issues, but the others are having issues with lombok or other dependencies that are working in Windows.
Here is an example of one of the compilation issues. This one is related to the annotations of lombok that are not being picked up in compilation:
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class ExtendedMktQuote {
private String type;
private String source;
private String last;
private String last_timedate;
private String last_time;
private String change;
private String change_pct;
private String volume;
private String volume_alt;
private String changetype;
}
When compiling I have this error for all of the parameters:
[ERROR] location: variable quoteResponse of type EAS.ExternalAPIService.ExternalAPIReplies.CNBCReplies.ExtendedMktQuote
[ERROR] {pathRedacted}.java:[24,67] cannot find symbol
[ERROR] symbol: method getType()
Here is an example of my pom file in the maven / lombok part:
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>false</optional>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
Other classes that use lombok for the @Getter
and @Setter
are showing the same issues.
Is there any known issues like this with lombok in macOS? Can this be an issue with anything related to Java / Maven installation?
On the pom I have already tried taken out the excludes
part on the build of the pom related to lombok, but issue remains the same.
The issue was coming from the maven default jdk. My project was built on java 17 but for some reason when using homebrew to install the project, maven does not check if a java version is already installed and installs the latest jdk (23). After updating the jdk to be used the project runs fine but I also updated my pom to include lombok within the build part:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>