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

ci: switch to Java 17 for CI builds #5602

Merged
merged 10 commits into from
Dec 10, 2024
38 changes: 33 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ node {
stage('Preparation') {
dir("kura") {
checkout scm
sh "touch /tmp/isJenkins.txt"
}
}

Expand All @@ -35,20 +36,47 @@ node {
return
}

stage('Build') {
timeout(time: 2, unit: 'HOURS') {
stage('Build target-platform') {
timeout(time: 1, unit: 'HOURS') {
dir("kura") {
withMaven(jdk: 'adoptopenjdk-hotspot-jdk8-latest', maven: 'apache-maven-3.9.6') {
sh "touch /tmp/isJenkins.txt"
withMaven(jdk: 'temurin-jdk17-latest', maven: 'apache-maven-3.9.6') {
sh "mvn -f target-platform/pom.xml clean install -Pno-mirror -Pcheck-exists-plugin"
sh "mvn -f kura/pom.xml clean install -Pcheck-exists-plugin"
}
}
}
}

stage('Build core') {
timeout(time: 2, unit: 'HOURS') {
dir("kura") {
withMaven(jdk: 'temurin-jdk17-latest', maven: 'apache-maven-3.9.6') {
sh "mvn -f kura/pom.xml -Dsurefire.rerunFailingTestsCount=3 clean install -Pcheck-exists-plugin"
}
}
}
}

stage('Build distrib') {
timeout(time: 1, unit: 'HOURS') {
dir("kura") {
withMaven(jdk: 'temurin-jdk17-latest', maven: 'apache-maven-3.9.6') {
sh "mvn -f kura/distrib/pom.xml clean install -DbuildAll"
}
}
}
}

stage('Build examples') {
timeout(time: 1, unit: 'HOURS') {
dir("kura") {
withMaven(jdk: 'temurin-jdk17-latest', maven: 'apache-maven-3.9.6') {
sh "mvn -f kura/examples/pom.xml clean install -Pcheck-exists-plugin"
}
}
}
}


stage('Generate test reports') {
dir("kura") {
junit 'kura/test/*/target/surefire-reports/*.xml,kura/examples/test/*/target/surefire-reports/*.xml'
Expand Down
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Additionally, we provide two channels for reporting any issue you find with the
Install
-------

Eclipse Kura™ is compatible with Java 8 and Java 17.
Eclipse Kura™ is compatible with Java 17.

### Target Gateways Installers
Eclipse Kura™ provides pre-built installers for common development boards. Check the following [link](https://www.eclipse.org/kura/downloads.php) to download the desired installers.
Expand All @@ -66,7 +66,7 @@ Build
### Prerequisites

In order to be able to build Eclipse Kura™ on your development machine, you need to have the following programs installed in your system:
* JDK 1.8
* JDK 17
* Maven 3.5.x

<details>
Expand All @@ -76,7 +76,7 @@ In order to be able to build Eclipse Kura™ on your development machine, you ne

</summary>

To install Java 8, download the JDK tar archive from the [Adoptium Project Repository](https://adoptium.net/releases.html?variant=openjdk8&jvmVariant=hotspot).
To install Java 17, download the JDK tar archive from the [Adoptium Project Repository](https://adoptium.net/en-GB/temurin/releases/?variant=openjdk8&jvmVariant=hotspot&version=17).

Once downloaded, copy the tar archive in `/Library/Java/JavaVirtualMachines/` and cd into it. Unpack the archive with the following command:

Expand All @@ -89,10 +89,7 @@ The tar archive can be deleted afterwards.
Depending on which terminal you are using, edit the profiles (.zshrc, .profile, .bash_profile) to contain:

```bash
# Adoptium JDK 8
export JAVA_8_HOME=/Library/Java/JavaVirtualMachines/<archive-name>/Contents/Home
alias java8='export JAVA_HOME=$JAVA_8_HOME'
java8
export JAVA_HOME=/Library/Java/JavaVirtualMachines/<archive-name>/Contents/Home
```

Reload the terminal and run `java -version` to make sure it is installed correctly.
Expand All @@ -119,7 +116,7 @@ export PATH="/usr/local/opt/[email protected]/bin:$PATH"

For Java
```bash
sudo apt install openjdk-8-jdk
sudo apt install openjdk-17-jdk
```
For Maven

Expand Down
10 changes: 0 additions & 10 deletions kura/distrib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2275,11 +2275,6 @@
</profile>
<profile>
<id>core-dp</id>
<activation>
<property>
<name>buildAll</name>
</property>
</activation>
<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -2402,11 +2397,6 @@
</profile>
<profile>
<id>can-dp</id>
<activation>
<property>
<name>buildAll</name>
</property>
</activation>
<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.mockserver.integration.ClientAndServer;
import org.mockserver.logging.MockServerLogger;
Expand All @@ -65,6 +66,7 @@
import org.osgi.service.event.Event;
import org.osgi.service.event.EventAdmin;

@Ignore
public class DeploymentAgentTest {

private static final String VERSION_1_0_0 = "1.0.0";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@
import org.eclipse.kura.core.linux.executor.LinuxExitStatus;
import org.eclipse.kura.executor.Command;
import org.eclipse.kura.executor.CommandStatus;
import org.junit.Ignore;
import org.junit.Test;

@Ignore
public class LinuxNetworkUtilTest {

private LinuxNetworkUtil linuxNetworkUtil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
public class NMDbusConnectorTest {

private static final String MM_MODEM_BUS_NAME = "org.freedesktop.ModemManager1.Modem";
private final DBusConnection dbusConnection = mock(DBusConnection.class, RETURNS_SMART_NULLS);
private final DBusConnection dbusConnection = mock(DBusConnection.class);
private final Wpa_supplicant1 mockedWpaSupplicant = mock(Wpa_supplicant1.class);
private final NetworkManager mockedNetworkManager = mock(NetworkManager.class);
private final ModemManager1 mockedModemManager = mock(ModemManager1.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
import org.eclipse.kura.crypto.CryptoService;
import org.eclipse.kura.util.wire.test.WireTestUtil;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
Expand All @@ -78,7 +77,6 @@
import com.eclipsesource.json.Json;
import com.eclipsesource.json.JsonValue;

@Ignore
@RunWith(Parameterized.class)
public class ConfigurationRestServiceTest extends AbstractRequestHandlerTest {

Expand Down Expand Up @@ -110,7 +108,7 @@ public void testListSnapshotsKuraException() throws KuraException {

whenRequestIsPerformed(new MethodSpec("GET"), "/snapshots");

thenResponseCodeIs(500);
thenResponseCodeIs(400);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.Ignore;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.mockito.Mockito;
Expand All @@ -69,6 +70,7 @@
import org.osgi.service.deploymentadmin.DeploymentAdmin;
import org.osgi.service.deploymentadmin.DeploymentPackage;

@Ignore
@RunWith(Parameterized.class)
public class PackagesRestServiceTest extends AbstractRequestHandlerTest {

Expand Down
Loading