asdfghj
----------------------------------------------------Model----------------------------------------
Course
package com.example.OepAchievers.Model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.*;
import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;
import java.util.Objects;
@Entity
@Table(name = "courses")
public class Course {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String title;
@Column(length = 1000)
private String description;
private BigDecimal price;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "instructor_id")
@JsonIgnoreProperties({"coursesTeaching", "enrollments", "hibernateLazyInitializer", "handler"})
private User instructor;
@Enumerated(EnumType.STRING)
private CourseStatus status = CourseStatus.DRAFT;
@OneToMany(mappedBy = "course", cascade = CascadeType.ALL)
@JsonIgnoreProperties("course")
private Set<Enrollment> enrollments = new HashSet<>();
public enum CourseStatus {
DRAFT, PUBLISHED, ARCHIVED
}
// Constructors
public Course() {}
public Course(String title, String description, BigDecimal price, User instructor) {
this.title = title;
this.description = description;
this.price = price;
this.instructor = instructor;
}
// Getters
public Long getId() {
return id;
}
public String getTitle() {
return title;
}
public String getDescription() {
return description;
}
public BigDecimal getPrice() {
return price;
}
public User getInstructor() {
return instructor;
}
public CourseStatus getStatus() {
return status;
}
public Set<Enrollment> getEnrollments() {
return enrollments;
}
// Setters
public void setId(Long id) {
this.id = id;
}
public void setTitle(String title) {
this.title = title;
}
public void setDescription(String description) {
this.description = description;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public void setInstructor(User instructor) {
this.instructor = instructor;
}
public void setStatus(CourseStatus status) {
this.status = status;
}
public void setEnrollments(Set<Enrollment> enrollments) {
this.enrollments = enrollments;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Course)) return false;
Course course = (Course) o;
return Objects.equals(id, course.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
}
Enrollment:
package com.example.OepAchievers.Model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.*;
import java.time.LocalDateTime;
import java.util.Objects;
@Entity
@Table(name = "enrollments")
public class Enrollment {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "student_id")
@JsonIgnoreProperties({"enrollments", "coursesTeaching", "hibernateLazyInitializer", "handler"})
private User student;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "course_id")
@JsonIgnoreProperties({"enrollments", "instructor", "hibernateLazyInitializer", "handler"})
private Course course;
@Column(nullable = false)
private LocalDateTime enrollmentDate = LocalDateTime.now();
@Enumerated(EnumType.STRING)
private EnrollmentStatus status = EnrollmentStatus.ACTIVE;
private Double progress = 0.0;
public enum EnrollmentStatus {
ACTIVE, COMPLETED, DROPPED
}
// Constructors
public Enrollment() {}
public Enrollment(User student, Course course) {
this.student = student;
this.course = course;
}
// Getters
public Long getId() {
return id;
}
public User getStudent() {
return student;
}
public Course getCourse() {
return course;
}
public LocalDateTime getEnrollmentDate() {
return enrollmentDate;
}
public EnrollmentStatus getStatus() {
return status;
}
public Double getProgress() {
return progress;
}
// Setters
public void setId(Long id) {
this.id = id;
}
public void setStudent(User student) {
this.student = student;
}
public void setCourse(Course course) {
this.course = course;
}
public void setEnrollmentDate(LocalDateTime enrollmentDate) {
this.enrollmentDate = enrollmentDate;
}
public void setStatus(EnrollmentStatus status) {
this.status = status;
}
public void setProgress(Double progress) {
this.progress = progress;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Enrollment)) return false;
Enrollment that = (Enrollment) o;
return Objects.equals(id, that.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
}
EnrollmentId:
package com.example.OepAchievers.Model;
import jakarta.persistence.Embeddable;
import java.io.Serializable;
import java.util.Objects;
@Embeddable
public class EnrollmentId implements Serializable {
private Long studentId;
private String courseId;
// Constructors
public EnrollmentId() {}
public EnrollmentId(Long studentId, String courseId) {
this.studentId = studentId;
this.courseId = courseId;
}
// Getters
public Long getStudentId() {
return studentId;
}
public String getCourseId() {
return courseId;
}
// Setters
public void setStudentId(Long studentId) {
this.studentId = studentId;
}
public void setCourseId(String courseId) {
this.courseId = courseId;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof EnrollmentId)) return false;
EnrollmentId that = (EnrollmentId) o;
return Objects.equals(studentId, that.studentId) &&
Objects.equals(courseId, that.courseId);
}
@Override
public int hashCode() {
return Objects.hash(studentId, courseId);
}
}
User:
package com.example.OepAchievers.Model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.*;
import java.util.HashSet;
import java.util.Set;
import java.util.Objects;
@Entity
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false, unique = true)
private String email;
@Column(nullable = false)
@JsonIgnore
private String password;
@Column(nullable = false)
private String fullName;
@Enumerated(EnumType.STRING)
private Role role;
private boolean active = true;
@OneToMany(mappedBy = "instructor")
@JsonIgnoreProperties({"instructor", "enrollments"})
private Set<Course> coursesTeaching = new HashSet<>();
@OneToMany(mappedBy = "student")
@JsonIgnoreProperties("student")
private Set<Enrollment> enrollments = new HashSet<>();
public enum Role {
STUDENT, INSTRUCTOR, ADMIN
}
// Constructors
public User() {}
public User(String email, String password, String fullName, Role role) {
this.email = email;
this.password = password;
this.fullName = fullName;
this.role = role;
}
// Getters
public Long getId() {
return id;
}
public String getEmail() {
return email;
}
public String getPassword() {
return password;
}
public String getFullName() {
return fullName;
}
public Role getRole() {
return role;
}
public boolean isActive() {
return active;
}
public Set<Course> getCoursesTeaching() {
return coursesTeaching;
}
public Set<Enrollment> getEnrollments() {
return enrollments;
}
// Setters
public void setId(Long id) {
this.id = id;
}
public void setEmail(String email) {
this.email = email;
}
public void setPassword(String password) {
this.password = password;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public void setRole(Role role) {
this.role = role;
}
public void setActive(boolean active) {
this.active = active;
}
public void setCoursesTeaching(Set<Course> coursesTeaching) {
this.coursesTeaching = coursesTeaching;
}
public void setEnrollments(Set<Enrollment> enrollments) {
this.enrollments = enrollments;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof User)) return false;
User user = (User) o;
return Objects.equals(id, user.id);
}
@Override
public int hashCode() {
return Objects.hash(id);
}
}
Users:
package com.example.OepAchievers.Model;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
@Entity
@Table(name="security")
public class Users {
@Id
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
-----------------------------------------------Controller------------------------------------------
CourseController:
package com.example.OepAchievers.Controller;
import com.example.OepAchievers.Model.Course;
import com.example.OepAchievers.Service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/api/courses")
public class CourseController {
@Autowired
private CourseService courseService;
@PostMapping
public ResponseEntity<Course> createCourse(@RequestBody Course course) {
return ResponseEntity.ok(courseService.createCourse(course));
}
@GetMapping("/{id}")
public ResponseEntity<Course> getCourse(@PathVariable Long id) {
return ResponseEntity.ok(courseService.getCourseById(id));
}
@GetMapping("/published")
public ResponseEntity<List<Course>> getPublishedCourses() {
return ResponseEntity.ok(courseService.getPublishedCourses());
}
@PutMapping("/{id}/status")
public ResponseEntity<Course> updateCourseStatus(
@PathVariable Long id,
@RequestParam Course.CourseStatus status) {
Course course = courseService.getCourseById(id);
course.setStatus(status);
return ResponseEntity.ok(courseService.createCourse(course));
}
}
EnrollmentController:
package com.example.OepAchievers.Controller;
import com.example.OepAchievers.Model.Enrollment;
import com.example.OepAchievers.Service.EnrollmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/api/enrollments")
public class EnrollmentController {
@Autowired
private EnrollmentService enrollmentService;
@PostMapping
public ResponseEntity<Enrollment> enrollInCourse(@RequestBody Enrollment enrollment) {
return ResponseEntity.ok(enrollmentService.enroll(enrollment));
}
@GetMapping("/student/{studentId}")
public ResponseEntity<List<Enrollment>> getStudentEnrollments (Long studentId) {
return ResponseEntity.ok(enrollmentService.getStudentEnrollments(studentId));
}
@PutMapping("/{id}/progress")
public ResponseEntity<Void> updateProgress(
@PathVariable Long id,
@RequestParam Double progress) {
enrollmentService.updateProgress(id, progress);
return ResponseEntity.ok().build();
}
}
UserController:
package com.example.OepAchievers.Controller;
import com.example.OepAchievers.Model.User;
import com.example.OepAchievers.Service.UserServ;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api/users")
public class UserController {
@Autowired
private UserServ userService;
@PostMapping("/register")
public ResponseEntity<User> registerUser(@RequestBody User user) {
return ResponseEntity.ok(userService.createUser(user));
}
@GetMapping("/{id}")
public ResponseEntity<User> getUser(@PathVariable Long id) {
return ResponseEntity.ok(userService.getUserById(id));
}
}
-------------------------------------------------Service----------------------------------------------------
CourseService:
package com.example.OepAchievers.Service;
import com.example.OepAchievers.Model.Course;
import com.example.OepAchievers.Repository.CourseRepository;
import jakarta.persistence.EntityNotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class CourseService {
@Autowired
private CourseRepository courseRepository;
public Course createCourse(Course course) {
return courseRepository.save(course);
}
public Course getCourseById(Long id) {
return courseRepository.findById(id).get();
// .orElseThrow(() -> new EntityNotFoundException("Course not found"));
}
public List<Course> getPublishedCourses() {
return courseRepository.findByStatus(Course.CourseStatus.PUBLISHED);
}
}
EnrollmentService:
package com.example.OepAchievers.Service;
import com.example.OepAchievers.Model.Enrollment;
import com.example.OepAchievers.Repository.EnrollmentRepository;
import jakarta.persistence.EntityNotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class EnrollmentService {
@Autowired
private EnrollmentRepository enrollmentRepository;
public Enrollment enroll(Enrollment enrollment) {
if (enrollmentRepository.existsByStudentIdAndCourseId(
enrollment.getStudent().getId(),
enrollment.getCourse().getId())) {
throw new RuntimeException("Student already enrolled in this course");
}
return enrollmentRepository.save(enrollment);
}
public List<Enrollment> getStudentEnrollments(Long studentId) {
return enrollmentRepository.findByStudentId(studentId);
}
public void updateProgress(Long enrollmentId, Double progress) {
Enrollment enrollment = enrollmentRepository.findById(enrollmentId)
.orElseThrow(() -> new EntityNotFoundException("Enrollment not found"));
enrollment.setProgress(progress);
if (progress >= 100.0) {
enrollment.setStatus(Enrollment.EnrollmentStatus.COMPLETED);
}
enrollmentRepository.save(enrollment);
}
}
UserServ:
package com.example.OepAchievers.Service;
import com.example.OepAchievers.Model.User;
import com.example.OepAchievers.Repository.UserRepository;
import jakarta.persistence.EntityNotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
@Service
public class UserServ {
@Autowired
private UserRepository userRepository;
@Autowired
private PasswordEncoder passwordEncoder;
public User createUser(User user) {
if (userRepository.existsByEmail(user.getEmail())) {
throw new RuntimeException("Email already exists");
}
user.setPassword(passwordEncoder.encode(user.getPassword()));
return userRepository.save(user);
}
public User getUserById(Long id) {
return userRepository.findById(id)
.orElseThrow(() -> new EntityNotFoundException("User not found"));
}
// @Bean
// public PasswordEncoder passwordEncoder() {
// return NoOpPasswordEncoder.getInstance();
// }
}
--------------------------------------------------------------------------Class----------------------------------------------------
CustomUserDetails:
package com.example.OepAchievers.Service;
import com.example.OepAchievers.Model.Users;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.Collection;
import java.util.List;
public class CustomUserDetails implements UserDetails {
private final Users user;
public CustomUserDetails(Users user) {
this.user = user;
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return List.of(new SimpleGrantedAuthority(user.getUsername()));
}
@Override
public String getPassword() {
return user.getPassword();
}
@Override
public String getUsername() {
return user.getUsername();
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
}
customer userdetail service :
package com.example.OepAchievers;
import com.example.OepAchievers.Model.Users;
import com.example.OepAchievers.Repository.UsersRepository;
import com.example.OepAchievers.Service.CustomUserDetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
@Service
public class CustomUserDetailsService implements UserDetailsService {
@Autowired
private UsersRepository userRepository;
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
System.out.println("Attempting to load user: " + username);
Users user = userRepository.findByUsername(username)
.orElseThrow(() -> new UsernameNotFoundException("User not found: " + username));
return new CustomUserDetails(user);
}
}
security configuration:
package com.example.OepAchievers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.CorsConfigurationSource;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import java.util.Arrays;
@Configuration
@EnableWebSecurity
public class SecurityConfig {
@Autowired
private CustomUserDetailsService userDetailsService;
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http
.csrf(csrf -> csrf.disable())
.cors(cors -> cors.configurationSource(corsConfigurationSource()))
.authorizeHttpRequests(auth -> auth
.requestMatchers("/api/auth/**").permitAll()
.requestMatchers("/api/users/**").hasRole("USER")
// .requestMatchers("/api/users/register").permitAll()
.anyRequest().authenticated()
)
.formLogin(form -> form
.loginProcessingUrl("/api/auth/login")
.successHandler((request, response, authentication) -> {
System.out.println("Login successful for user: " + authentication.getName());
response.setContentType("application/json");
response.getWriter().write("{\"message\":\"Login successful\", \"role\":\"" +
authentication.getAuthorities().iterator().next().getAuthority() + "\"}");
})
.failureHandler((request, response, exception) -> {
System.out.println("Login failed: " + exception.getMessage());
response.setContentType("application/json");
response.setStatus(401);
response.getWriter().write("{\"error\":\"" + exception.getMessage() + "\"}");
})
)
.httpBasic(Customizer.withDefaults());
return http.build();
}
@Bean
public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowedOrigins(Arrays.asList("http://localhost:3000"));
configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
configuration.setAllowedHeaders(Arrays.asList("*"));
configuration.setExposedHeaders(Arrays.asList("*"));
configuration.setAllowCredentials(true);
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", configuration);
return source;
}
@Bean
public DaoAuthenticationProvider authenticationProvider() {
DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider();
authProvider.setUserDetailsService(userDetailsService);
authProvider.setPasswordEncoder(passwordEncoder());
return authProvider;
}
@Bean
public PasswordEncoder passwordEncoder() {
return NoOpPasswordEncoder.getInstance();
}
}
--------------- --------------------------Repository--------------------------------------
course repository:
package com.example.OepAchievers.Repository;
import com.example.OepAchievers.Model.Course;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface CourseRepository extends JpaRepository<Course, Long> {
List<Course> findByInstructorId(Long instructorId);
List<Course> findByStatus(Course.CourseStatus status);
}
Enrollment Repository:
package com.example.OepAchievers.Repository;
import com.example.OepAchievers.Model.Enrollment;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface EnrollmentRepository extends JpaRepository<Enrollment, Long> {
List<Enrollment> findByStudentId(Long studentId);
List<Enrollment> findByCourseId(Long courseId);
boolean existsByStudentIdAndCourseId(Long studentId, Long courseId);
}
user Repository:
package com.example.OepAchievers.Repository;
import com.example.OepAchievers.Model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.Optional;
public interface UserRepository extends JpaRepository<User, Long> {
Optional<User> findByEmail(String email);
boolean existsByEmail(String email);
}
Users Repository:
package com.example.OepAchievers.Repository;
import com.example.OepAchievers.Model.Users;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
@Repository
public interface UsersRepository extends JpaRepository<Users, String> {
Optional<Users> findByUsername(String username);
}
-----------------------------------------Request-------------------------------------------------
course Request:
package com.example.OepAchievers.Request;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Positive;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class CourseRequest {
@NotBlank
private String title;
private String description;
@Positive
private BigDecimal price;
}
Enrollment Request:
package com.example.OepAchievers.Request;
import lombok.Data;
import org.antlr.v4.runtime.misc.NotNull;
@Data
public class EnrollmentRequest {
@NotNull
private Long studentId;
@NotNull
private Long courseId;
}
registerUser Request:
package com.example.OepAchievers.Request;
import com.example.OepAchievers.Model.User;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
@Data
public class RegisterUserRequest {
@NotBlank
private String fullName;
@Email
@NotBlank
private String email;
@NotBlank
private String password;
private User.Role role = User.Role.STUDENT;
private User.Role rule = User.Role.INSTRUCTOR;
private User.Role rle = User.Role.ADMIN;
}
--------------------------------------------------SpringApplication--------------------------------
package com.example.OepAchievers;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class OepAchieversApplication {
public static void main(String[] args) {
SpringApplication.run(OepAchieversApplication.class, args);
}
}
----------------------------------------ApplicationProperties------------------------------
spring.application.name=OepAchievers
spring.datasource.driver-class-name = org.postgresql.Driver
spring.security.user.name=anand
spring.security.user.password=1234
spring.datasource.url=jdbc:postgresql://localhost:5432/projectdb
spring.datasource.username=postgres
spring.datasource.password=Anand@201
spring.jpa.hibernate.ddl-auto = update
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
server.port=8081
spring.main.allow-circular-references=true
---------------------------------------------poxml----------------------------------------
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>OepAchievers</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>OepAchievers</name>
<description>Demo project for Spring Boot</description>
<url/>
<licenses>
<license/>
</licenses>
<developers>
<developer/>
</developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
</scm>
<properties>
<java.version>23</java.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-validation -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<version>3.4.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-starter-webmvc-ui -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<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>
</project>