The original source is brought from https://daddyprogrammer.org/.
This repository has tuned source files that are built on gradle to maven and removed redundant dependencies of swagger and changed front UI to english.
springboot-angular-mysql-mybatis (The combination of spring boot + angular + mysql + mybatis).
As a reference, I remained the details of how to set up and load into Eclipse STS.
- Resolve the error; "The requested profile "pom.xml" could not be activated because it does not exist. "
- Install through official jar file. (very important)
java -jar lombok.jar
- Add an argument in SpringToolSuite4.ini
-vmargs -javaagent:lombok.jar
mvn spring-boot:run
Spring Boot will automatically add static web resources located within any of the following directories:
/META-INF/resources/
/resources/
/static/
/public/
Install Angular Cli and dependencies
npm install -g @angular/cli
Unarchive src/main/resources/app-ui-src.zip
file.
Move onto the project directory, src/main/resources/app-ui-src/
, install dependencies by npm install
, then ng build
.
Copy files which are generated by ng build
in src/main/resources/app-ui-src/dist/
directory to src/main/resources/static/
To disable csrf and Spring Security Default Login page.
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/**").permitAll()
.and().cors().and().csrf().disable();
}
}
application.properties
management.endpoints.web.base-path=/admin
management.server.port=9999
Install Mysql whatever you are preferred.
Execute DDL.sql
file in src/main/resources/mysql/
.
Access and try this code from http://localhost:8080/
.
For further reference, please consider the following sections:
- Official Apache Maven documentation
- Spring Boot Maven Plugin Reference Guide
- Create an OCI image
- MyBatis Framework
- Spring Security
- Spring Web
The following guides illustrate how to use some features concretely: