Skip to content

Commit

Permalink
ci(java): Update to Java 17 as default and enforce it
Browse files Browse the repository at this point in the history
Signed-off-by: Helio Chissini de Castro <heliocastro@gmail.com>
  • Loading branch information
heliocastro committed Jul 8, 2024
1 parent 20c818a commit 0cfdead
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 34 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ jobs:
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq python3-pip build-essential libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config libssl-dev git cmake
pip install mkdocs mkdocs-material
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
check-latest: true
cache: 'maven'
Expand All @@ -89,7 +89,7 @@ jobs:
- name: Build SW360
run: |
mvn clean install --no-transfer-progress -P deploy -Dhelp-docs=true -Dbase.deploy.dir=. -Dliferay.deploy.dir=${PWD}/deploy -Dbackend.deploy.dir=${PWD}/deploy/webapps -Drest.deploy.dir=${PWD}/deploy/webapps -DRunComponentVisibilityRestrictionTest=false -DRunPrivateProjectAccessTest=false -DRunRestForceUpdateTest=false
mvn clean install --no-transfer-progress -P deploy -Dhelp-docs=true -Dbase.deploy.dir=. -Dliferay.deploy.dir=${PWD}/deploy -Dbackend.deploy.dir=${PWD}/deploy/webapps -Drest.deploy.dir=${PWD}/deploy/webapps -DRunComponentVisibilityRestrictionTest=false -DRunPrivateProjectAccessTest=false -DRunRestForceUpdateTest=false -fae
- name: Run PrivateProjectAccessTest
run: |
Expand Down Expand Up @@ -118,3 +118,7 @@ jobs:
run: |
cd clients
mvn clean install --no-transfer-progress -DRunRestIntegrationTest=true
- name: Publish Test Report
if: success() || failure()
uses: scacap/action-surefire-report@v1
4 changes: 2 additions & 2 deletions .github/workflows/docker_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ jobs:
- name: Checkout main repository
uses: actions/checkout@v4

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '11'
java-version: '17'
cache: 'maven'
distribution: 'temurin'

Expand Down
4 changes: 2 additions & 2 deletions .versions
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
THRIFT_VERSION=0.18.1
THRIFT_VERSION=0.20.0
LIFERAY_VERSION=7.4.3.18-ga18
LIFERAY_SOURCE=liferay-ce-portal-tomcat-7.4.3.18-ga18-20220329092001364.tar.gz
UBUNTU_VERSION=jammy
JAVA_VERSION=11
JAVA_VERSION=17
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#-----------------------------------------------------------------------------------
# Base image
# We need use JDK, JRE is not enough as Liferay do runtime changes and require javac
ARG JAVA_VERSION=11
ARG JAVA_VERSION=17
ARG UBUNTU_VERSION=jammy

# Use OpenJDK Eclipe Temurin Ubuntu LTS
Expand Down Expand Up @@ -120,7 +120,7 @@ COPY --from=sw360thriftbuild /usr/local/bin/thrift /usr/local/bin/thrift
# SW360 Build Test image
# Base image to build with test

FROM maven:3-eclipse-temurin-11 as sw360test
FROM maven:3-eclipse-temurin-17 as sw360test

COPY --from=thrift /usr/local/bin/thrift /usr/bin

Expand Down Expand Up @@ -148,7 +148,7 @@ RUN --mount=type=cache,target=/var/cache/apt \
# So when decide to use as development, only this last stage
# is triggered by buildkit images

FROM maven:3.9-eclipse-temurin-11 as sw360build
FROM maven:3.9-eclipse-temurin-17 as sw360build

ARG COUCHDB_HOST=localhost

Expand Down Expand Up @@ -250,7 +250,7 @@ COPY --chown=$USERNAME:$USERNAME ./scripts/docker-config/portal-ext.properties /
COPY --chown=$USERNAME:$USERNAME ./scripts/docker-config/entry_point.sh /app/entry_point.sh

# Tomcat manager for debugging portlets
COPY --chown=$USERNAME:$USERNAME --from=tomcat:9.0.56-jdk11 /usr/local/tomcat/webapps.dist/manager /app/sw360/tomcat/webapps/manager
COPY --chown=$USERNAME:$USERNAME --from=tomcat:9.0.56-jdk17 /usr/local/tomcat/webapps.dist/manager /app/sw360/tomcat/webapps/manager
RUN --mount=type=bind,target=/build/sw360,rw \
if [ DEBUG ]; then \
cp /etc/sw360/manager/tomcat-users.xml /app/sw360/tomcat/conf/tomcat-users.xml ; \
Expand Down
27 changes: 19 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,27 @@
<rest.version>1.0.0</rest.version>

<!-- Build version properties -->
<java_source.version>11</java_source.version>
<java_target.version>11</java_target.version>
<java_source.version>17</java_source.version>
<java_target.version>17</java_target.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<!-- Plugin version properties -->
<asciidoctor-maven-plugin.version>2.2.2</asciidoctor-maven-plugin.version>
<build-helper-maven-plugin.version>3.3.0</build-helper-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
<maven-assembly-plugin.version>3.4.2</maven-assembly-plugin.version>
<maven-bundle-plugin.version>5.1.8</maven-bundle-plugin.version>
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
<maven-dependency-plugin.version>3.3.0</maven-dependency-plugin.version>
<maven-enforcer-plugin.version>3.1.0</maven-enforcer-plugin.version>
<maven-failsafe-plugin.version>3.0.0-M7</maven-failsafe-plugin.version>
<maven-enforcer-plugin.version>3.4.1</maven-enforcer-plugin.version>
<maven-failsafe-plugin.version>3.3.0</maven-failsafe-plugin.version>
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
<maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
<maven-surefire-plugin.version>3.3.0</maven-surefire-plugin.version>
<maven-war-plugin.version>3.3.2</maven-war-plugin.version>
<versions-maven-plugin.version>2.12.0</versions-maven-plugin.version>

Expand Down Expand Up @@ -202,6 +204,7 @@
<argLine>-Dcatalina.home=${project.build.directory}/home -Xms128m -Xmx256m -XX:MaxPermSize=512m</argLine>
</properties>


<dependencyManagement>
<dependencies>
<dependency>
Expand Down Expand Up @@ -587,7 +590,6 @@
<version>${javax.servlet-api.version}</version>
<scope>provided</scope>
</dependency>

</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -665,6 +667,12 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<argLine>-Xms512m -Xmx1024m -XX:MaxPermSize=512m</argLine>
<forkCount>0</forkCount>
<reuseForks>false</reuseForks>
<reportFormat>plain</reportFormat>
</configuration>
</plugin>

<plugin>
Expand Down Expand Up @@ -830,7 +838,7 @@
</markdown>
</configuration>
<java>
<eclipse></eclipse>
<eclipse/>
</java>
</configuration>
</plugin>
Expand Down Expand Up @@ -899,6 +907,9 @@
<regexMessage>You must set at least the property
'base.deploy.dir'!</regexMessage>
</requireProperty>
<requireJavaVersion>
<version>[17,18)</version>
</requireJavaVersion>
</rules>
<fail>true</fail>
</configuration>
Expand Down
23 changes: 19 additions & 4 deletions sw360.code-workspace
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
{
"folders": [
{
"path": "."
}
"path": ".",
},
],
"settings": {
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable",
"java.compile.nullAnalysis.mode": "automatic"
}
"java.compile.nullAnalysis.mode": "automatic",
"workbench.colorCustomizations": {
"commandCenter.border": "#15202b99",
"sash.hoverBorder": "#65c89b",
"statusBar.background": "#42b883",
"statusBar.foreground": "#15202b",
"statusBarItem.hoverBackground": "#359268",
"statusBarItem.remoteBackground": "#42b883",
"statusBarItem.remoteForeground": "#15202b",
"titleBar.activeBackground": "#42b883",
"titleBar.activeForeground": "#15202b",
"titleBar.inactiveBackground": "#42b88399",
"titleBar.inactiveForeground": "#15202b99",
},
"peacock.color": "#42b883",
"java.configuration.updateBuildConfiguration": "automatic",
},
}
12 changes: 1 addition & 11 deletions third-party/couchdb-lucene/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<artifact.deploy.dir>${backend.deploy.dir}</artifact.deploy.dir>
<maven.test.skip>true</maven.test.skip>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -271,22 +272,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<excludes>
<exclude>**/TikaTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 0cfdead

Please sign in to comment.