Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPMRPP-93073 migrate to Spring Boot 3 #36

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ jobs:
else
echo 'Verification failed, please check the bundle' 1>&2
exit 1
fi
fi
47 changes: 28 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'io.spring.dependency-management' version '1.1.6'
id 'java'
id 'java-library'
id 'org.owasp.dependencycheck' version '11.1.0'
id 'org.owasp.dependencycheck' version '11.1.1'
}

project.ext {
Expand All @@ -16,13 +16,15 @@ def scriptsUrl = 'https://raw.githubusercontent.com/reportportal/gradle-scripts/

apply from: scriptsUrl + '/release-commons.gradle'
apply from: scriptsUrl + '/signing.gradle'
//apply from: scriptsUrl + '/build-quality.gradle'
//apply from: scriptsUrl + '/build-quality.gradle' // TODO: fix scripts

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

ext['spring-boot.version'] = "${springBootVersion}"

repositories {
mavenCentral { url "https://repo1.maven.org/maven2" }
if (!releaseMode) {
Expand All @@ -32,49 +34,56 @@ repositories {

dependencyManagement {
imports {
mavenBom 'org.springframework.boot:spring-boot-dependencies:2.1.5.RELEASE'
mavenBom('com.epam.reportportal:commons-bom:5.12.3')
mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
mavenBom "com.epam.reportportal:commons-bom:5.12.3"
}
}

dependencies {
if (releaseMode) {
api 'com.epam.reportportal:commons-reporting:5.12.3'
} else {
api 'com.github.reportportal:commons-reporting:develop-SNAPSHOT'
api 'com.github.reportportal:commons-reporting:b997ee3'
}
api 'org.springframework:spring-webmvc'
api 'org.springframework.security:spring-security-core'
api 'org.apache.tika:tika-core'

implementation "org.springdoc:springdoc-openapi-data-rest:${sprindocAnnotationsVersion}"
api "org.springdoc:springdoc-openapi-starter-common:${springDocVersion}"
api "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
api "javax.validation:validation-api:${validationApiVersion}"
implementation "org.apache.commons:commons-lang3:${commonsLangVersion}"
implementation group: 'com.google.guava', name: 'guava', version: '28.2-jre'
implementation 'javax.servlet:javax.servlet-api'
api "org.apache.commons:commons-lang3:${commonsLangVersion}"
api "com.google.guava:guava:${guava}"
implementation 'jakarta.servlet:jakarta.servlet-api:6.1.0'
implementation "org.hibernate.validator:hibernate-validator:${hibernateValidatorVersion}"

implementation 'org.freemarker:freemarker'
implementation 'ch.qos.logback:logback-classic'
implementation 'net.coobird:thumbnailator:0.4.11'
implementation 'com.google.guava:guava'
implementation 'javax.inject:javax.inject:1'
implementation 'net.coobird:thumbnailator:0.4.20'
api 'jakarta.inject:jakarta.inject-api:2.0.1'

// add lombok support
compileOnly "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
testCompileOnly "org.projectlombok:lombok:${lombokVersion}"
testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}"

testImplementation "junit:junit:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
testImplementation "org.mockito:mockito-junit-jupiter:${mockitoJunitJupiter}"
testImplementation "org.hibernate.validator:hibernate-validator:${hibernateValidatorVersion}"
testImplementation "javax.el:javax.el-api:${elApiVersion}"
testImplementation "org.glassfish:javax.el:${elApiVersion}"
testImplementation "org.hamcrest:hamcrest:2.2"
testImplementation "org.glassfish:jakarta.el:4.0.2"
}

wrapper {
gradleVersion = '8.10'
test {
useJUnitPlatform()
testLogging {
events = ['failed']
exceptionFormat = 'short'
}
reports {
junitXml.required = true
}
}

tasks.preTagCommit.enabled = false
Expand Down
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
version=5.12.3
description=EPAM Report portal common libs
hibernateValidatorVersion=6.2.0.Final
validationApiVersion=2.0.1.Final
junitVersion=4.13.1
elApiVersion=3.0.0
sprindocAnnotationsVersion=1.7.0
commonsLangVersion=3.9
mockitoJunitJupiter=2.23.0
jacksonVersion=2.13.4.2
lombokVersion=1.18.30
hibernateValidatorVersion=8.0.1.Final
junitVersion=5.11.0
springBootVersion=3.4.0
springDocVersion=2.6.0
commonsLangVersion=3.17.0
mockitoJunitJupiter=5.14.2
jacksonVersion=2.18.0
lombokVersion=1.18.36
guava=33.2.1-jre
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
jdk:
- openjdk21
- openjdk21
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

package com.epam.reportportal.annotations;

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

/**
* Can be used with strings. Checks if string is blank.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

package com.epam.reportportal.annotations;

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

/**
* Can be used with collection of strings. Checks if collection contains only not blank elements.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

package com.epam.reportportal.annotations;

import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import java.util.Collection;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
* @author <a href="mailto:[email protected]">Ihar Kahadouski</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.epam.reportportal.annotations;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

/**
* @author <a href="mailto:[email protected]">Ihar Kahadouski</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

package com.epam.reportportal.annotations;

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

@Constraint(validatedBy = {NotNullMapValueValidator.class})
@Target({ElementType.FIELD})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

package com.epam.reportportal.annotations;

import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import java.util.Map;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class NotNullMapValueValidator implements ConstraintValidator<NotNullMapValue, Map<?, ?>> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import com.google.common.base.Preconditions;
import freemarker.template.TemplateExceptionHandler;
import freemarker.template.Version;
import jakarta.inject.Provider;
import java.util.Locale;
import javax.inject.Provider;

/**
* Factory bean for {@link TemplateEngine}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import jakarta.validation.constraints.NotNull;
import java.time.Instant;
import javax.validation.constraints.NotNull;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
Expand Down
20 changes: 7 additions & 13 deletions src/main/java/com/epam/reportportal/model/EntryCreatedRS.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,28 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
* Response when some entry has been created and we need to return ID
*
* @author Andrei Varabyeu
*/
@Setter
@Getter
@JsonInclude(Include.NON_NULL)
@NoArgsConstructor
public class EntryCreatedRS {

@JsonProperty("id")
private Long id;

public EntryCreatedRS() {

}

public EntryCreatedRS(Long id) {
this.id = id;
}

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("EntryCreatedRS{");
Expand All @@ -55,4 +49,4 @@ public String toString() {
return sb.toString();
}

}
}
27 changes: 3 additions & 24 deletions src/main/java/com/epam/reportportal/model/Page.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@

import java.util.Collection;
import java.util.Iterator;
import lombok.Getter;

/**
* Paged response representation Re-implementation of Spring's HATEAOS Page implementation to get
* rid of Spring's deps in model package
*
* @author Andrei Varabyeu
*/
@Getter
public class Page<T> implements Iterable<T> {

private final Collection<T> content;
Expand Down Expand Up @@ -52,19 +54,12 @@ public Page(Collection<T> content, long size, long number, long totalElements) {
this.page = new PageMetadata(size, number, totalElements);
}

public Collection<T> getContent() {
return content;
}

public PageMetadata getPage() {
return page;
}

@Override
public Iterator<T> iterator() {
return content.iterator();
}

@Getter
public static class PageMetadata {

long number;
Expand Down Expand Up @@ -96,22 +91,6 @@ public PageMetadata(long size, long number, long totalElements) {
size == 0 ? 0 : (long) Math.ceil((double) totalElements / (double) size));
}

public long getNumber() {
return number;
}

public long getSize() {
return size;
}

public long getTotalElements() {
return totalElements;
}

public long getTotalPages() {
return totalPages;
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("PageMetadata{");
Expand Down
Loading
Loading