BAEL-20869 Move remaining spring boot modules
This commit is contained in:
parent
3e26f588fc
commit
06161e1bae
45
pom.xml
45
pom.xml
|
@ -637,30 +637,8 @@
|
|||
|
||||
<module>spring-batch</module>
|
||||
<module>spring-bom</module>
|
||||
|
||||
<module>spring-boot</module>
|
||||
<module>spring-boot-modules</module>
|
||||
<module>spring-boot-angular</module>
|
||||
<module>spring-boot-bootstrap</module>
|
||||
<!-- <module>spring-boot-cli</module> --> <!-- Not a maven project -->
|
||||
<module>spring-boot-client</module>
|
||||
<module>spring-boot-config-jpa-error</module>
|
||||
<module>spring-boot-deployment</module>
|
||||
<module>spring-boot-di</module>
|
||||
<module>spring-boot-environment</module>
|
||||
<module>spring-boot-flowable</module>
|
||||
<module>spring-boot-jasypt</module>
|
||||
<module>spring-boot-libraries</module>
|
||||
<module>spring-boot-mvc-2</module>
|
||||
<module>spring-boot-parent</module>
|
||||
<module>spring-boot-performance</module>
|
||||
<module>spring-boot-property-exp</module>
|
||||
|
||||
<module>spring-boot-rest</module>
|
||||
<module>spring-boot-runtime</module>
|
||||
<module>spring-boot-runtime/disabling-console-jul</module>
|
||||
<module>spring-boot-runtime/disabling-console-log4j2</module>
|
||||
<module>spring-boot-runtime/disabling-console-logback</module>
|
||||
<module>spring-boot-security</module>
|
||||
|
||||
<module>spring-caching</module>
|
||||
|
@ -1159,31 +1137,8 @@
|
|||
|
||||
<module>spring-batch</module>
|
||||
<module>spring-bom</module>
|
||||
|
||||
<module>spring-boot</module>
|
||||
<module>spring-boot-modules</module>
|
||||
<module>spring-boot-angular</module>
|
||||
<module>spring-boot-bootstrap</module>
|
||||
<!-- <module>spring-boot-cli</module> --> <!-- Not a maven project -->
|
||||
<module>spring-boot-client</module>
|
||||
<module>spring-boot-config-jpa-error</module>
|
||||
<module>spring-boot-deployment</module>
|
||||
<module>spring-boot-di</module>
|
||||
<module>spring-boot-environment</module>
|
||||
<module>spring-boot-flowable</module>
|
||||
<module>spring-boot-jasypt</module>
|
||||
<module>spring-boot-libraries</module>
|
||||
<module>spring-boot-mvc</module>
|
||||
<module>spring-boot-mvc-2</module>
|
||||
<module>spring-boot-parent</module>
|
||||
<module>spring-boot-performance</module>
|
||||
<module>spring-boot-property-exp</module>
|
||||
|
||||
<module>spring-boot-rest</module>
|
||||
<module>spring-boot-runtime</module>
|
||||
<module>spring-boot-runtime/disabling-console-jul</module>
|
||||
<module>spring-boot-runtime/disabling-console-log4j2</module>
|
||||
<module>spring-boot-runtime/disabling-console-logback</module>
|
||||
<module>spring-boot-security</module>
|
||||
|
||||
<module>spring-caching</module>
|
||||
|
|
Binary file not shown.
|
@ -14,21 +14,36 @@
|
|||
</parent>
|
||||
|
||||
<modules>
|
||||
<module>spring-boot</module>
|
||||
<module>spring-boot-admin</module>
|
||||
<module>spring-boot-angular</module>
|
||||
<module>spring-boot-artifacts</module>
|
||||
<module>spring-boot-ctx-fluent</module>
|
||||
<module>spring-boot-autoconfiguration</module>
|
||||
<module>spring-boot-bootstrap</module>
|
||||
<module>spring-boot-client</module>
|
||||
<module>spring-boot-config-jpa-error</module>
|
||||
<module>spring-boot-ctx-fluent</module>
|
||||
<module>spring-boot-deployment</module>
|
||||
<module>spring-boot-camel</module>
|
||||
<!-- <module>spring-boot-cli</module> --> <!-- Not a maven project -->
|
||||
<module>spring-boot-custom-starter</module>
|
||||
<module>spring-boot-crud</module>
|
||||
<module>spring-boot-data</module>
|
||||
<module>spring-boot-environment</module>
|
||||
<module>spring-boot-flowable</module>
|
||||
<!-- <module>spring-boot-gradle</module> --> <!-- Not a maven project -->
|
||||
<module>spring-boot-jasypt</module>
|
||||
<module>spring-boot-keycloak</module>
|
||||
<module>spring-boot-libraries</module>
|
||||
<module>spring-boot-logging-log4j2</module>
|
||||
<module>spring-boot-kotlin</module>
|
||||
<module>spring-boot-mvc</module>
|
||||
<module>spring-boot-mvc-2</module>
|
||||
<module>spring-boot-mvc-birt</module>
|
||||
<module>spring-boot-nashorn</module>
|
||||
<module>spring-boot-properties</module>
|
||||
<module>spring-boot-property-exp</module>
|
||||
<module>spring-boot-runtime</module>
|
||||
<module>spring-boot-springdoc</module>
|
||||
<module>spring-boot-testing</module>
|
||||
<module>spring-boot-vue</module>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-boot-2</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../parent-boot-2</relativePath>
|
||||
<relativePath>../../parent-boot-2</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
|
@ -1,28 +1,28 @@
|
|||
package com.baeldung.application;
|
||||
|
||||
import com.baeldung.application.entities.User;
|
||||
import com.baeldung.application.repositories.UserRepository;
|
||||
import java.util.stream.Stream;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@SpringBootApplication
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
CommandLineRunner init(UserRepository userRepository) {
|
||||
return args -> {
|
||||
Stream.of("John", "Julie", "Jennifer", "Helen", "Rachel").forEach(name -> {
|
||||
User user = new User(name, name.toLowerCase() + "@domain.com");
|
||||
userRepository.save(user);
|
||||
});
|
||||
userRepository.findAll().forEach(System.out::println);
|
||||
};
|
||||
}
|
||||
}
|
||||
package com.baeldung.application;
|
||||
|
||||
import com.baeldung.application.entities.User;
|
||||
import com.baeldung.application.repositories.UserRepository;
|
||||
import java.util.stream.Stream;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@SpringBootApplication
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
CommandLineRunner init(UserRepository userRepository) {
|
||||
return args -> {
|
||||
Stream.of("John", "Julie", "Jennifer", "Helen", "Rachel").forEach(name -> {
|
||||
User user = new User(name, name.toLowerCase() + "@domain.com");
|
||||
userRepository.save(user);
|
||||
});
|
||||
userRepository.findAll().forEach(System.out::println);
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,31 +1,31 @@
|
|||
package com.baeldung.application.controllers;
|
||||
|
||||
import com.baeldung.application.entities.User;
|
||||
import com.baeldung.application.repositories.UserRepository;
|
||||
import java.util.List;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin(origins = "http://localhost:4200")
|
||||
public class UserController {
|
||||
|
||||
private final UserRepository userRepository;
|
||||
|
||||
public UserController(UserRepository userRepository) {
|
||||
this.userRepository = userRepository;
|
||||
}
|
||||
|
||||
@GetMapping("/users")
|
||||
public List<User> getUsers() {
|
||||
return (List<User>) userRepository.findAll();
|
||||
}
|
||||
|
||||
@PostMapping("/users")
|
||||
void addUser(@RequestBody User user) {
|
||||
userRepository.save(user);
|
||||
}
|
||||
}
|
||||
package com.baeldung.application.controllers;
|
||||
|
||||
import com.baeldung.application.entities.User;
|
||||
import com.baeldung.application.repositories.UserRepository;
|
||||
import java.util.List;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin(origins = "http://localhost:4200")
|
||||
public class UserController {
|
||||
|
||||
private final UserRepository userRepository;
|
||||
|
||||
public UserController(UserRepository userRepository) {
|
||||
this.userRepository = userRepository;
|
||||
}
|
||||
|
||||
@GetMapping("/users")
|
||||
public List<User> getUsers() {
|
||||
return (List<User>) userRepository.findAll();
|
||||
}
|
||||
|
||||
@PostMapping("/users")
|
||||
void addUser(@RequestBody User user) {
|
||||
userRepository.save(user);
|
||||
}
|
||||
}
|
|
@ -1,43 +1,43 @@
|
|||
package com.baeldung.application.entities;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class User {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private long id;
|
||||
private final String name;
|
||||
private final String email;
|
||||
|
||||
public User() {
|
||||
this.name = "";
|
||||
this.email = "";
|
||||
}
|
||||
|
||||
public User(String name, String email) {
|
||||
this.name = name;
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "User{" + "id=" + id + ", name=" + name + ", email=" + email + '}';
|
||||
}
|
||||
}
|
||||
package com.baeldung.application.entities;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class User {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private long id;
|
||||
private final String name;
|
||||
private final String email;
|
||||
|
||||
public User() {
|
||||
this.name = "";
|
||||
this.email = "";
|
||||
}
|
||||
|
||||
public User(String name, String email) {
|
||||
this.name = name;
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "User{" + "id=" + id + ", name=" + name + ", email=" + email + '}';
|
||||
}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
package com.baeldung.application.repositories;
|
||||
|
||||
import com.baeldung.application.entities.User;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
|
||||
@Repository
|
||||
public interface UserRepository extends CrudRepository<User, Long>{}
|
||||
package com.baeldung.application.repositories;
|
||||
|
||||
import com.baeldung.application.entities.User;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
|
||||
@Repository
|
||||
public interface UserRepository extends CrudRepository<User, Long>{}
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
@ -7,11 +7,11 @@
|
|||
<base href="/">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
<link rel="icon" type="image/x-icon" href="spring-boot-angular/src/main/js/application/src/favicon.ico">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
|
||||
crossorigin="anonymous">
|
||||
</head>
|
||||
<body>
|
||||
<app-root></app-root>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue