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

Build failed on windows because of some LinkParser Tests #1147

Closed
pioneerAlone opened this issue Nov 9, 2021 · 14 comments
Closed

Build failed on windows because of some LinkParser Tests #1147

pioneerAlone opened this issue Nov 9, 2021 · 14 comments
Labels
bug Dysfunctionnal behavior core Impact core of Leshan

Comments

@pioneerAlone
Copy link

Dear developer,

When using eclipse IDE, I have encountered some problems, the environment seems to be no problem, but I am not sure how to build the project, I want to build the jar package for a certain demo separately, can I? Or do all builds on root dir leshan?

The error is as follows:
Execute maven install
[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 - core demo [jar]
[INFO] leshan - client demo [jar]
[INFO] leshan - server core demo [jar]
[INFO] leshan - server demo [jar]
[INFO] leshan - bootstrap server demo [jar]
[INFO]
[INFO] ---------------------< org.eclipse.leshan:leshan >----------------------
[INFO] Building leshan 2.0.0-SNAPSHOT [1/14]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven) @ leshan ---
[INFO]
[INFO] >>> maven-source-plugin:3.2.1:jar (attach-sources) > generate-sources @ leshan >>>
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0: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] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-archiver/3.5.0/maven-archiver-3.5.0.pom
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/4.2.1/plexus-archiver-4.2.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for leshan 2.0.0-SNAPSHOT:
[INFO]
[INFO] leshan ............................................. FAILURE [ 43.532 s]
[INFO] leshan - core ...................................... SKIPPED
[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 - core demo ................................. SKIPPED
[INFO] leshan - client demo ............................... SKIPPED
[INFO] leshan - server core demo .......................... SKIPPED
[INFO] leshan - server demo ............................... SKIPPED
[INFO] leshan - bootstrap server demo ..................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 44.631 s
[INFO] Finished at: 2021-11-10T03:08:40+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-source-plugin:3.2.1:jar (attach-sources) on project leshan: Execution attach-sources of goal org.apache.maven.plugins:maven-source-plugin:3.2.1:jar failed: Plugin org.apache.maven.plugins:maven-source-plugin:3.2.1 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-source-plugin:jar:3.2.1 -> org.apache.maven:maven-archiver:jar:3.5.0: Failed to read artifact descriptor for org.apache.maven:maven-archiver:jar:3.5.0: Could not transfer artifact org.apache.maven:maven-archiver:pom:3.5.0 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/maven-archiver/3.5.0/maven-archiver-3.5.0.pom: Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.52.215] failed: Connection timed out: connect -> [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/PluginResolutionException

In addition, for maven build,I don’t know what should be set in Goals / Profiles, any suggestions
image

@pioneerAlone
Copy link
Author

Another point:
[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 - core demo [jar]
[INFO] leshan - client demo [jar]
[INFO] leshan - server core demo [jar]
[INFO] leshan - server demo [jar]
[INFO] leshan - bootstrap server demo [jar]
[INFO]
[INFO] ---------------------< org.eclipse.leshan:leshan >----------------------
[INFO] Building leshan 2.0.0-SNAPSHOT [1/14]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven) @ leshan ---
[INFO]
[INFO] -------------------< org.eclipse.leshan:leshan-core >-------------------
[INFO] Building leshan - core 2.0.0-SNAPSHOT [2/14]
[INFO] -------------------------------[ bundle ]-------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven) @ leshan-core ---
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ leshan-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[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 195 source files to E:\work\git_proj\leshan\leshan-core\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for leshan 2.0.0-SNAPSHOT:
[INFO]
[INFO] leshan ............................................. SUCCESS [ 0.495 s]
[INFO] leshan - core ...................................... FAILURE [ 0.723 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 - core demo ................................. SKIPPED
[INFO] leshan - client demo ............................... SKIPPED
[INFO] leshan - server core demo .......................... SKIPPED
[INFO] leshan - server demo ............................... SKIPPED
[INFO] leshan - bootstrap server demo ..................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.348 s
[INFO] Finished at: 2021-11-10T03:43:23+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project leshan-core: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :leshan-core

My eclipse configuration:
image
image

@pioneerAlone
Copy link
Author

I change Jre1.8 to JDK17, it seems to work
image

image
The above figure shows what the current process is and whether it can be done locally to shorten the build time.

@pioneerAlone
Copy link
Author

It seems to be able to build sources now, but build jar package failure, error information is as follows:

[INFO] Reactor Summary for leshan 2.0.0-SNAPSHOT:
[INFO]
[INFO] leshan ............................................. SUCCESS [ 0.554 s]
[INFO] leshan - core ...................................... SUCCESS [ 5.596 s]
[INFO] leshan - core californium .......................... SUCCESS [ 2.462 s]
[INFO] leshan - server core ............................... SUCCESS [ 2.272 s]
[INFO] leshan - server californium ........................ SUCCESS [ 2.818 s]
[INFO] leshan - server redis .............................. SUCCESS [ 2.339 s]
[INFO] leshan - client core ............................... SUCCESS [ 3.943 s]
[INFO] leshan - client californium ........................ SUCCESS [ 2.826 s]
[INFO] leshan - integration tests ......................... SUCCESS [ 0.335 s]
[INFO] leshan - core demo ................................. FAILURE [ 32.780 s]
[INFO] leshan - client demo ............................... SKIPPED
[INFO] leshan - server core demo .......................... SKIPPED
[INFO] leshan - server demo ............................... SKIPPED
[INFO] leshan - bootstrap server demo ..................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 57.091 s
[INFO] Finished at: 2021-11-10T04:42:19+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:buildnumber-maven-plugin:1.4:create (default) on project leshan-core-demo: Execution default of goal org.codehaus.mojo:buildnumber-maven-plugin:1.4:create failed: Plugin org.codehaus.mojo:buildnumber-maven-plugin:1.4 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-project:jar:2.2.1, org.apache.maven:maven-model:jar:2.2.1: Could not transfer artifact org.apache.maven:maven-project:jar:2.2.1 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.2.1/maven-project-2.2.1.jar: Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.196.215] failed: Connection timed out: connect -> [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] Failed to execute goal org.codehaus.mojo:buildnumber-maven-plugin:1.4:create (default) on project leshan-core-demo: Execution default of goal org.codehaus.mojo:buildnumber-maven-plugin:1.4:create failed: Plugin org.codehaus.mojo:buildnumber-maven-plugin:1.4 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-project:jar:2.2.1, org.apache.maven:maven-model:jar:2.2.1: Could not transfer artifact org.apache.maven:maven-project:jar:2.2.1 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.2.1/maven-project-2.2.1.jar: Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.196.215] failed: Connection timed out: connect -> [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
[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/PluginResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :leshan-core-demo

@pioneerAlone
Copy link
Author

With the following configuration, I can build everything, but it seems that the jar file is not generated for "demo_"
image
With the following configuration, I can build everything, but when I execute the package, TEST will be executed every time, and always fail, if it is resolved or how to ignore it.

---------------------< org.eclipse.leshan:leshan >----------------------
[INFO] Building leshan 2.0.0-SNAPSHOT [1/14]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven) @ leshan ---
[INFO]
[INFO] >>> maven-source-plugin:3.2.1:jar (attach-sources) > generate-sources @ leshan >>>
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0: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] -------------------< org.eclipse.leshan:leshan-core >-------------------
[INFO] Building leshan - core 2.0.0-SNAPSHOT [2/14]
[INFO] -------------------------------[ bundle ]-------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven) @ leshan-core ---
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ leshan-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 16 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ leshan-core ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ leshan-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory E:\work\git_proj\leshan\leshan-core\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ leshan-core ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- animal-sniffer-maven-plugin:1.20:check (default) @ leshan-core ---
[INFO] Checking unresolved references to net.sf.androidscents.signature:android-api-level-19:4.4.2_r4
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M5: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.171 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.018 s - in org.eclipse.leshan.core.json.JsonSerializerTest
[INFO] Running org.eclipse.leshan.core.node.codec.LwM2mNodeDecoderTest
[INFO] Tests run: 61, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.044 s - in org.eclipse.leshan.core.node.codec.LwM2mNodeDecoderTest
[INFO] Running org.eclipse.leshan.core.request.ContentFormatTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 s - in org.eclipse.leshan.core.request.ContentFormatTest
[INFO] Running org.eclipse.leshan.core.link.DefaultLinkParserTest
[ERROR] Tests run: 17, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.008 s <<< FAILURE! - in org.eclipse.leshan.core.link.DefaultLinkParserTest
[ERROR] org.eclipse.leshan.core.link.DefaultLinkParserTest.dont_escape_non_ascii_chars Time elapsed: 0.002 s <<< FAILURE!
java.lang.AssertionError: expected:<{param=" ? "}> but was:<{param=" ? "}>
at org.eclipse.leshan.core.link.DefaultLinkParserTest.dont_escape_non_ascii_chars(DefaultLinkParserTest.java:128)

[INFO] Running org.eclipse.leshan.core.datatype.NumberUtilTest
[INFO] Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 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.014 s - in org.eclipse.leshan.core.node.LwM2MResourceTest
[INFO] Running org.eclipse.leshan.core.model.LwM2mModelRespositotyTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.012 s - in org.eclipse.leshan.core.model.LwM2mModelRespositotyTest
[INFO] Running org.eclipse.leshan.core.node.LwM2mParhTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 s - in org.eclipse.leshan.core.node.LwM2mParhTest
[INFO] Running org.eclipse.leshan.core.response.ObserveCompositeResponseTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 s - in org.eclipse.leshan.core.response.ObserveCompositeResponseTest
[INFO] Running org.eclipse.leshan.core.attributes.AttributeSetTest
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 s - in org.eclipse.leshan.core.attributes.AttributeSetTest
[INFO] Running org.eclipse.leshan.core.link.DefaultLinkSerializerTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 s - in org.eclipse.leshan.core.link.DefaultLinkSerializerTest
[INFO] Running org.eclipse.leshan.core.senml.cbor.SenMLJsonSerDesTest
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 s - in org.eclipse.leshan.core.senml.cbor.SenMLJsonSerDesTest
[INFO] Running org.eclipse.leshan.core.json.JsonDeserializerTest
SLF4J: A number (116) 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: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.209 s - in org.eclipse.leshan.core.json.JsonDeserializerTest
[INFO] Running org.eclipse.leshan.core.node.codec.LwM2mNodeEncoderTest
[INFO] Tests run: 22, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.02 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.017 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.009 s - in org.eclipse.leshan.core.attributes.AttributeTest
[INFO] Running org.eclipse.leshan.core.senml.cbor.SenMLCborSerializerTest
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.025 s - in org.eclipse.leshan.core.senml.cbor.SenMLCborSerializerTest
[INFO] Running org.eclipse.leshan.core.link.LinkParserValidationTest
[ERROR] Tests run: 28, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.022 s <<< FAILURE! - in org.eclipse.leshan.core.link.LinkParserValidationTest
[ERROR] org.eclipse.leshan.core.link.LinkParserValidationTest.parse_invalid_formats[8] Time elapsed: 0.006 s <<< FAILURE!
java.lang.AssertionError: expected org.eclipse.leshan.core.link.LinkParseException to be thrown, but nothing was thrown
at org.eclipse.leshan.core.link.LinkParserValidationTest.parse_invalid_formats(LinkParserValidationTest.java:75)

[INFO] Running org.eclipse.leshan.core.tlv.TlvDecoderTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.017 s - in org.eclipse.leshan.core.tlv.TlvDecoderTest
[INFO] Running org.eclipse.leshan.core.model.ValidateModelsTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.433 s - in org.eclipse.leshan.core.model.ValidateModelsTest
[INFO] Running org.eclipse.leshan.core.response.ObserveResponseTest
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 s - in org.eclipse.leshan.core.response.ObserveResponseTest
[INFO] Running org.eclipse.leshan.core.VersionTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 s - in org.eclipse.leshan.core.VersionTest
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] DefaultLinkParserTest.dont_escape_non_ascii_chars:128 expected:<{param=" ? "}> but was:<{param=" ? "}>
[ERROR] LinkParserValidationTest.parse_invalid_formats:75 expected org.eclipse.leshan.core.link.LinkParseException to be thrown, but nothing was thrown
[INFO]
[ERROR] Tests run: 223, Failures: 2, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for leshan 2.0.0-SNAPSHOT:
[INFO]
[INFO] leshan ............................................. SUCCESS [ 0.637 s]
[INFO] leshan - core ...................................... FAILURE [ 3.536 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 - core demo ................................. SKIPPED
[INFO] leshan - client demo ............................... SKIPPED
[INFO] leshan - server core demo .......................... SKIPPED
[INFO] leshan - server demo ............................... SKIPPED
[INFO] leshan - bootstrap server demo ..................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.339 s
[INFO] Finished at: 2021-11-10T05:51:55+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project leshan-core: There are test failures.
[ERROR]
[ERROR] Please refer to E:\work\git_proj\leshan\leshan-core\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :leshan-core

@pioneerAlone
Copy link
Author

The following log comes from command:

#mvn clean install
[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 - core demo [jar]
[INFO] leshan - client demo [jar]
[INFO] leshan - server core demo [jar]
[INFO] leshan - server demo [jar]
[INFO] leshan - bootstrap server demo [jar]
[INFO]
[INFO] ---------------------< org.eclipse.leshan:leshan >----------------------
[INFO] Building leshan 2.0.0-SNAPSHOT [1/14]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ leshan ---
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven) @ leshan ---
[INFO]
[INFO] >>> maven-source-plugin:3.2.1:jar (attach-sources) > generate-sources @ leshan >>>
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0: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.14.5:check (default) @ leshan ---
[INFO] API checks completed without failures.
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ leshan ---
[INFO] Installing E:\work\git_proj\leshan\pom.xml to C:\Users\bakewell.wang.m2\repository\org\eclipse\leshan\leshan\2.0.0-SNAPSHOT\leshan-2.0.0-SNAPSHOT.pom
[INFO]
[INFO] -------------------< org.eclipse.leshan:leshan-core >-------------------
[INFO] Building leshan - core 2.0.0-SNAPSHOT [2/14]
[INFO] -------------------------------[ bundle ]-------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ leshan-core ---
[INFO] Deleting E:\work\git_proj\leshan\leshan-core\target
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven) @ leshan-core ---
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ leshan-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[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 195 source files to E:\work\git_proj\leshan\leshan-core\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ leshan-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory E:\work\git_proj\leshan\leshan-core\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ leshan-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 25 source files to E:\work\git_proj\leshan\leshan-core\target\test-classes
[INFO]
[INFO] --- animal-sniffer-maven-plugin:1.20:check (default) @ leshan-core ---
[INFO] Checking unresolved references to net.sf.androidscents.signature:android-api-level-19:4.4.2_r4
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M5: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.125 s - in org.eclipse.leshan.core.util.X509CertUtilTest
[INFO] Running org.eclipse.leshan.core.json.JsonSerializerTest
SLF4J: A number (112) 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.171 s - in org.eclipse.leshan.core.json.JsonSerializerTest
[INFO] Running org.eclipse.leshan.core.node.codec.LwM2mNodeDecoderTest
[INFO] Tests run: 61, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.052 s - in org.eclipse.leshan.core.node.codec.LwM2mNodeDecoderTest
[INFO] Running org.eclipse.leshan.core.request.ContentFormatTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 s - in org.eclipse.leshan.core.request.ContentFormatTest
[INFO] Running org.eclipse.leshan.core.link.DefaultLinkParserTest
[ERROR] Tests run: 17, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.017 s <<< FAILURE! - in org.eclipse.leshan.core.link.DefaultLinkParserTest
[ERROR] org.eclipse.leshan.core.link.DefaultLinkParserTest.dont_escape_non_ascii_chars Time elapsed: 0.002 s <<< FAILURE!
java.lang.AssertionError: expected:<{param=" ? "}> but was:<{param=" ? "}>
at org.eclipse.leshan.core.link.DefaultLinkParserTest.dont_escape_non_ascii_chars(DefaultLinkParserTest.java:128)

[INFO] Running org.eclipse.leshan.core.datatype.NumberUtilTest
[INFO] Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.014 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.016 s - in org.eclipse.leshan.core.node.LwM2MResourceTest
[INFO] Running org.eclipse.leshan.core.model.LwM2mModelRespositotyTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 s - in org.eclipse.leshan.core.model.LwM2mModelRespositotyTest
[INFO] Running org.eclipse.leshan.core.node.LwM2mParhTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 s - in org.eclipse.leshan.core.node.LwM2mParhTest
[INFO] Running org.eclipse.leshan.core.response.ObserveCompositeResponseTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.011 s - in org.eclipse.leshan.core.response.ObserveCompositeResponseTest
[INFO] Running org.eclipse.leshan.core.attributes.AttributeSetTest
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 s - in org.eclipse.leshan.core.attributes.AttributeSetTest
[INFO] Running org.eclipse.leshan.core.link.DefaultLinkSerializerTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 s - in org.eclipse.leshan.core.link.DefaultLinkSerializerTest
[INFO] Running org.eclipse.leshan.core.senml.cbor.SenMLJsonSerDesTest
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.026 s - in org.eclipse.leshan.core.senml.cbor.SenMLJsonSerDesTest
[INFO] Running org.eclipse.leshan.core.json.JsonDeserializerTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.026 s - in org.eclipse.leshan.core.json.JsonDeserializerTest
[INFO] Running org.eclipse.leshan.core.node.codec.LwM2mNodeEncoderTest
[INFO] Tests run: 22, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.023 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.02 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.012 s - in org.eclipse.leshan.core.attributes.AttributeTest
[INFO] Running org.eclipse.leshan.core.senml.cbor.SenMLCborSerializerTest
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.025 s - in org.eclipse.leshan.core.senml.cbor.SenMLCborSerializerTest
[INFO] Running org.eclipse.leshan.core.link.LinkParserValidationTest
[ERROR] Tests run: 28, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.019 s <<< FAILURE! - in org.eclipse.leshan.core.link.LinkParserValidationTest
[ERROR] org.eclipse.leshan.core.link.LinkParserValidationTest.parse_invalid_formats[8] Time elapsed: 0.006 s <<< FAILURE!
java.lang.AssertionError: expected org.eclipse.leshan.core.link.LinkParseException to be thrown, but nothing was thrown
at org.eclipse.leshan.core.link.LinkParserValidationTest.parse_invalid_formats(LinkParserValidationTest.java:75)

[INFO] Running org.eclipse.leshan.core.tlv.TlvDecoderTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.02 s - in org.eclipse.leshan.core.tlv.TlvDecoderTest
[INFO] Running org.eclipse.leshan.core.model.ValidateModelsTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.356 s - in org.eclipse.leshan.core.model.ValidateModelsTest
[INFO] Running org.eclipse.leshan.core.response.ObserveResponseTest
[INFO] Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 s - in org.eclipse.leshan.core.response.ObserveResponseTest
[INFO] Running org.eclipse.leshan.core.VersionTest
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 s - in org.eclipse.leshan.core.VersionTest
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] DefaultLinkParserTest.dont_escape_non_ascii_chars:128 expected:<{param=" ? "}> but was:<{param=" ? "}>
[ERROR] LinkParserValidationTest.parse_invalid_formats:75 expected org.eclipse.leshan.core.link.LinkParseException to be thrown, but nothing was thrown
[INFO]
[ERROR] Tests run: 223, Failures: 2, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for leshan 2.0.0-SNAPSHOT:
[INFO]
[INFO] leshan ............................................. SUCCESS [ 1.297 s]
[INFO] leshan - core ...................................... FAILURE [ 9.813 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 - core demo ................................. SKIPPED
[INFO] leshan - client demo ............................... SKIPPED
[INFO] leshan - server core demo .......................... SKIPPED
[INFO] leshan - server demo ............................... SKIPPED
[INFO] leshan - bootstrap server demo ..................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.296 s
[INFO] Finished at: 2021-11-10T06:02:57+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project leshan-core: There are test failures.
[ERROR]
[ERROR] Please refer to E:\work\git_proj\leshan\leshan-core\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :leshan-core

@sbernard31 sbernard31 added the question Any question about leshan label Nov 10, 2021
@sbernard31
Copy link
Contributor

When using eclipse IDE, I have encountered some problems, the environment seems to be no problem, but I am not sure how to build the project, I want to build the jar package for a certain demo separately, can I? Or do all builds on root dir leshan?

I never build with maven in Eclipse. I don't get the purpose of this 🤔 unless you want to debug some maven plugin.
I use Eclipse (with m2e) to develop the application and so run/debug it from the IDE and I also use yarn server and vscodium for web UI.
Then when I need to build Leshan I just use maven in a terminal with :

  • mvn clean install : (build everything except redis)

  • mvn clean install -Predis (build everything, redis included but you need a redis server running on localhost)

  • javadoc:javadoc : can be added to also build javadoc

  • -Dskip.yarn : can be used to not build web ui of demos

  • -DskipTests : can be added to skip Tests.

This should be done at root level (at least the first time).
Then if you just modify one maven module you can eventually just build this one. (but this could not work)
You can also try to no use clean all the time but this could also not work sometime.

Personally, I don't need to build often and quickly because my developer flow is in eclipse.
So I use maven just for final build, just before to push to be sure there is no issue and so I do complete clean one.

I change Jre1.8 to JDK17, it seems to work

Yes you need a JDK not a JRE.
It should work with with java 7 and 8 as this is used by our integration builds.
I already tested with java11 and I know java16 was successfully used (#1099)
I never tested it with Java17.

[ERROR] Failures:
[ERROR] DefaultLinkParserTest.dont_escape_non_ascii_chars:128 expected:<{param=" ? "}> but was:<{param=" ? "}>
[ERROR] LinkParserValidationTest.parse_invalid_formats:75 expected org.eclipse.leshan.core.link.LinkParseException to be thrown, but nothing was thrown

I guess this is maybe an encoding issue with ą character ? But It's hard to me to understand as everything should be UTF-8 encoded ... 🤔
You are using windows correct ? which version ? (I don't use windows and never test with it, I also don't have windows machine or VM on which I could test 😖 )
@Michal-Wadowski any idea about this encoding issue ?
Could you comment the line in all the tests where ą character is used ?

Anyway as a workaround you can also eventually use -DskipTests

@sbernard31
Copy link
Contributor

sbernard31 commented Nov 10, 2021

(I just get that was you trying to make it works with java16 (#1099) 😅)

@Michal-Wadowski
Copy link
Contributor

Michal-Wadowski commented Nov 10, 2021

I'm already tested project building with java 16 and java 17 and I don't see any problems. I'm also linux user, so always I tried to build it on linux.

I tried now to build project on windows with java 8 and I see similar problem with ą character. It's interesting, because all the code is in UTF-8, java also supports UTF-8 (it should).

I chose this character in tests to validate functionality with non-standard encoding and till now it works ok. It needs more investigating.

@Michal-Wadowski
Copy link
Contributor

I found the problem: in tests there is used " ą ".getBytes() without specifying the encoding. For the Linux default is UTF-8, but for the Windows is not the case. I'll prepare fix quickly.

@Michal-Wadowski
Copy link
Contributor

There is the fix: #1149

@sbernard31
Copy link
Contributor

I guess there is same issue in : LinkParserValidationTest ?

@Michal-Wadowski
Copy link
Contributor

Good point. I ran all the tests (with only one fix) and all was ok. The LinkParserValidationTest should also be fixed but I didn't noticed that because we expect exception anyway. I'll fix it.

@sbernard31 sbernard31 changed the title Build failure with Esclipse IDE Build failed on windows because of some LinkParser Tests Nov 10, 2021
@sbernard31 sbernard31 added bug Dysfunctionnal behavior core Impact core of Leshan and removed question Any question about leshan labels Nov 10, 2021
@sbernard31
Copy link
Contributor

sbernard31 commented Nov 10, 2021

The LinkParserValidationTest should also be fixed but I didn't noticed that because we expect exception anyway. I'll fix it.

Strangely @pioneerAlone get a :

[ERROR] LinkParserValidationTest.parse_invalid_formats:75 expected org.eclipse.leshan.core.link.LinkParseException to be thrown, but nothing was thrown

(#1147 (comment))

@Michal-Wadowski thx you very much for the investigation and fix about that. 🙏

@pioneerAlone this should works now with master could you check if this work for you now ? 🙏
(if yes you can close this issue)

@pioneerAlone
Copy link
Author

Thanks everyone for support.

When I skip the TEST unit,work fine.

I'll try the latest master again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Dysfunctionnal behavior core Impact core of Leshan
Projects
None yet
Development

No branches or pull requests

3 participants