Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sivaprasadreddy committed Aug 21, 2024
1 parent 79f9c8f commit 66c6dbd
Show file tree
Hide file tree
Showing 87 changed files with 106 additions and 211 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
distribution: [ 'temurin' ]
java: [ '17']
java: [ '21']
env:
DOCKER_IMAGE_NAME: ${{ secrets.DOCKER_USERNAME }}/devzone
steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ variables:
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.


image: eclipse-temurin:17.0.6_10-jdk-focal
image: eclipse-temurin:21-jdk-focal

cache:
key: gradle-cache-key
Expand Down
4 changes: 2 additions & 2 deletions .sdkmanrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
java=17.0.7-tem
gradle=8.1.1
java=21.0.1-tem
gradle=8.8
4 changes: 2 additions & 2 deletions application/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# the first stage of our build will extract the layers
FROM eclipse-temurin:17.0.6_10-jre-focal as builder
FROM eclipse-temurin:21-jre-focal as builder
WORKDIR application
ARG JAR_FILE=build/libs/devzone-0.0.1.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract

# the second stage of our build will copy the extracted layers
FROM eclipse-temurin:17.0.6_10-jre-focal
FROM eclipse-temurin:21-jre-focal
WORKDIR application
COPY --from=builder application/dependencies/ ./
COPY --from=builder application/spring-boot-loader/ ./
Expand Down
16 changes: 8 additions & 8 deletions application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ plugins {
id "io.spring.dependency-management" version "1.1.0"
id "com.gorylenko.gradle-git-properties" version "2.4.1"
id "com.google.cloud.tools.jib" version "3.3.1"
id "com.diffplug.spotless" version "6.18.0"
id "com.diffplug.spotless" version "6.25.0"
id "org.sonarqube" version "4.0.0.2929"
}

group = "com.sivalabs"
version = "0.0.1"
sourceCompatibility = '17'
sourceCompatibility = '21'
archivesBaseName = "devzone"

/*java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(21)
vendor = JvmVendorSpec.ADOPTIUM
}
}*/

def dockerImageName = "sivaprasadreddy/devzone"
def dockerImageTags = ["latest", "${project.version}"]
def dockerBaseImage = "eclipse-temurin:17.0.5_8-jre-focal"
def dockerBaseImage = "eclipse-temurin:21-jre-focal"
def appMainClass = "com.sivalabs.devzone.Application"
def jacocoToolVersion = "0.8.8"
def jacocoToolVersion = "0.8.10"
def jacocoMinCoverageRequired = 0.30
def googleJavaFormatToolVersion = "1.12.0"
def googleJavaFormatToolVersion = "1.23.0"
def jacocoExcludes = [
"com/sivalabs/devzone/*Application.*",
]
Expand Down Expand Up @@ -57,7 +57,7 @@ ext {
set("opencsv_version", "5.7.1")
set("jsoup_version", "1.15.4")
set("datasource_proxy_version", "1.9.0")
set("archunit_junit5_version", "1.0.1")
set("archunit_junit5_version", "1.3.0")
set("rssreader_version", "3.4.4")
}

Expand Down Expand Up @@ -156,7 +156,7 @@ spotless {
test {
useJUnitPlatform()
testLogging {
events = ["PASSED", "FAILED", "SKIPPED"]
events = [/*"PASSED",*/ "FAILED", "SKIPPED"]
showStandardStreams = true
exceptionFormat = "full"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.sivalabs.devzone;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "devzone")
public record ApplicationProperties(boolean importDataEnabled, List<String> importFilePaths) {}
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package com.sivalabs.devzone.common.model;

import com.fasterxml.jackson.annotation.JsonProperty;

import org.springframework.data.domain.Page;

import java.util.List;
import org.springframework.data.domain.Page;

public class PagedResult<T> {
private List<T> data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import io.micrometer.core.aop.TimedAspect;
import io.micrometer.core.instrument.MeterRegistry;

import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.sivalabs.devzone.config;

import com.sivalabs.devzone.config.argresolvers.CurrentUserArgumentResolver;

import java.util.List;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.HiddenHttpMethodFilter;
Expand All @@ -10,8 +10,6 @@
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
private final CurrentUserArgumentResolver currentUserArgumentResolver;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.sivalabs.devzone.config;

import com.sivalabs.devzone.users.domain.model.RoleEnum;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package com.sivalabs.devzone.config.annotations;

import org.springframework.security.access.prepost.PreAuthorize;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.security.access.prepost.PreAuthorize;

@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package com.sivalabs.devzone.config.annotations;

import org.springframework.security.access.prepost.PreAuthorize;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.security.access.prepost.PreAuthorize;

@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.sivalabs.devzone.config.annotations.CurrentUser;
import com.sivalabs.devzone.security.SecurityService;

import java.lang.annotation.Annotation;
import org.springframework.core.MethodParameter;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.stereotype.Component;
Expand All @@ -11,8 +11,6 @@
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer;

import java.lang.annotation.Annotation;

@Component
public class CurrentUserArgumentResolver implements HandlerMethodArgumentResolver {
private final SecurityService securityService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

import com.sivalabs.devzone.ApplicationProperties;
import com.sivalabs.devzone.posts.application.usecases.uploadposts.UploadPostsHandler;

import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Component
@Transactional
public class PostsDataInitializer implements CommandLineRunner {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import jakarta.persistence.PreUpdate;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotEmpty;

import java.time.LocalDateTime;

@Entity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.sivalabs.devzone.posts.adapter.data.entity;

import com.sivalabs.devzone.users.adapter.data.entity.UserEntity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
Expand All @@ -14,7 +13,6 @@
import jakarta.persistence.PreUpdate;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotEmpty;

import java.time.LocalDateTime;

@Entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

import com.sivalabs.devzone.posts.adapter.data.entity.CategoryEntity;
import com.sivalabs.devzone.posts.domain.model.Category;

import org.springframework.stereotype.Component;

import java.util.Set;
import org.springframework.stereotype.Component;

@Component
public class CategoryMapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.sivalabs.devzone.posts.adapter.data.entity.PostEntity;
import com.sivalabs.devzone.posts.domain.model.Post;
import com.sivalabs.devzone.users.adapter.data.mapper.UserMapper;

import org.springframework.stereotype.Component;

@Component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
import com.sivalabs.devzone.posts.adapter.data.mapper.CategoryMapper;
import com.sivalabs.devzone.posts.application.data.repository.CategoryRepository;
import com.sivalabs.devzone.posts.domain.model.Category;

import java.util.List;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
@Transactional
class CategoryRepositoryImpl implements CategoryRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,22 @@

import com.sivalabs.devzone.posts.adapter.data.entity.CategoryEntity;
import com.sivalabs.devzone.posts.domain.model.Category;

import java.util.List;
import java.util.Optional;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Optional;

interface JpaCategoryRepository extends JpaRepository<CategoryEntity, Long> {
Optional<CategoryEntity> findByName(String name);

@Query(
"""
select new com.sivalabs.devzone.posts.domain.model.Category(c.id, c.name)
from CategoryEntity c
""")
select new com.sivalabs.devzone.posts.domain.model.Category(c.id, c.name)
from CategoryEntity c
""")
List<Category> findAllCategories(Sort sort);

@Modifying
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.sivalabs.devzone.posts.adapter.data.repository;

import com.sivalabs.devzone.users.adapter.data.entity.UserEntity;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.sivalabs.devzone.posts.adapter.data.repository;

import com.sivalabs.devzone.posts.adapter.data.entity.PostEntity;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.sivalabs.devzone.posts.domain.model.Category;
import com.sivalabs.devzone.posts.domain.model.Post;
import com.sivalabs.devzone.users.adapter.data.entity.UserEntity;

import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
Expand All @@ -19,8 +19,6 @@
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.Optional;

@Repository
@Transactional
class PostRepositoryImpl implements PostRepository {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.sivalabs.devzone.posts.application.data.repository;

import com.sivalabs.devzone.posts.domain.model.Category;

import java.util.List;

public interface CategoryRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.sivalabs.devzone.common.model.PagedResult;
import com.sivalabs.devzone.posts.domain.model.Post;

import java.util.Optional;

public interface PostRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
import com.sivalabs.devzone.posts.domain.model.Category;
import com.sivalabs.devzone.posts.domain.model.Post;
import com.sivalabs.devzone.users.domain.model.User;

import java.time.LocalDateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;

@Service
@Transactional
public class CreatePostHandler {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.sivalabs.devzone.posts.application.usecases.createpost;

import com.sivalabs.devzone.posts.domain.utils.JsoupUtils;

import jakarta.validation.constraints.NotEmpty;

import org.apache.commons.lang3.StringUtils;

public record CreatePostRequest(
Expand Down
Loading

0 comments on commit 66c6dbd

Please sign in to comment.