Skip to content

Commit

Permalink
Grad Release 1.6.0
Browse files Browse the repository at this point in the history
Grad Release 1.6.0
  • Loading branch information
kamal-mohammed authored Sep 19, 2023
2 parents f35264a + ac5e32c commit c680219
Show file tree
Hide file tree
Showing 90 changed files with 1,082 additions and 685 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/on.pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
- name: Set up JDK 18
uses: actions/setup-java@v1
with:
java-version: 18
Expand Down
30 changes: 11 additions & 19 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ca.bc.gov.educ</groupId>
<artifactId>educ-grad-batch-graduation-api</artifactId>
<version>1.8.47</version>
<version>1.8.48</version>
<name>educ-grad-batch-graduation-api</name>
<description>Ministry of Education GRAD BATCH GRADUATION API</description>

Expand All @@ -27,6 +27,7 @@
src/main/java/ca/bc/gov/educ/api/batchgraduation/processor/**,
src/main/java/ca/bc/gov/educ/api/batchgraduation/reader/**,
src/main/java/ca/bc/gov/educ/api/batchgraduation/writer/**,
src/main/java/org/springframework/**,
src/test/java/ca/bc/gov/educ/api/batchgraduation/**
</sonar.exclusions>
<sonar.coverage.exclusions>
Expand All @@ -41,14 +42,15 @@
src/main/java/ca/bc/gov/educ/api/batchgraduation/processor/**,
src/main/java/ca/bc/gov/educ/api/batchgraduation/reader/**,
src/main/java/ca/bc/gov/educ/api/batchgraduation/writer/**,
src/main/java/org/springframework/**,
src/test/java/ca/bc/gov/educ/api/batchgraduation/**
</sonar.coverage.exclusions>
<java.version>18</java.version>
<maven.compiler.version>3.10.1</maven.compiler.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<org.mapstruct.version>1.3.1.Final</org.mapstruct.version>
<springdoc.version>1.6.9</springdoc.version>
<springdoc.version>2.0.2</springdoc.version>
<log4j.version>2.18.0</log4j.version>
<resilience4j.version>2.0.2</resilience4j.version>
<shedlock.version>4.38.0</shedlock.version>
Expand All @@ -57,7 +59,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.1</version>
<version>3.0.2</version>
</parent>

<dependencies>
Expand Down Expand Up @@ -97,19 +99,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.7.5</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
Expand Down Expand Up @@ -145,7 +138,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>

<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>8.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
Expand All @@ -157,12 +154,7 @@
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-webmvc-core</artifactId>
<version>${springdoc.version}</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>${springdoc.version}</version>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,45 @@
package ca.bc.gov.educ.api.batchgraduation.config;

import org.springframework.batch.core.configuration.annotation.DefaultBatchConfigurer;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.batch.core.launch.support.SimpleJobLauncher;
import org.springframework.batch.core.launch.support.TaskExecutorJobLauncher;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.core.task.SimpleAsyncTaskExecutor;
import org.springframework.core.task.SyncTaskExecutor;
import org.springframework.stereotype.Component;
import org.springframework.transaction.TransactionManager;

import javax.sql.DataSource;

@Configuration
@Profile("!test")
@Component
public class BatchConfig extends DefaultBatchConfigurer {
public class BatchConfig {

@Autowired
public BatchConfig(@Qualifier("batchDataSource") DataSource batchDataSource) {
super(batchDataSource);
}
DataSource dataSource;

@Autowired
TransactionManager transactionManager;

@Bean(name = "asyncJobLauncher")
public JobLauncher asyncJobLauncher(JobRepository jobRepository) throws Exception {
SimpleJobLauncher jobLauncher = new SimpleJobLauncher();
TaskExecutorJobLauncher jobLauncher = new TaskExecutorJobLauncher();
jobLauncher.setJobRepository(jobRepository);
jobLauncher.setTaskExecutor(new SimpleAsyncTaskExecutor());
jobLauncher.afterPropertiesSet();
return jobLauncher;
}

@Bean(name = "jobLauncher")
public JobLauncher jobLauncher(JobRepository jobRepository) throws Exception {
TaskExecutorJobLauncher jobLauncher = new TaskExecutorJobLauncher();
jobLauncher.setJobRepository(jobRepository);
jobLauncher.setTaskExecutor(new SyncTaskExecutor());
jobLauncher.afterPropertiesSet();
return jobLauncher;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -62,7 +63,8 @@ public class BatchDbConfig {

@Primary
@Bean
public DataSource batchDataSource() {
@Qualifier("datasource")
public DataSource dataSource() {
HikariConfig config = new HikariConfig();

config.setDriverClassName(driverClassName);
Expand All @@ -88,14 +90,14 @@ public DataSource batchDataSource() {
public LocalContainerEntityManagerFactoryBean batchEntityManager() {
LocalContainerEntityManagerFactoryBean em
= new LocalContainerEntityManagerFactoryBean();
em.setDataSource(batchDataSource());
em.setDataSource(dataSource());
em.setPackagesToScan("ca.bc.gov.educ.api.batchgraduation.entity");

HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
HashMap<String, Object> properties = new HashMap<>();
properties.put("hibernate.hbm2ddl.auto", "none");
properties.put("hibernate.dialect", "org.hibernate.dialect.Oracle12cDialect");
properties.put("hibernate.dialect", "org.hibernate.dialect.OracleDialect");
properties.put("hibernate.format_sql", "true");
properties.put("hibernate.show_sql", "false");
em.setJpaPropertyMap(properties);
Expand All @@ -107,7 +109,8 @@ public LocalContainerEntityManagerFactoryBean batchEntityManager() {

@Primary
@Bean
public PlatformTransactionManager batchTransactionManager() {
@Qualifier("batchTransactionManager")
public PlatformTransactionManager transactionManager() {
JpaTransactionManager transactionManager = new JpaTransactionManager();
transactionManager.setEntityManagerFactory(batchEntityManager().getObject());
return transactionManager;
Expand Down
Loading

0 comments on commit c680219

Please sign in to comment.