Skip to content

Commit d7ca05e

Browse files
Build: drop EL7 support, support JRE17 for packages and sonar check (#8609)
This PR fixes the issue with sonar check ``` Error: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project cloudstack: Error: Error: The version of Java (11.0.22) used to run this analysis is deprecated, and SonarCloud no longer supports it. Please upgrade to Java 17 or later. Error: You can find more information here: https://docs.sonarsource.com/sonarcloud/appendices/scanner-environment/ ``` main changes - Support build/packaging using JDK17 - Still supports JDK11 for building - Support JRE17 for use in production installation - Drop EL7 support The community packages will be still packaged using JDK11. If uses want, they can build by JDK17 as well. Signed-off-by: Wei Zhou <[email protected]> Signed-off-by: Rohit Yadav <[email protected]> Co-authored-by: Rohit Yadav <[email protected]>
1 parent b61c3b8 commit d7ca05e

File tree

44 files changed

+195
-1147
lines changed

Some content is hidden

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

44 files changed

+195
-1147
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Set up Python
4444
uses: actions/setup-python@v5
4545
with:
46-
python-version: '3.8'
46+
python-version: '3.10'
4747
architecture: 'x64'
4848

4949
- name: Install Build Dependencies

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ jobs:
226226
- name: Set up Python
227227
uses: actions/setup-python@v5
228228
with:
229-
python-version: '3.8'
229+
python-version: '3.10'
230230
architecture: 'x64'
231231

232232
- name: Install Build Dependencies
@@ -284,7 +284,7 @@ jobs:
284284
285285
- name: Start CloudStack Management Server with Simulator
286286
run: |
287-
export MAVEN_OPTS="-Xmx4096m -XX:MaxPermSize=800m -Djava.security.egd=file:/dev/urandom -javaagent:jacoco/lib/jacocoagent.jar=address=*,port=36320,output=tcpserver"
287+
export MAVEN_OPTS="-Xmx4096m -XX:MaxMetaspaceSize=800m -Djava.security.egd=file:/dev/urandom -javaagent:jacoco/lib/jacocoagent.jar=address=*,port=36320,output=tcpserver --add-opens=java.base/java.lang=ALL-UNNAMED --add-exports=java.base/sun.security.x509=ALL-UNNAMED --add-opens=java.base/jdk.internal.reflect=ALL-UNNAMED"
288288
echo -e "\nStarting simulator"
289289
set +e
290290
mvn -Dsimulator -Dorg.eclipse.jetty.annotations.maxWait=120 -pl :cloud-client-ui jetty:run 2>&1 > /tmp/jetty-log || true &

.github/workflows/codecov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636
with:
3737
fetch-depth: 0
3838

39-
- name: Set up JDK11
39+
- name: Set up JDK 17
4040
uses: actions/setup-java@v4
4141
with:
4242
distribution: 'temurin'
43-
java-version: '11'
43+
java-version: '17'
4444
cache: 'maven'
4545

4646
- name: Build CloudStack with Quality Checks

.github/workflows/main-sonar-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636
with:
3737
fetch-depth: 0
3838

39-
- name: Set up JDK11
39+
- name: Set up JDK17
4040
uses: actions/setup-java@v4
4141
with:
4242
distribution: 'temurin'
43-
java-version: '11'
43+
java-version: '17'
4444
cache: 'maven'
4545

4646
- name: Cache SonarCloud packages

.github/workflows/rat.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ jobs:
3131
runs-on: ubuntu-22.04
3232
steps:
3333
- uses: actions/checkout@v4
34-
- name: Set up JDK 11
34+
- name: Set up JDK 17
3535
uses: actions/setup-java@v4
3636
with:
37-
java-version: '11'
37+
java-version: '17'
3838
distribution: 'adopt'
3939
architecture: x64
4040
cache: maven

.github/workflows/sonar-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838
ref: "refs/pull/${{ github.event.number }}/merge"
3939
fetch-depth: 0
4040

41-
- name: Set up JDK11
41+
- name: Set up JDK17
4242
uses: actions/setup-java@v4
4343
with:
4444
distribution: 'temurin'
45-
java-version: '11'
45+
java-version: '17'
4646
cache: 'maven'
4747

4848
- name: Cache SonarCloud packages

.github/workflows/ui.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Set up Node
3737
uses: actions/setup-node@v3
3838
with:
39-
node-version: 14
39+
node-version: 16
4040

4141
- name: Env details
4242
run: |

INSTALL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Clear old database (if any) and deploy the database schema:
7878

7979
Export the following variable if you need to run and debug the management server:
8080

81-
$ export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=500m -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
81+
$ export MAVEN_OPTS="-Xmx1024m -XX:MaxMetaspaceSize=500m -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
8282

8383
Start the management server:
8484

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Source: cloudstack
22
Section: libs
33
Priority: extra
44
Maintainer: Wido den Hollander <[email protected]>
5-
Build-Depends: debhelper (>= 9), openjdk-11-jdk | java11-sdk | java11-jdk | zulu-11, genisoimage,
5+
Build-Depends: debhelper (>= 9), openjdk-17-jdk | java17-sdk | java17-jdk | zulu-17 | openjdk-11-jdk | java11-sdk | java11-jdk | zulu-11, genisoimage,
66
python-mysql.connector | python3-mysql.connector, maven (>= 3) | maven3,
77
python (>= 2.7) | python2 (>= 2.7), python3 (>= 3), python-setuptools, python3-setuptools,
88
nodejs (>= 12), lsb-release, dh-systemd | debhelper (>= 13)

developer/pom.xml

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
<version>4.20.0.0-SNAPSHOT</version>
2929
</parent>
3030
<dependencies>
31+
<dependency>
32+
<groupId>com.mysql</groupId>
33+
<artifactId>mysql-connector-j</artifactId>
34+
<version>${cs.mysql.version}</version>
35+
<scope>compile</scope>
36+
</dependency>
3137
<dependency>
3238
<groupId>org.apache.commons</groupId>
3339
<artifactId>commons-dbcp2</artifactId>
@@ -108,28 +114,25 @@
108114
<plugin>
109115
<groupId>org.codehaus.mojo</groupId>
110116
<artifactId>exec-maven-plugin</artifactId>
111-
<version>1.2.1</version>
112-
<dependencies>
113-
<!-- specify the dependent jdbc driver here -->
114-
<dependency>
115-
<groupId>com.mysql</groupId>
116-
<artifactId>mysql-connector-j</artifactId>
117-
<version>${cs.mysql.version}</version>
118-
</dependency>
119-
</dependencies>
117+
<version>${cs.exec-maven-plugin.version}</version>
120118
<executions>
121119
<execution>
122120
<phase>process-resources</phase>
123121
<id>create-schema</id>
124122
<goals>
125-
<goal>java</goal>
123+
<goal>exec</goal>
126124
</goals>
127125
</execution>
128126
</executions>
129127
<configuration>
130-
<mainClass>com.cloud.upgrade.DatabaseCreator</mainClass>
128+
<executable>java</executable>
129+
<workingDirectory>${basedir}/..</workingDirectory>
131130
<includePluginDependencies>true</includePluginDependencies>
132131
<arguments>
132+
<argument>--add-opens=java.base/java.lang=ALL-UNNAMED</argument>
133+
<argument>-classpath</argument>
134+
<classpath />
135+
<argument>com.cloud.upgrade.DatabaseCreator</argument>
133136
<!-- db properties file -->
134137
<argument>${basedir}/../utils/conf/db.properties</argument>
135138
<argument>${basedir}/../utils/conf/db.properties.override</argument>
@@ -177,27 +180,25 @@
177180
<plugin>
178181
<groupId>org.codehaus.mojo</groupId>
179182
<artifactId>exec-maven-plugin</artifactId>
180-
<version>1.2.1</version>
181-
<dependencies>
182-
<dependency>
183-
<groupId>com.mysql</groupId>
184-
<artifactId>mysql-connector-j</artifactId>
185-
<version>${cs.mysql.version}</version>
186-
</dependency>
187-
</dependencies>
183+
<version>${cs.exec-maven-plugin.version}</version>
188184
<executions>
189185
<execution>
190186
<phase>process-resources</phase>
191187
<id>create-schema-simulator</id>
192188
<goals>
193-
<goal>java</goal>
189+
<goal>exec</goal>
194190
</goals>
195191
</execution>
196192
</executions>
197193
<configuration>
198-
<mainClass>com.cloud.upgrade.DatabaseCreator</mainClass>
194+
<executable>java</executable>
195+
<workingDirectory>${basedir}/..</workingDirectory>
199196
<includePluginDependencies>true</includePluginDependencies>
200197
<arguments>
198+
<argument>--add-opens=java.base/java.lang=ALL-UNNAMED</argument>
199+
<argument>-classpath</argument>
200+
<classpath />
201+
<argument>com.cloud.upgrade.DatabaseCreator</argument>
201202
<!-- db properties file -->
202203
<argument>${basedir}/../utils/conf/db.properties</argument>
203204
<argument>${basedir}/../utils/conf/db.properties.override</argument>
@@ -235,27 +236,25 @@
235236
<plugin>
236237
<groupId>org.codehaus.mojo</groupId>
237238
<artifactId>exec-maven-plugin</artifactId>
238-
<version>1.2.1</version>
239-
<dependencies>
240-
<dependency>
241-
<groupId>com.mysql</groupId>
242-
<artifactId>mysql-connector-j</artifactId>
243-
<version>${cs.mysql.version}</version>
244-
</dependency>
245-
</dependencies>
239+
<version>${cs.exec-maven-plugin.version}</version>
246240
<executions>
247241
<execution>
248242
<phase>process-resources</phase>
249243
<id>create-schema-simulator</id>
250244
<goals>
251-
<goal>java</goal>
245+
<goal>exec</goal>
252246
</goals>
253247
</execution>
254248
</executions>
255249
<configuration>
256-
<mainClass>com.cloud.upgrade.DatabaseCreator</mainClass>
250+
<executable>java</executable>
251+
<workingDirectory>${basedir}/..</workingDirectory>
257252
<includePluginDependencies>true</includePluginDependencies>
258253
<arguments>
254+
<argument>--add-opens=java.base/java.lang=ALL-UNNAMED</argument>
255+
<argument>-classpath</argument>
256+
<classpath />
257+
<argument>com.cloud.upgrade.DatabaseCreator</argument>
259258
<!-- db properties file -->
260259
<argument>${basedir}/../utils/conf/db.properties</argument>
261260
<argument>${basedir}/../utils/conf/db.properties.override</argument>

0 commit comments

Comments
 (0)