I am currently getting myself into the LwM2M topic and I tried the leshan project from eclipse.
I followed the README.md on https://github.com/eclipse/leshan. The standalone demos are working fine, but when I try to build the project with "mvn clean install" I get the following log/error:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] leshan [pom]
[INFO] leshan - core [bundle]
[INFO] leshan - core californium [bundle]
[INFO] leshan - server core [bundle]
[INFO] leshan - server californium [bundle]
[INFO] leshan - server redis [bundle]
[INFO] leshan - client core [bundle]
[INFO] leshan - client californium [bundle]
[INFO] leshan - integration tests [jar]
[INFO] leshan - server demo [jar]
[INFO] leshan - client demo [jar]
[INFO] leshan - bootstrap server demo [jar]
[INFO]
[INFO] ---------------------< org.eclipse.leshan:leshan >----------------------
[INFO] Building leshan 2.0.0-SNAPSHOT [1/12]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ leshan ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven) @ leshan ---
[INFO]
[INFO] >>> maven-source-plugin:3.2.1:jar (attach-sources) > generate-sources @ leshan >>>
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven) @ leshan ---
[INFO]
[INFO] <<< maven-source-plugin:3.2.1:jar (attach-sources) < generate-sources @ leshan <<<
[INFO]
[INFO]
[INFO] --- maven-source-plugin:3.2.1:jar (attach-sources) @ leshan ---
[INFO]
[INFO] --- revapi-maven-plugin:0.11.2:check (default) @ leshan ---
[INFO] Comparing [org.eclipse.leshan:leshan:pom:1.0.0] against [org.eclipse.leshan:leshan:pom:2.0.0-SNAPSHOT] (including their transitive dependencies).
[INFO] API checks completed without failures.
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ leshan ---
[INFO] Installing C:UsersJonasDesktopleshanleshanpom.xml to C:UsersJonas.m2repositoryorgeclipseleshanleshan2.0.0-SNAPSHOTleshan-2.0.0-SNAPSHOT.pom
[INFO]
[INFO] -------------------< org.eclipse.leshan:leshan-core >-------------------
[INFO] Building leshan - core 2.0.0-SNAPSHOT [2/12]
[INFO] -------------------------------[ bundle ]-------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ leshan-core ---
[INFO] Deleting C:UsersJonasDesktopleshanleshanleshan-coretarget
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven) @ leshan-core ---
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ leshan-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 16 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ leshan-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 162 source files to C:UsersJonasDesktopleshanleshanleshan-coretargetclasses
[INFO]
[INFO] --- animal-sniffer-maven-plugin:1.18:check (default) @ leshan-core ---
[INFO] Checking unresolved references to net.sf.androidscents.signature:android-api-level-19:4.4.2_r4
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ leshan-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:UsersJonasDesktopleshanleshanleshan-coresrctestresources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ leshan-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 17 source files to C:UsersJonasDesktopleshanleshanleshan-coretargettest-classes
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M4:test (default-test) @ leshan-core ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.eclipse.leshan.core.util.X509CertUtilTest
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.152 s - in org.eclipse.leshan.core.util.X509CertUtilTest
[INFO] Running org.eclipse.leshan.core.json.JsonSerializerTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.023 s - in org.eclipse.leshan.core.json.JsonSerializerTest
[INFO] Running org.eclipse.leshan.core.node.codec.LwM2mNodeDecoderTest
[INFO] Tests run: 50, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.084 s - in org.eclipse.leshan.core.node.codec.LwM2mNodeDecoderTest
[INFO] Running org.eclipse.leshan.senml.SenMLJsonSerDesTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.062 s - in org.eclipse.leshan.senml.SenMLJsonSerDesTest
[INFO] Running org.eclipse.leshan.core.LinkObjectTest
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 s - in org.eclipse.leshan.core.LinkObjectTest
[INFO] Running org.eclipse.leshan.core.datatype.NumberUtilTest
[INFO] Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 s - in org.eclipse.leshan.core.datatype.NumberUtilTest
[INFO] Running org.eclipse.leshan.core.node.LwM2MResourceTest
[INFO] Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.024 s - in org.eclipse.leshan.core.node.LwM2MResourceTest
[INFO] Running org.eclipse.leshan.core.attributes.AttributeSetTest
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.018 s - in org.eclipse.leshan.core.attributes.AttributeSetTest
[INFO] Running org.eclipse.leshan.core.json.JsonDeserializerTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.033 s - in org.eclipse.leshan.core.json.JsonDeserializerTest
[INFO] Running org.eclipse.leshan.core.node.codec.LwM2mNodeEncoderTest
[INFO] Tests run: 17, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.056 s - in org.eclipse.leshan.core.node.codec.LwM2mNodeEncoderTest
[INFO] Running org.eclipse.leshan.core.tlv.TlvEncoderTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.233 s - in org.eclipse.leshan.core.tlv.TlvEncoderTest
[INFO] Running org.eclipse.leshan.core.attributes.AttributeTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 s - in org.eclipse.leshan.core.attributes.AttributeTest
[INFO] Running org.eclipse.leshan.core.tlv.TlvDecoderTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.23 s - in org.eclipse.leshan.core.tlv.TlvDecoderTest
[INFO] Running org.eclipse.leshan.senml.SenMLCborSerializerTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.019 s - in org.eclipse.leshan.senml.SenMLCborSerializerTest
[INFO] Running org.eclipse.leshan.core.model.ValidateModelsTest
SLF4J: A number (64) of logging calls during the initialization phase have been intercepted and are
SLF4J: now being replayed. These are subject to the filtering rules of the underlying logging system.
SLF4J: See also http://www.slf4j.org/codes.html#replay
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.722 s - in org.eclipse.leshan.core.model.ValidateModelsTest
[INFO] Running org.eclipse.leshan.core.VersionTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s - in org.eclipse.leshan.core.VersionTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 144, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-bundle-plugin:4.0.0:bundle (default-bundle) @ leshan-core ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for leshan 2.0.0-SNAPSHOT:
[INFO]
[INFO] leshan ............................................. SUCCESS [ 2.751 s]
[INFO] leshan - core ...................................... FAILURE [ 11.822 s]
[INFO] leshan - core californium .......................... SKIPPED
[INFO] leshan - server core ............................... SKIPPED
[INFO] leshan - server californium ........................ SKIPPED
[INFO] leshan - server redis .............................. SKIPPED
[INFO] leshan - client core ............................... SKIPPED
[INFO] leshan - client californium ........................ SKIPPED
[INFO] leshan - integration tests ......................... SKIPPED
[INFO] leshan - server demo ............................... SKIPPED
[INFO] leshan - client demo ............................... SKIPPED
[INFO] leshan - bootstrap server demo ..................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.145 s
[INFO] Finished at: 2020-11-11T14:33:16+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.felix:maven-bundle-plugin:4.0.0:bundle (default-bundle) on project leshan-core: Execution default-bundle of goal org.apache.felix:maven-bundle-plugin:4.0.0:bundle failed.: ConcurrentModificationException -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :leshan-core
The steps I did were:
cd desktop/leshan //The folder were i wanted to install it
git clone https://github.com/eclipse/leshan.git
mvn clean install
Fix attempts:
Read online much stuff about it but I didnt found anything specific. People suggested deleting the repository in User/.m2 but it didnt work for me.
And to be honest I have no clue whats going on, I am new to this. I would appreciate any help.
mvn -v:
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:Program Filesapache-maven-3.6.3bin..
Java version: 15.0.1, vendor: Oracle Corporation, runtime: C:Program FilesJavajdk-15.0.1
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Thanks in advance!
Jonas
2
Answers
I continued researching on my own and Java 15 is the problem. If anyone has the same problem as i had just switch to Java 11 and run the build as described. It worked fine for me. If you have any other problems I suggest that you also post your questions, concerning leshan lwm2m, on https://github.com/eclipse/leshan/issues.
Jonas
EDIT: You can also do it with Java 15. You have to change the pom.xml document. Change in line 456 the version from 4.0.0 to 5.1.1 .
This was a build issue which is now fixed using a most recent version of
maven-bundle-plugin
.(See https://github.com/eclipse/leshan/issues/927 for more details)
This was fixed :
master
branch (since commit 70e218d8)1.x
branch (since commit 04c93a0b)