Skip to content

Commit

Permalink
Merge pull request #312 from ita-social-projects/revert_migration
Browse files Browse the repository at this point in the history
revert migration
  • Loading branch information
Skyere authored Feb 16, 2024
2 parents c358d4f + 045295e commit b5b0090
Show file tree
Hide file tree
Showing 231 changed files with 2,056 additions and 2,133 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up JDK 21
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 21
java-version: 11

# - name: Set up Go
# uses: actions/setup-go@v3
Expand All @@ -45,7 +45,7 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_USER }}
run: |
git fetch --unshallow
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.projectKey=ita-social-projects-green-city-user -Dsonar.organization=ita-social-projects -Dsonar.host.url=https://sonarcloud.io -Dsonar.sources='src/main/java/greencity' -Dsonar.binaries=target/classes -Dsonar.dynamicAnalysis=reuseReports -Dsonar.coverage.exclusions=**/config/*
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.projectKey=ita-social-projects-green-city-user -Dsonar.organization=ita-social-projects -Dsonar.host.url=https://sonarcloud.io -Dsonar.sources='src/main/java/greencity' -Dsonar.binaries=target/classes -Dsonar.dynamicAnalysis=reuseReports
# Checks-out your greencity.repository under $GITHUB_WORKSPACE, so your job can access it

- name: Test Reporter
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:22-ea-21-jdk-slim as runner
FROM openjdk:11.0.15-jre as runner
WORKDIR runner
COPY **/target/app.jar runner/
CMD java -jar runner/app.jar
2 changes: 1 addition & 1 deletion az-cd-pipeline-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ stages:
inputs:
mavenPomFile: 'pom.xml'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.21'
jdkVersionOption: '1.11'
mavenVersionOption: 'Default'
options: '-Dmaven.test.skip=true'

Expand Down
2 changes: 1 addition & 1 deletion az-cd-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ stages:
inputs:
mavenPomFile: 'pom.xml'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.21'
jdkVersionOption: '1.11'
mavenVersionOption: 'Default'
options: '-Dmaven.test.skip=true'

Expand Down
21 changes: 8 additions & 13 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
-->

<module name="Checker">

<property name="charset" value="UTF-8"/>

<property name="severity" value="error"/>
Expand Down Expand Up @@ -59,16 +58,6 @@
<property name="fileExtensions" value="groovy,java"/>
</module>

<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value=".*[\\/]resources[\\/].*$"/>
</module>

<module name="LineLength">
<property name="max" value="120"/>
<property name="ignorePattern"
value="^package.*|^import.*|a href|href|http://|https://|ftp://|public static final"/>
</module>

<module name="TreeWalker">
<module name="OuterTypeFilename"/>
<module name="IllegalTokenText">
Expand All @@ -83,6 +72,11 @@
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<module name="LineLength">
<property name="max" value="120"/>
<property name="ignorePattern"
value="^package.*|^import.*|a href|href|http://|https://|ftp://|public static final"/>
</module>
<module name="OneTopLevelClass"/>
<module name="NoLineWrap"/>
<module name="EmptyBlock">
Expand Down Expand Up @@ -267,10 +261,12 @@
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="JavadocMethod">
<property name="accessModifiers" value="public"/>
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
Expand All @@ -284,6 +280,5 @@
<property name="exceptionVariableName" value="expected"/>
</module>
<module name="CommentsIndentation"/>
<module name="UnusedImports"/>
</module>
</module>
65 changes: 29 additions & 36 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
<modelVersion>4.0.0</modelVersion>

<properties>
<swagger.version>2.9.2</swagger.version>
<google.http-client.version>1.34.2</google.http-client.version>
<google.api-client.version>2.1.4</google.api-client.version>
<google.api-client.version>1.30.8</google.api-client.version>
<springfox-bean-validators.version>2.9.2</springfox-bean-validators.version>
<jjwt.version>0.12.3</jjwt.version>
<modelmapper.version>3.2.0</modelmapper.version>
<jjwt.version>0.9.1</jjwt.version>
<modelmapper.version>2.3.6</modelmapper.version>
<mockito-junit-jupiter.version>3.3.3</mockito-junit-jupiter.version>
</properties>

Expand Down Expand Up @@ -60,30 +61,30 @@
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>

<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.2.0</version>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
</dependency>

<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
</dependency>

<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client-java6</artifactId>
<version>2.1.4</version>
<artifactId>google-api-client</artifactId>
<version>${google.api-client.version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client</artifactId>
Expand All @@ -102,7 +103,12 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>

<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-bean-validators</artifactId>
<version>${springfox-bean-validators.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-messaging</artifactId>
Expand All @@ -113,22 +119,10 @@
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
<artifactId>jjwt</artifactId>
<version>${jjwt.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-impl</artifactId>
<version>${jjwt.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-orgjson</artifactId>
<version>${jjwt.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
Expand Down Expand Up @@ -176,16 +170,15 @@
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>1.9.20</version>
<version>1.9.10</version>
</dependency>

</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-webapp-maven-plugin</artifactId>
<version>2.12.0</version>
<version>1.9.0</version>
<configuration>
<schemaVersion>V2</schemaVersion>
<resourceGroup>GreenCity</resourceGroup>
Expand All @@ -194,8 +187,8 @@
<region>centralus</region>
<runtime>
<os>linux</os>
<javaVersion>jre21</javaVersion>
<webContainer>jre21</webContainer>
<javaVersion>jre11</javaVersion>
<webContainer>jre11</webContainer>
</runtime>
<deployment>
<resources>
Expand All @@ -212,7 +205,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>3.2.1</version>
<version>2.3.3.RELEASE</version>
</plugin>
</plugins>
</build>
Expand Down
12 changes: 5 additions & 7 deletions core/src/main/java/greencity/annotations/ApiLocale.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package greencity.annotations;

import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand All @@ -17,8 +16,7 @@
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Parameters({
@Parameter(name = "lang", schema = @Schema(type = "string"), in = ParameterIn.QUERY,
description = "Code of the needed language.")})
@ApiImplicitParams({
@ApiImplicitParam(name = "lang", value = "Code of the needed language.", dataType = "string", paramType = "query")})
public @interface ApiLocale {
}
36 changes: 14 additions & 22 deletions core/src/main/java/greencity/annotations/ApiPageable.java
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
package greencity.annotations;

import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Parameters({
@Parameter(name = "page", schema = @Schema(type = "int", minimum = "0", defaultValue = "0"), in = ParameterIn.QUERY,
description = """
Page index you want to retrieve [0..N]. \
If page index is less than 0 or not specified then default value is used!\
"""),
@Parameter(name = "size", schema = @Schema(type = "int", minimum = "1", maximum = "100", defaultValue = "5"),
in = ParameterIn.QUERY, description = """
Number of records per page [1..100]. \
If size is less than 1 or not specified then default value is used!\
If size is bigger than 100, size becomes 100.\
"""),
@Parameter(name = "sort", schema = @Schema(type = "array", implementation = String.class), in = ParameterIn.QUERY,
description = """
Sorting criteria in the format: property(,asc|desc). \
Default sort order is ascending. \
Multiple sort criteria are supported.\
""")})
@ApiImplicitParams({
@ApiImplicitParam(name = "page", dataType = "int", paramType = "query", defaultValue = "0",
value = "Page index you want to retrieve [0..N]. "
+ "If page index is less than 0 or not specified then default value is used!"),
@ApiImplicitParam(name = "size", dataType = "int", paramType = "query", defaultValue = "5",
value = "Number of records per page [1..100]. "
+ "If size is less than 1 or not specified then default value is used!"
+ "If size is bigger than 100, size becomes 100."),
@ApiImplicitParam(name = "sort", allowMultiple = true, dataType = "string", paramType = "query",
value = "Sorting criteria in the format: property(,asc|desc). "
+ "Default sort order is ascending. " + "Multiple sort criteria are supported.")})
public @interface ApiPageable {
}
5 changes: 3 additions & 2 deletions core/src/main/java/greencity/annotations/ImageValidation.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package greencity.annotations;

import greencity.validator.ImageValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand Down
8 changes: 5 additions & 3 deletions core/src/main/java/greencity/annotations/ValidLanguage.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package greencity.annotations;

import static greencity.constant.ErrorMessage.SELECT_CORRECT_LANGUAGE;
import greencity.validator.LanguageValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import static greencity.constant.ErrorMessage.SELECT_CORRECT_LANGUAGE;

@Constraint(validatedBy = LanguageValidator.class)
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/greencity/config/MapperConfig.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package greencity.config;

import java.util.List;
import org.modelmapper.Converter;
import org.modelmapper.ModelMapper;
import org.modelmapper.config.Configuration.AccessLevel;
import org.modelmapper.convention.MatchingStrategies;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
public class MapperConfig {
/**
Expand Down
Loading

0 comments on commit b5b0090

Please sign in to comment.