I know this question before, BUT when the questioned was asked, it was years ago, and the fix then might not be the fix now. Believe me when I tell you I did my research on this before coming here.
I have the latest IntelliJ installed '2024.1.7', I have the Lombok Plugin installed in IntelliJ, and I updated my pom.xml to include the version of Lombok (1.18.36) for the dependency. I also have the Annotation Processing turned on for the build process. All these I have seen from previous posts, so I wonder what could be going wrong.
This application ran perfectly with Lombok under Eclipse and STS. This application uses the maven: mvn clean install -U and runs perfectly. The app builds in IntelliJ with Lombok, and all the tests run. Now I want to run this Spring Boot app in IntelliJ and I get 6 errors that all stem from not being able to find the getters or setters.
java: cannot find symbol
symbol: method setCompanyId(java.lang.Long)
location: variable company of type com.product.htmx.demo.model.CompanyEntity
CompanyEntity is defined as follows:
@Data
@With
@NoArgsConstructor
@AllArgsConstructor
@SuppressWarnings("serial")
@Entity
@Table(name = "company")
public class CompanyEntity implements Serializable {
// `company_id` int NOT NULL AUTO_INCREMENT,
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "company_id")
private Long companyId;
I get the same error "cannot find symbol" with 5 other classes. However, the other entities and DTO's have multiple properties, and yet I don't get the same error message. I know this might seem like a duplicate message, but I know this is not the same fix as the other much older messages.
I know this question before, BUT when the questioned was asked, it was years ago, and the fix then might not be the fix now. Believe me when I tell you I did my research on this before coming here.
I have the latest IntelliJ installed '2024.1.7', I have the Lombok Plugin installed in IntelliJ, and I updated my pom.xml to include the version of Lombok (1.18.36) for the dependency. I also have the Annotation Processing turned on for the build process. All these I have seen from previous posts, so I wonder what could be going wrong.
This application ran perfectly with Lombok under Eclipse and STS. This application uses the maven: mvn clean install -U and runs perfectly. The app builds in IntelliJ with Lombok, and all the tests run. Now I want to run this Spring Boot app in IntelliJ and I get 6 errors that all stem from not being able to find the getters or setters.
java: cannot find symbol
symbol: method setCompanyId(java.lang.Long)
location: variable company of type com.product.htmx.demo.model.CompanyEntity
CompanyEntity is defined as follows:
@Data
@With
@NoArgsConstructor
@AllArgsConstructor
@SuppressWarnings("serial")
@Entity
@Table(name = "company")
public class CompanyEntity implements Serializable {
// `company_id` int NOT NULL AUTO_INCREMENT,
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "company_id")
private Long companyId;
I get the same error "cannot find symbol" with 5 other classes. However, the other entities and DTO's have multiple properties, and yet I don't get the same error message. I know this might seem like a duplicate message, but I know this is not the same fix as the other much older messages.
Share Improve this question asked Mar 15 at 21:56 tjholmes66tjholmes66 2,0204 gold badges44 silver badges79 bronze badges 4 |1 Answer
Reset to default 2What worked for me is to put the following into Build in my pom.xml:
<build>
<plugins>
<plugin>
<groupId>.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.18.20.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
<proc>full</proc>
. – dan1st Commented Mar 15 at 22:59