Skip to content

Commit 8bb4c43

Browse files
iliyan-velichkovmibo
authored andcommitted
[OLINGO-1636] Upgrade Olingo ODataV2 to support JDK 17
add build.yml add workflows Signed-off-by: Iliyan Velichkov <[email protected]> change java from 1.6 to 1.8 Signed-off-by: Iliyan Velichkov <[email protected]> build with java 8 Signed-off-by: Iliyan Velichkov <[email protected]> skip tests in workflows Signed-off-by: Iliyan Velichkov <[email protected]> fix compilation Signed-off-by: Iliyan Velichkov <[email protected]> set version 3.0.0-SNAPSHOT Signed-off-by: Iliyan Velichkov <[email protected]> enable tests execution Signed-off-by: Iliyan Velichkov <[email protected]> add release workflow Signed-off-by: Iliyan Velichkov <[email protected]> update release.yml Signed-off-by: Iliyan Velichkov <[email protected]> version set to 3.0.1 for release version set to 3.0.2-SNAPSHOT for development deploy jars Signed-off-by: Iliyan Velichkov <[email protected]> add distributionManagement Signed-off-by: Iliyan Velichkov <[email protected]> change job name Signed-off-by: Iliyan Velichkov <[email protected]> version set to 3.0.2 for release version set to 3.0.3-SNAPSHOT for development make olingo compatible with Spring Boot 3 Signed-off-by: Iliyan Velichkov <[email protected]> use java 8 Signed-off-by: Iliyan Velichkov <[email protected]> use java 11 Signed-off-by: Iliyan Velichkov <[email protected]> use java 17 Signed-off-by: Iliyan Velichkov <[email protected]> javax.ws.rs -> jakarta.ws.rs Signed-off-by: Iliyan Velichkov <[email protected]> adapt tests Signed-off-by: Iliyan Velichkov <[email protected]> more test adaptations Signed-off-by: Iliyan Velichkov <[email protected]> adapt test Signed-off-by: Iliyan Velichkov <[email protected]> fix docs Signed-off-by: Iliyan Velichkov <[email protected]> adapt tests Signed-off-by: Iliyan Velichkov <[email protected]> more adaptations Signed-off-by: Iliyan Velichkov <[email protected]> [OLINGO-1636] adapts tests Signed-off-by: Iliyan Velichkov <[email protected]>
1 parent c31a2ca commit 8bb4c43

File tree

231 files changed

+14960
-15064
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+14960
-15064
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- master
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0
14+
- name: Cache local Maven repository
15+
uses: actions/cache@v3
16+
with:
17+
path: ~/.m2/repository
18+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
19+
restore-keys: ${{ runner.os }}-maven-
20+
- name: Set up JDK Corretto
21+
uses: actions/setup-java@v3
22+
with:
23+
distribution: 'corretto'
24+
java-version: '17'
25+
architecture: x64
26+
- name: Maven Build
27+
run: mvn clean install
28+

.github/workflows/maven.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424

2525
steps:
2626
- uses: actions/checkout@v3
27-
- name: Set up JDK 8 (Corretto)
27+
- name: Set up JDK (Corretto)
2828
uses: actions/setup-java@v3
2929
with:
30-
java-version: '8'
30+
java-version: '17'
3131
distribution: 'corretto'
3232
cache: maven
3333
- name: Build with Maven

.github/workflows/pull-request.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Pull Request
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- master
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
jobs:
12+
build:
13+
runs-on: ${{ matrix.os }}-latest
14+
strategy:
15+
matrix:
16+
os: [ubuntu, windows]
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
- name: Cache local Maven repository
22+
uses: actions/cache@v3
23+
with:
24+
path: ~/.m2/repository
25+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
26+
restore-keys: ${{ runner.os }}-maven-
27+
- name: Set up JDK Corretto
28+
uses: actions/setup-java@v3
29+
with:
30+
distribution: 'corretto'
31+
java-version: 17
32+
- name: Maven Build
33+
run: mvn clean install

.github/workflows/release.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
releaseVersion:
7+
description: Release Version
8+
required: true
9+
default: 3.0.0
10+
snapshotVersion:
11+
description: Snapshot Version
12+
required: true
13+
default: 3.0.1-SNAPSHOT
14+
15+
run-name: 'version set to ${{ github.event.inputs.releaseVersion }} for release'
16+
17+
jobs:
18+
release-project:
19+
runs-on: ubuntu-latest
20+
steps:
21+
22+
- uses: actions/checkout@v3
23+
with:
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
fetch-depth: 0
26+
27+
- name: Cache local Maven repository
28+
uses: actions/cache@v3
29+
with:
30+
path: ~/.m2/repository
31+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
32+
restore-keys: ${{ runner.os }}-maven-
33+
34+
- name: Set up JDK Corretto
35+
uses: actions/setup-java@v3
36+
with:
37+
distribution: 'corretto'
38+
java-version: '17'
39+
architecture: x64
40+
41+
- name: "Configure Git"
42+
run: |
43+
git fetch
44+
git checkout ${{ github.event.inputs.branch }}
45+
git config user.name "$GITHUB_ACTOR"
46+
git config user.email "[email protected]"
47+
48+
- name: "Maven: Set Release Version"
49+
run: mvn versions:set -DnewVersion=${{ github.event.inputs.releaseVersion }}
50+
51+
- name: Setup Maven settings.xml
52+
uses: whelk-io/maven-settings-xml-action@v11
53+
with:
54+
servers:
55+
'[
56+
{
57+
"id": "github",
58+
"username": "${env.GITHUB_USERNAME}",
59+
"password": "${env.GITHUB_TOKEN}"
60+
}
61+
]'
62+
63+
- name: Build Project
64+
run: mvn clean install
65+
66+
- name: Publish to GitHub Packages Apache Maven
67+
run: mvn deploy
68+
env:
69+
GITHUB_USERNAME: x-access-token
70+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
71+
BUILD_ENV: 'github-actions'
72+
73+
- name: "Git: Commit Release Version"
74+
run: |
75+
git add '**pom.xml'
76+
git commit -m "version set to ${{ github.event.inputs.releaseVersion }} for release"
77+
78+
- name: "Maven: Set Snapshot Version"
79+
run: mvn versions:set -DnewVersion=${{ github.event.inputs.snapshotVersion }}
80+
81+
- name: "Git: Commit Snapshot Version"
82+
run: |
83+
git add '**pom.xml'
84+
git commit -m "version set to ${{ github.event.inputs.snapshotVersion }} for development"
85+
86+
- name: Create Release
87+
id: create_release
88+
uses: actions/create-release@v1
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
91+
with:
92+
tag_name: ${{ github.event.inputs.releaseVersion }}
93+
release_name: Release ${{ github.event.inputs.releaseVersion }}
94+
body: |
95+
Changes in this Release:
96+
- First Change
97+
- Second Change
98+
draft: false
99+
prerelease: false
100+
101+
- name: "Git: Push Changes"
102+
run: |
103+
git checkout -B ${{ github.event.inputs.releaseVersion }}
104+
git push --set-upstream origin ${{ github.event.inputs.releaseVersion }}
105+
git checkout -B master
106+
git push --set-upstream origin master

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ classes
99
.DS_Store
1010
nb-configuration.xml
1111
context.xml
12+
*.versionsBackup

odata2-annotation-processor/annotation-processor-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<parent>
2626
<groupId>org.apache.olingo</groupId>
2727
<artifactId>olingo-odata2-annotation-processor</artifactId>
28-
<version>2.0.13</version>
28+
<version>3.0.0-RC01</version>
2929
<relativePath>..</relativePath>
3030
</parent>
3131

odata2-annotation-processor/annotation-processor-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<groupId>org.apache.olingo</groupId>
2222
<artifactId>olingo-odata2-annotation-processor</artifactId>
23-
<version>2.0.13</version>
23+
<version>3.0.0-RC01</version>
2424
<relativePath>..</relativePath>
2525
</parent>
2626

odata2-annotation-processor/annotation-processor-ref/pom.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<groupId>org.apache.olingo</groupId>
2222
<artifactId>olingo-odata2-annotation-processor</artifactId>
23-
<version>2.0.13</version>
23+
<version>3.0.0-RC01</version>
2424
<relativePath>..</relativePath>
2525
</parent>
2626

@@ -90,7 +90,6 @@
9090
<dependency>
9191
<groupId>org.slf4j</groupId>
9292
<artifactId>slf4j-log4j12</artifactId>
93-
<version>${slf4j.version}</version>
9493
</dependency>
9594
<!-- Test dependencies -->
9695
<dependency>
@@ -102,7 +101,6 @@
102101
<dependency>
103102
<groupId>xmlunit</groupId>
104103
<artifactId>xmlunit</artifactId>
105-
<version>${xmlunit.version}</version>
106104
<scope>test</scope>
107105
</dependency>
108106
</dependencies>
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
/*******************************************************************************
2-
* Licensed to the Apache Software Foundation (ASF) under one
3-
* or more contributor license agreements. See the NOTICE file
4-
* distributed with this work for additional information
5-
* regarding copyright ownership. The ASF licenses this file
6-
* to you under the Apache License, Version 2.0 (the
7-
* "License"); you may not use this file except in compliance
8-
* with the License. You may obtain a copy of the License at
9-
*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
3+
* agreements. See the NOTICE file distributed with this work for additional information regarding
4+
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
5+
* "License"); you may not use this file except in compliance with the License. You may obtain a
6+
* copy of the License at
7+
*
108
* http://www.apache.org/licenses/LICENSE-2.0
11-
*
12-
* Unless required by applicable law or agreed to in writing,
13-
* software distributed under the License is distributed on an
14-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15-
* KIND, either express or implied. See the License for the
16-
* specific language governing permissions and limitations
17-
* under the License.
9+
*
10+
* Unless required by applicable law or agreed to in writing, software distributed under the License
11+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
* or implied. See the License for the specific language governing permissions and limitations under
13+
* the License.
1814
******************************************************************************/
1915
package org.apache.olingo.odata2.annotation.processor.ref.model;
2016

@@ -23,74 +19,76 @@
2319
import java.io.ByteArrayOutputStream;
2420
import java.io.IOException;
2521
import java.io.InputStream;
26-
2722
import javax.imageio.ImageIO;
2823

2924
/**
3025
*
3126
*/
3227
public class ResourceHelper {
3328

34-
public static byte[] loadAsByte(final String resource) {
35-
return load(resource, new byte[0]);
36-
}
37-
38-
public static byte[] load(final String resource, final byte[] defaultResult) {
39-
InputStream instream = null;
40-
try {
41-
instream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
42-
if (instream == null) {
43-
return defaultResult;
44-
}
45-
ByteArrayOutputStream stream = new ByteArrayOutputStream();
46-
int b = 0;
47-
while ((b = instream.read()) != -1) {
48-
stream.write(b);
49-
}
29+
public static byte[] loadAsByte(final String resource) {
30+
return load(resource, new byte[0]);
31+
}
5032

51-
return stream.toByteArray();
52-
} catch (IOException e) {
53-
throw new RuntimeException(e);
54-
} finally {
55-
if (instream != null) {
33+
public static byte[] load(final String resource, final byte[] defaultResult) {
34+
InputStream instream = null;
5635
try {
57-
instream.close();
58-
} catch (IOException ex) {}
59-
}
36+
instream = Thread.currentThread()
37+
.getContextClassLoader()
38+
.getResourceAsStream(resource);
39+
if (instream == null) {
40+
return defaultResult;
41+
}
42+
ByteArrayOutputStream stream = new ByteArrayOutputStream();
43+
int b = 0;
44+
while ((b = instream.read()) != -1) {
45+
stream.write(b);
46+
}
47+
48+
return stream.toByteArray();
49+
} catch (IOException e) {
50+
throw new RuntimeException(e);
51+
} finally {
52+
if (instream != null) {
53+
try {
54+
instream.close();
55+
} catch (IOException ex) {
56+
}
57+
}
58+
}
59+
}
60+
61+
public enum Format {
62+
BMP, JPEG, PNG, GIF
6063
}
61-
}
6264

63-
public enum Format {
64-
BMP, JPEG, PNG, GIF
65-
};
65+
public static byte[] generateImage() {
66+
return generateImage(Format.PNG);
67+
}
6668

67-
public static byte[] generateImage() {
68-
return generateImage(Format.PNG);
69-
}
69+
public static byte[] generateImage(final Format format) {
70+
try {
71+
int width = 320;
72+
int height = 320;
73+
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY);
74+
WritableRaster raster = image.getRaster();
7075

71-
public static byte[] generateImage(final Format format) {
72-
try {
73-
int width = 320;
74-
int height = 320;
75-
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY);
76-
WritableRaster raster = image.getRaster();
76+
int mod = format.ordinal() + 2;
77+
for (int h = 0; h < height; h++) {
78+
for (int w = 0; w < width; w++) {
79+
if (((h / 32) + (w / 32)) % mod == 0) {
80+
raster.setSample(w, h, 0, 0);
81+
} else {
82+
raster.setSample(w, h, 0, 1);
83+
}
84+
}
85+
}
7786

78-
int mod = format.ordinal() + 2;
79-
for (int h = 0; h < height; h++) {
80-
for (int w = 0; w < width; w++) {
81-
if (((h / 32) + (w / 32)) % mod == 0) {
82-
raster.setSample(w, h, 0, 0);
83-
} else {
84-
raster.setSample(w, h, 0, 1);
85-
}
87+
ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
88+
ImageIO.write(image, format.name(), out);
89+
return out.toByteArray();
90+
} catch (IOException ex) {
91+
return new byte[0];
8692
}
87-
}
88-
89-
ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
90-
ImageIO.write(image, format.name(), out);
91-
return out.toByteArray();
92-
} catch (IOException ex) {
93-
return new byte[0];
9493
}
95-
}
9694
}

0 commit comments

Comments
 (0)