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

chore: updated moquette, selected central as source [backport release-5.2.0] #5347

Merged
merged 2 commits into from
Sep 23, 2024
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
82 changes: 64 additions & 18 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,71 @@ node {
stage('Build') {
timeout(time: 2, unit: 'HOURS') {
dir("kura") {
withMaven(jdk: 'adoptopenjdk-hotspot-jdk11-latest', maven: 'apache-maven-3.6.3') {
withCredentials([string(credentialsId: 'sonarcloud-token', variable: 'SONARCLOUD_TOKEN')]) {
withSonarQubeEnv {
sh "touch /tmp/isJenkins.txt"
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 -Dmaven.test.failure.ignore=true sonar:sonar -Dsonar.organization=eclipse -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONARCLOUD_TOKEN} -Dsonar.branch.name=${BRANCH_NAME} -Dsonar.junit.reportPaths='target/surefire-reports' -Dsonar.jacoco.reportPaths='target/jacoco/' -Dsonar.java.binaries='target/' -Dsonar.core.codeCoveragePlugin=jacoco -Dsonar.exclusions=test/**/*.java,test-util/**/*.java,org.eclipse.kura.web2/**/*.java'''
sh "mvn -f kura/distrib/pom.xml clean install"
sh "mvn -f kura/examples/pom.xml clean install -Pcheck-exists-plugin"
}

}
withMaven(jdk: 'adoptopenjdk-hotspot-jdk8-latest', maven: 'apache-maven-3.9.6') {
sh "touch /tmp/isJenkins.txt"
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"
sh "mvn -f kura/distrib/pom.xml clean install"
sh "mvn -f kura/examples/pom.xml clean install -Pcheck-exists-plugin"
}
}
}
}
stage('Results') {
dir("kura") {
junit 'kura/test/*/target/surefire-reports/*.xml,kura/examples/test/*/target/surefire-reports/*.xml'
archiveArtifacts artifacts: 'kura/distrib/target/*.deb, kura/distrib/target/*_intel-edison-nn_installer.sh', onlyIfSuccessful: true
}
}
}

stage('Generate test reports') {
dir("kura") {
junit 'kura/test/*/target/surefire-reports/*.xml,kura/examples/test/*/target/surefire-reports/*.xml'
}
}

stage('Archive .deb artifacts') {
dir("kura") {
archiveArtifacts artifacts: 'kura/distrib/target/*.deb', onlyIfSuccessful: true
}
}

// Sonar checking commented to allow the build to finish
// It needed to be commented as older versions of Eclipse Kura were meant to be compiled with Java 8. Now Sonar requires
// Java 17, posing a challengo for a successful build.
// We have decided to disable the sonar part to allow a successful build process but giving the chance to users that want to leverage such old
// maintenance versions of Kura to re-enable them if needed.

// stage('Sonar') {
// timeout(time: 2, unit: 'HOURS') {
// dir("kura") {
// withMaven(jdk: 'temurin-jdk17-latest', maven: 'apache-maven-3.9.6') {
// withCredentials([string(credentialsId: 'sonarcloud-token', variable: 'SONARCLOUD_TOKEN')]) {
// withSonarQubeEnv {
// sh '''
// mvn -f kura/pom.xml sonar:sonar \
// -Dmaven.test.failure.ignore=true \
// -Dmaven.compiler.target=17 \
// -Dsonar.organization=eclipse \
// -Dsonar.host.url=${SONAR_HOST_URL} \
// -Dsonar.token=${SONARCLOUD_TOKEN} \
// -Dsonar.branch.name=${BRANCH_NAME} \
// -Dsonar.branch.target=${CHANGE_TARGET} \
// -Dsonar.java.source=8 \
// -Dsonar.java.binaries='target/' \
// -Dsonar.core.codeCoveragePlugin=jacoco \
// -Dsonar.projectKey=org.eclipse.kura:kura \
// -Dsonar.exclusions=test/**/*.java,test-util/**/*.java,org.eclipse.kura.web2/**/*.java,org.eclipse.kura.nm/src/main/java/org/freedesktop/**/*,org.eclipse.kura.nm/src/main/java/fi/w1/**/*
// '''
// }
// }
// }
// }
// }
// }
// stage('quality-gate') {
// // Sonar quality gate
// timeout(time: 30, unit: 'MINUTES') {
// withCredentials([string(credentialsId: 'sonarcloud-token', variable: 'SONARCLOUD_TOKEN')]) {
// def qg = waitForQualityGate()
// if (qg.status != 'OK') {
// error "Pipeline aborted due to sonar quality gate failure: ${qg.status}"
// }
// }
// }
// }
}
4 changes: 2 additions & 2 deletions kura/examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<packaging>pom</packaging>

<properties>
<tycho-version>1.6.0</tycho-version>
<tycho-version>1.7.0</tycho-version>

<!-- SCM: Note that we are in the "kura" sub-dir here already -->
<tycho.scmUrl>scm:git:ssh://github.com/eclipse/kura/kura</tycho.scmUrl>
Expand Down Expand Up @@ -289,7 +289,7 @@
<!-- make us aware of warnings -->
<showWarnings>true</showWarnings>
<!-- Kura does not set bootdelegation, we let the compiler check for this -->
<requireJREPackageImports>true</requireJREPackageImports>
<requireJavaPackageImports>true</requireJavaPackageImports>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

<properties>
<kura.basedir>${project.basedir}/../../..</kura.basedir>
<sonar.coverage.jacoco.xmlReportPaths>
${project.build.directory}/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
</properties>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

<properties>
<kura.basedir>${project.basedir}/../../..</kura.basedir>
<sonar.coverage.jacoco.xmlReportPaths>
${project.build.directory}/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
</properties>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

<properties>
<kura.basedir>${project.basedir}/../../..</kura.basedir>
<sonar.coverage.jacoco.xmlReportPaths>
${project.build.directory}/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
</properties>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

<properties>
<kura.basedir>${project.basedir}/../../..</kura.basedir>
<sonar.coverage.jacoco.xmlReportPaths>
${project.build.directory}/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
</properties>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

<properties>
<kura.basedir>${project.basedir}/../../..</kura.basedir>
<sonar.coverage.jacoco.xmlReportPaths>
${project.build.directory}/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
</properties>

<build>
Expand Down
9 changes: 6 additions & 3 deletions kura/examples/test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,15 @@
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${sonar.jacoco.reportPath}</destFile>
<propertyName>jacocoArgs</propertyName>
</configuration>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
Expand All @@ -270,8 +275,6 @@
<tycho.argline>${jacocoArgs} -Dlog4j.configurationFile=file:${kura.basedir}/emulator/org.eclipse.kura.emulator/src/main/resources/log4j.xml</tycho.argline>

<jacoco.version>0.8.6</jacoco.version>
<jacoco.reportDir>target/jacoco/</jacoco.reportDir>
<sonar.jacoco.reportPath>target/jacoco.exec</sonar.jacoco.reportPath>
</properties>

<modules>
Expand Down
4 changes: 2 additions & 2 deletions kura/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
</modules>

<properties>
<tycho-version>1.6.0</tycho-version>
<tycho-version>1.7.0</tycho-version>

<!-- SCM: Note that we are in the "kura" sub-dir here already -->
<tycho.scmUrl>scm:git:ssh://github.com/eclipse/kura/kura</tycho.scmUrl>
Expand Down Expand Up @@ -461,7 +461,7 @@
<!-- make us aware of warnings -->
<showWarnings>true</showWarnings>
<!-- Kura does not set bootdelegation, we let the compiler check for this -->
<requireJREPackageImports>true</requireJREPackageImports>
<requireJavaPackageImports>true</requireJavaPackageImports>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.moquette.server.Server;
import io.moquette.broker.Server;


@RunWith(Suite.class)
@SuiteClasses({ MqttDataTransportTest.class, InventoryHandlerTest.class, DataServiceTest.class,
Expand Down
18 changes: 3 additions & 15 deletions target-platform/moquette-broker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,10 @@
<version>1.0.0-SNAPSHOT</version>

<properties>
<maven-bundle-plugin.version>3.0.1</maven-bundle-plugin.version>
<moquette-broker.version>0.8.1</moquette-broker.version>
<maven-bundle-plugin.version>5.1.8</maven-bundle-plugin.version>
<moquette-broker.version>0.15</moquette-broker.version>
</properties>

<repositories>
<repository>
<id>bintray</id>
<url>https://jcenter.bintray.com</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>io.moquette</groupId>
Expand Down Expand Up @@ -99,6 +86,7 @@
<Embed-Transitive>true</Embed-Transitive>
<Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
<_noee>true</_noee>
<_fixupmessages>"Classes found in the wrong directory";is:=warning</_fixupmessages>
</instructions>
</configuration>
</plugin>
Expand Down
8 changes: 4 additions & 4 deletions target-platform/p2-repo-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@
<goal>run</goal>
</goals>
<configuration>
<tasks>
<target>
<move file="target/source/plugins/com.codeminders.hidapi.jar" tofile="target/source/plugins/com.codeminders.hidapi_${com.codeminders.hidapi.version}.jar"/>
<move file="target/source/plugins/com.codeminders.hidapi.armv6hf.jar" tofile="target/source/plugins/com.codeminders.hidapi.armv6hf_${com.codeminders.hidapi.version}.jar"/>
<move file="target/source/plugins/com.codeminders.hidapi.x86_64.jar" tofile="target/source/plugins/com.codeminders.hidapi.x86_64_${com.codeminders.hidapi.version}.jar"/>
Expand Down Expand Up @@ -710,7 +710,7 @@
<move file="target/source/plugins/bcutil-jdk18on.jar" tofile="target/source/plugins/bcutil_${org.bouncycastle.version}.jar"/>
<move file="target/source/plugins/bcpg-jdk18on.jar" tofile="target/source/plugins/bcpg_${org.bouncycastle.version}.jar"/>
<move file="target/source/plugins/gpsd4java.jar" tofile="target/source/plugins/com.eurotech.gpsd4java_${com.eurotech.gpsd4java.version}.jar"/>
</tasks>
</target>
</configuration>
</execution>
<execution>
Expand All @@ -720,7 +720,7 @@
<goal>run</goal>
</goals>
<configuration>
<tasks>
<target>
<delete dir="../../kura/target-definition/common/"/>
<mkdir dir="../../kura/target-definition/common/repository"/>
<copy todir="../../kura/target-definition/common/repository">
Expand All @@ -729,7 +729,7 @@
<copy todir="../../kura/target-definition/common/source">
<fileset dir="${project.build.directory}/source"/>
</copy>
</tasks>
</target>
</configuration>
</execution>
</executions>
Expand Down
4 changes: 2 additions & 2 deletions target-platform/p2-repo-test-deps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@
<goal>run</goal>
</goals>
<configuration>
<tasks>
<target>
<delete dir="../../kura/target-definition/test-deps/" />
<mkdir dir="../../kura/target-definition/test-deps/repository" />
<copy todir="../../kura/target-definition/test-deps/repository">
<fileset dir="${project.build.directory}/repository" />
</copy>
</tasks>
</target>
</configuration>
</execution>
</executions>
Expand Down
Loading