From 70edebd712e3d75b9f01e7bd9a0b8a90090d46b9 Mon Sep 17 00:00:00 2001 From: "Yen, David (398B-Affiliate)" Date: Mon, 9 Oct 2023 17:25:18 -0700 Subject: [PATCH] java17 Sonar and Jacoco --- CHANGELOG.md | 3 + README.md | 11 ++- build.gradle | 6 +- pom.xml | 220 +++++++++++++++++++++++++++++++++------------------ 4 files changed, 160 insertions(+), 80 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbdfebc..c69c776 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # [Unreleased] ### Added ### Changed +- **PODAAC-xxxx** + - Support java 17 + - SonarQube and Jacoco report ### Deprecated ### Removed ### Fixed diff --git a/README.md b/README.md index 2638dbf..2f7dc84 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,18 @@ ## Installation -To build the Lambda code: +To build the Lambda code, Refer to following Confluence page: +https://wiki.jpl.nasa.gov/pages/viewpage.action?spaceKey=PD&title=SonarQube%2C+Jacoco+and+Java+17+upgrade ```shell +* Build with sonarQube and Jacoco report +mvn clean verify sonar:sonar \ + -Dsonar.projectKey=cnm-response-opensource \ + -Dsonar.projectName='cnm-response-opensource' \ + -Dsonar.host.url=http://localhost:9000 \ + -Dsonar.token=sqp_fc2271c4ddba6507fb38ea64d52e6912e2c6e14d + +* Makde sure using java 17 and gradle 8.3 mvn clean dependency:copy-dependencies gradle build ``` diff --git a/build.gradle b/build.gradle index e81d8ac..897f4c1 100755 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'java' -sourceCompatibility = 1.8 -targetCompatibility = 1.8 +sourceCompatibility = 1.17 +targetCompatibility = 1.17 dependencies { implementation fileTree(dir: 'target/dependency/', include: '*.jar') @@ -13,7 +13,7 @@ task buildZip(type: Zip) { into('lib') { from configurations.runtimeClasspath } - archiveName 'cnmResponse.zip' + archiveFileName.set('cnmResponse.zip') } build.dependsOn buildZip \ No newline at end of file diff --git a/pom.xml b/pom.xml index 2452fa8..e5152f2 100755 --- a/pom.xml +++ b/pom.xml @@ -1,84 +1,152 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - gov.nasa.cumulus - cnm-response - 2.1.1-alpha.1-SNAPSHOT - jar + gov.nasa.cumulus + cnm-response + 2.1.1-alpha.1-SNAPSHOT + jar - cnm-response - http://maven.apache.org + cnm-response + http://maven.apache.org - - UTF-8 - + + UTF-8 + - - - clojars.org - https://repo.clojars.org - - + + + clojars.org + https://repo.clojars.org + + - + - - - com.amazonaws - aws-java-sdk-core - 1.12.209 - - - - com.amazonaws - amazon-kinesis-client - 1.14.8 - - - - com.amazonaws - aws-java-sdk-sns - 1.12.209 - - - - com.google.code.gson - gson - 2.9.0 - - - gov.nasa.earthdata - cumulus-message-adapter - 1.3.9 - - - - com.amazonaws - aws-java-sdk-kinesis - 1.12.209 - - - commons-io - commons-io - 2.11.0 - - - com.amazonaws - aws-lambda-java-core - 1.2.1 - - - junit - junit - 3.8.1 - test - - - org.mockito - mockito-core - 3.6.0 - test - - + + + com.amazonaws + aws-java-sdk-core + 1.12.565 + + + + com.amazonaws + aws-java-sdk-kinesis + 1.12.565 + + + + com.amazonaws + amazon-kinesis-client + 1.15.0 + + + + com.amazonaws + aws-java-sdk-sns + 1.12.565 + + + + com.google.code.gson + gson + 2.9.0 + + + gov.nasa.earthdata + cumulus-message-adapter + 2.0.0 + + + commons-io + commons-io + 2.11.0 + + + com.amazonaws + aws-lambda-java-core + 1.2.1 + + + junit + junit + 3.8.1 + test + + + org.mockito + mockito-core + 3.6.0 + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 17 + 17 + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.1 + + + package + + shade + + + + + org.wordinator.xml2docx.MakeDocx + + true + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.7 + + + prepare-agent + + prepare-agent + + + + report + + report + + + + XML + + + + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + 3.10.0.2594 + + + \ No newline at end of file