I'm using Eclipse 2021-3 (4.19.0) on Mac OS Big Sur. I have imported a Maven project (https://github.com/gavinklfong/stream-api-exercises) and have verified the right JDK is selected (v 11)
When I right-click on my project, select "Run" -> "Maven" and specify a goal of install, everythign reports successful in the console output. However, I see compilation errors next to certain lines
One for example, complains "The method getCategory is undefined for the type Product." Below is the Product class
package space.gavinklfong.demo.streamapi.models;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.With;
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table
public class Product {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
private String category;
@With
private Double price;
@ManyToMany(mappedBy = "products")
@ToString.Exclude
@EqualsAndHashCode.Exclude
private Set<Order> orders;
}
How do I configure my Maven project in Eclipse to use the same compiler/build path that is being used when I execute a Run -> Maven build command from Eclipse?


