Skip to content

Commit

Permalink
EPMRPP-97485 || Update to java 21 (#72)
Browse files Browse the repository at this point in the history
* EPMRPP-97485 || Update to java 21

Co-authored-by: siarhei_hrabko <[email protected]>
  • Loading branch information
APiankouski and grabsefx authored Dec 17, 2024
1 parent fdcf491 commit 8839492
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 78 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
java-version: '21'

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/manually-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
java-version: '21'

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
java-version: '21'

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
81 changes: 36 additions & 45 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
import com.github.spotbugs.SpotBugsTask

plugins {
id "io.spring.dependency-management" version "1.0.9.RELEASE"
id "io.spring.dependency-management" version "1.1.4"
id 'java'
id 'jacoco'
id "com.github.spotbugs" version "3.0.0"
id "com.github.node-gradle.node" version "2.2.1"
id 'nu.studer.jooq' version '3.0.3'
}

apply from: 'project-properties.gradle'

def scriptsUrl = 'https://raw.githubusercontent.com/reportportal/gradle-scripts/' +
(releaseMode ? getProperty('scripts.version') : 'develop')

apply from: 'jooq.gradle'
apply from: 'ui.gradle'
apply from: scriptsUrl + '/release-fat.gradle'
apply from: scriptsUrl + '/signing.gradle'
Expand All @@ -35,47 +30,29 @@ dependencyManagement {
}

dependencies {
// ALL new dependencies should be included in shadowJar plugin!
// transitive dependencies may be required as well. could be checked in runtime only!
if (releaseMode) {
implementation 'com.epam.reportportal:commons-dao'
implementation 'com.epam.reportportal:plugin-api'
annotationProcessor 'com.epam.reportportal:plugin-api'
} else {
implementation 'com.github.reportportal:commons-dao:acf1ec7'
implementation 'com.github.reportportal:plugin-api:188792e'
annotationProcessor 'com.github.reportportal:plugin-api:188792e'
implementation 'com.github.reportportal:commons-dao:8dcc514'
implementation 'com.github.reportportal:plugin-api:815c74a'
annotationProcessor 'com.github.reportportal:plugin-api:815c74a'
}
implementation 'org.hibernate:hibernate-core:5.6.15.Final'

implementation group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.1'
implementation group: 'org.jooq', name: 'jooq', version: '3.14.4'
jooqRuntime 'org.postgresql:postgresql:42.7.3'

compile 'ch.qos.logback:logback-classic:1.2.3'
compile 'org.slf4j:slf4j-api:1.7.25'

compile 'io.atlassian.fugue:fugue:4.7.2'
compile 'com.atlassian.jira:jira-rest-java-client-core:5.2.1'

testImplementation('org.junit.jupiter:junit-jupiter:5.6.0')
implementation("com.atlassian.jira:jira-rest-java-client-core:6.0.1")
implementation "io.atlassian.fugue:fugue:6.0.1"

}

spotbugs {
sourceSets = [sourceSets.main]
reportLevel = "high"
}
tasks.withType(SpotBugsTask) {
reports {
xml.enabled false
html.enabled true
}
testImplementation('org.junit.jupiter:junit-jupiter:5.11.0')
}

test {
useJUnitPlatform()
jacocoTestReport {
reports {
xml.enabled true
xml.required = true
}
}
}
Expand Down Expand Up @@ -106,7 +83,7 @@ jar {
}
manifest {
attributes(
"Class-Path": configurations.compile.collect { it.getName() }.join(' '),
"Class-Path": configurations.compileClasspath.collect { it.getName() }.join(' '),
"Plugin-Id": "${pluginId}",
"Plugin-Version": "${project.version}",
"Plugin-Provider": "Report Portal",
Expand All @@ -124,17 +101,31 @@ shadowJar {
from("ui/build") {
into("/resources")
}
configurations = [project.configurations.compile]
configurations = [project.configurations.compileClasspath]
zip64 true
dependencies {
exclude(dependency('com.github.reportportal:'))
exclude(dependency('com.epam.reportportal:'))
exclude(dependency('org.springframework:'))
exclude(dependency('org.springframework.security:'))
exclude(dependency('org.springframework.data:'))
exclude(dependency('org.springframework.boot:'))
exclude(dependency('ch.qos.logback:'))
exclude(dependency('org.slf4j:'))
include(dependency("com.atlassian.jira:jira-rest-java-client-api:.*"))
include(dependency("com.atlassian.jira:jira-rest-java-client-core:.*"))
include(dependency("com.atlassian.httpclient:atlassian-httpclient-api:.*"))
include(dependency("com.atlassian.httpclient:atlassian-httpclient-library:.*"))
include(dependency("com.atlassian.sal:sal-api:.*"))
include(dependency("com.atlassian.event:atlassian-event:.*"))
include(dependency("io.atlassian.util.concurrent:atlassian-util-concurrent:.*"))
include(dependency("io.atlassian.fugue:fugue:.*"))
include(dependency("org.apache.httpcomponents:httpasyncclient:.*"))
include(dependency("org.apache.httpcomponents:httpasyncclient-cache:.*"))
include(dependency("org.apache.httpcomponents:httpclient:.*"))
include(dependency("org.apache.httpcomponents:httpclient-cache:.*"))
include(dependency("org.apache.httpcomponents:httpcore:.*"))
include(dependency("org.apache.httpcomponents:httpcore-nio:.*"))
include(dependency("org.apache.httpcomponents:httpcore-mime:.*"))
include(dependency("org.glassfish.jersey.core:jersey-server:.*"))
include(dependency("org.glassfish.jersey.core:jersey-common:.*"))
include(dependency("jakarta.ws.rs:jakarta.ws.rs-api:.*"))
include(dependency("jakarta.annotation:jakarta.annotation-api:.*"))
include(dependency("org.glassfish.hk2.external:jakarta.inject:.*"))
include(dependency("org.glassfish.hk2:osgi-resource-locator:.*"))
include(dependency("org.glassfish.jaxb:jaxb-runtime:.*"))
}
}

Expand All @@ -144,9 +135,9 @@ task plugin(type: Jar) {
with jar
}
into('lib') {
from configurations.compile
from configurations.compileClasspath
}
extension('zip')
archiveExtension.set('zip')
}

task assemblePlugin(type: Copy) {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 4 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Fri Mar 13 14:15:13 MSK 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 1 addition & 7 deletions jooq.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
jooq {
version = '3.12.4'
edition = 'OSS'
sample(sourceSets.main) {
configuration {
jdbc {
driver = 'org.postgresql.Driver'
url = 'jdbc:postgresql://localhost:5432/reportportal'
Expand Down Expand Up @@ -33,8 +31,4 @@ jooq {
}
}
}
}

generateSampleJooqSchemaSource {
enabled = false
}
10 changes: 4 additions & 6 deletions project-properties.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

project.ext {
publishRepo = "https://maven.pkg.github.com/reportportal/plugin-bts-jira-cloud"
dependencyRepos = ["plugin-api", "commons-bom"]
releaseMode = project.hasProperty("releaseMode")
pluginsDir = "$buildDir/plugins"
}

wrapper {
gradleVersion = '5.4.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
import com.epam.reportportal.extension.jira.command.GetIssueTypesCommand;
import com.epam.reportportal.extension.jira.command.PostTicketCommand;
import com.epam.reportportal.extension.jira.command.RetrieveCreationParamsCommand;
import com.epam.reportportal.extension.jira.command.RetrieveUpdateParamsCommand;
import com.epam.reportportal.extension.jira.command.UserSearchCommand;
import com.epam.reportportal.extension.jira.command.atlassian.CloudJiraClientProviderExtended;
import com.epam.reportportal.extension.jira.command.RetrieveUpdateParamsCommand;
import com.epam.reportportal.extension.jira.command.connection.TestConnectionCommand;
import com.epam.reportportal.extension.jira.command.utils.CloudJiraClientProvider;
import com.epam.reportportal.extension.jira.command.utils.JIRATicketDescriptionService;
Expand Down Expand Up @@ -62,7 +62,6 @@
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import org.jasypt.util.text.BasicTextEncryptor;
import org.jooq.DSLContext;
import org.pf4j.Extension;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -77,7 +76,6 @@
*/
@Extension
public class CloudJiraExtension implements ReportPortalExtensionPoint, DisposableBean {

private static final String DOCUMENTATION_LINK_FIELD = "documentationLink";
private static final String DOCUMENTATION_LINK = "https://reportportal.io/docs/plugins/AtlassianJiraCloud";
public static final String BINARY_DATA_PROPERTIES_FILE_ID = "binary-data.properties";
Expand All @@ -104,10 +102,6 @@ public class CloudJiraExtension implements ReportPortalExtensionPoint, Disposabl

@Autowired
private ApplicationContext applicationContext;

@Autowired
private DSLContext dsl;

@Autowired
private IntegrationTypeRepository integrationTypeRepository;

Expand Down Expand Up @@ -174,6 +168,7 @@ protected ObjectMapper configureObjectMapper() {
params.put(ALLOWED_COMMANDS, new ArrayList<>(pluginCommandMapping.get().keySet()));
params.put(DOCUMENTATION_LINK_FIELD, DOCUMENTATION_LINK);
params.put(COMMON_COMMANDS, new ArrayList<>(commonPluginCommandMapping.get().keySet()));
initListeners();
return params;
}

Expand All @@ -192,10 +187,10 @@ public IntegrationGroupEnum getIntegrationGroup() {
return IntegrationGroupEnum.BTS;
}

@PostConstruct
public void createIntegration() {
initListeners();
}
// @PostConstruct
// public void createIntegration() {
// initListeners();
// }

private void initListeners() {
ApplicationEventMulticaster applicationEventMulticaster = applicationContext.getBean(
Expand Down

0 comments on commit 8839492

Please sign in to comment.