Skip to content

Commit

Permalink
Update Spring version to 2.6.4. Use MariaDB specific drivers. Fix cir…
Browse files Browse the repository at this point in the history
…cular dependency.
  • Loading branch information
Nonononoki committed Mar 7, 2022
1 parent e4516ac commit 33766af
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
7 changes: 5 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.6</version>
<version>2.6.4</version>
<relativePath />
</parent>
<groupId>com.alovoa</groupId>
Expand Down Expand Up @@ -71,6 +71,10 @@
</dependency>

<!-- Spring 3rd party dependencies -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
Expand Down Expand Up @@ -120,7 +124,6 @@


<!-- External 3rd party dependencies -->

<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy-prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ cd target
read -sp 'Password: ' pw
fuser -k 8843/tcp
export JASYPT_ENCRYPTOR_PASSWORD=$pw
nohup java -Xmx1024m -jar -Dspring.profiles.active=prod alovoa-1.0.0.jar &
nohup java -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -jar -Dspring.profiles.active=prod alovoa-1.0.0.jar &
sleep 5
unset JASYPT_ENCRYPTOR_PASSWORD
10 changes: 6 additions & 4 deletions src/main/java/com/nonononoki/alovoa/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Value("${app.login.remember.key}")
private String rememberKey;

@Autowired
private AuthProvider authProvider;

@Autowired
private SuccessHandler successHandler;

Expand Down Expand Up @@ -94,7 +91,7 @@ public void configure(HttpSecurity http) throws Exception {

@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(authProvider);
auth.authenticationProvider(authProvider());
}

@Bean
Expand Down Expand Up @@ -145,4 +142,9 @@ public TokenBasedRememberMeServices oAuthRememberMeServices() throws Exception {
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}

@Bean
public AuthProvider authProvider() {
return new AuthProvider();
}
}
5 changes: 2 additions & 3 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ spring.main.allow-bean-definition-overriding=true

server.http2.enabled=true

spring.sql.init.platform=mysql
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/alovoa?createDatabaseIfNotExist=true&serverTimezone=UTC&useLegacyDatetimeCode=false
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.datasource.url=jdbc:mariadb://localhost:3306/alovoa?createDatabaseIfNotExist=true&serverTimezone=UTC&useLegacyDatetimeCode=false
spring.datasource.hikari.maximum-pool-size=1000
spring.datasource.hikari.connectionTimeout=30000
spring.datasource.hikari.idleTimeout=600000
Expand Down

0 comments on commit 33766af

Please sign in to comment.