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

migration to java 21 #40

Merged
Merged
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
61 changes: 16 additions & 45 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,26 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This is the template for the all of the JAVA VIP projects workflow CI integration

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven
name: VIP CI Integration
env: # beware env value are of string type, not boolean. Need to use fromJSON to convert them to boolean
isProduction: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
prepareRelease: ${{ github.event_name == 'push' && github.ref_name == 'develop' && contains(github.event.head_commit.message, 'prepare release') }}

on:
push:
branches: [ develop, master ]
paths-ignore:
- 'README.md'
branches: [develop, master]
pull_request:
branches: develop
env: # beware env value are of string type, not boolean. Need to use fromJSON to convert them to boolean
isProduction: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
prepareRelease: ${{ github.event_name == 'push' && github.ref_name == 'develop' && contains(github.event.head_commit.message, 'prepare release') }}
branches: [develop]

jobs:
build:
all:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
server-id: ${{ (fromJSON(env.isProduction) && 'creatis-releases') || 'creatis-snapshots' }}
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Build with Maven
# deploy only for pushes on develop and master, et verify for PRs
run: mvn -B clean ${{ env.mavenTarget }}
env:
MAVEN_USERNAME: github
MAVEN_PASSWORD: ${{ secrets.NEXUS_PSW }}
mavenTarget: ${{ github.event_name == 'push' && ! fromJSON(env.prepareRelease) && 'deploy' || 'verify' }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
with:
commit: ${{github.event.workflow_run.head_sha}}
report_paths: '**/target/*-reports/TEST-*.xml'
detailed_summary: true
include_passed: true
- name: Review Code
uses: virtual-imaging-platform/vip-github-actions/.github/actions/pmd@develop
with:
quality: 95

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/[email protected]
if: github.event_name != 'pull_request'
- name: Maven
uses: virtual-imaging-platform/vip-github-actions/.github/actions/maven@develop
with:
maven_password: ${{ secrets.NEXUS_PSW }}
2 changes: 0 additions & 2 deletions grida-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
</build>

<dependencies>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand All @@ -58,6 +57,5 @@
<artifactId>commons-cli</artifactId>
<version>1.4</version>
</dependency>

</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ public List<GridData> getFolderData(String dir, boolean refresh) throws GRIDACli

} else {
if(d.length == 7)
filesList.add(new GridData(d[0], GridData.Type.File, new Long(d[2]), d[3], d[4], d[5],d[6]));
filesList.add(new GridData(d[0], GridData.Type.File, Long.valueOf(d[2]), d[3], d[4], d[5],d[6]));
else
filesList.add(new GridData(d[0], GridData.Type.File, new Long(d[2]), d[3], d[4], d[5],""));
filesList.add(new GridData(d[0], GridData.Type.File, Long.valueOf(d[2]), d[3], d[4], d[5],""));
}
}
}
Expand Down Expand Up @@ -215,7 +215,7 @@ public List<Long> getModificationDate(List<String> filesList) throws GRIDAClient

List<Long> datesList = new ArrayList<Long>();
for (String date : dates.split(Constants.MSG_SEP_1)) {
datesList.add(new Long(date));
datesList.add(Long.valueOf(date));
}

return datesList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,9 @@ private Operation parseOperation(String data) {

String[] operation = data.split(Constants.MSG_SEP_2);
return new Operation(
operation[0], new Date(new Long(operation[1])), operation[2],
operation[0], new Date(Long.valueOf(operation[1])), operation[2],
operation[3], Type.valueOf(operation[4]),
Status.valueOf(operation[5]), operation[6],
new Double(operation[7]), new Integer(operation[8]));
Double.valueOf(operation[7]), Integer.valueOf(operation[8]));
}
}
6 changes: 0 additions & 6 deletions grida-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@
<artifactId>log4j-api</artifactId>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.10.0</version>
</dependency>
-->
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,8 @@ private void createCachePath() {

private boolean isBinaryAvailable(String name, String envFile) {
boolean isAvailable = false;

try {
String command = envFile == null
? "which"
: "source " + envFile + "; which";

ProcessBuilder builder = envFile == null
? new ProcessBuilder("which", name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public PoolLimitedOperationsByDateCommand(Communication communication,
super(communication, proxyFileName);

this.user = user;
this.limit = new Integer(limitString);
this.startDate = new Date(new Long(dateString));
this.limit = Integer.valueOf(limitString);
this.startDate = new Date(Long.valueOf(dateString));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,16 @@ private GridData parseLine(String line)

Long length = null;
try {
length = new Long(tokens[INDEX_SIZE]);
length = Long.valueOf(tokens[INDEX_SIZE]);
} catch (java.lang.NumberFormatException e) {
logger.warn(
"Cannot parse long: \"" + tokens[INDEX_SIZE] +
"\". Setting file length to 0");
length = new Long(0);
length = Long.valueOf(0);
} catch (java.lang.ArrayIndexOutOfBoundsException e) {
logger.warn(
"Cannot get long. Setting file length to 0");
length = new Long(0);
length = Long.valueOf(0);
}

String comment = "";
Expand Down
3 changes: 0 additions & 3 deletions grida-standalone/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
-->

<dependencies>

<dependency>
<groupId>fr.insalyon.creatis</groupId>
<artifactId>grida-client</artifactId>
Expand All @@ -28,7 +27,6 @@
<artifactId>grida-server</artifactId>
<version>${project.version}</version>
</dependency>

</dependencies>

<build>
Expand Down Expand Up @@ -58,5 +56,4 @@
</plugin>
</plugins>
</build>

</project>
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
</properties>

<repositories>
Expand All @@ -56,6 +56,5 @@
<name>Internal Snapshots</name>
<url>https://vip.creatis.insa-lyon.fr:9007/nexus/repository/snapshots</url>
</snapshotRepository>

</distributionManagement>
</project>
Loading