When the plugin dependency is managed you can also use the plugin without adding GAV parameters to commands.
E.g. it allows for using it with:
```
mvn i18n:generate-default-translations
```
Related to #2544
Signed-off-by: Wouter Born <github@maindrain.net>
* Add i18n-maven-plugin to make internationalization easier
This plugin simplifies generating the default translation .properties files from the add-on XML information files.
It reuses the same XStream parsing classes that are used by openhab-core for parsing the binding/config/thing XML files.
It will also keep any existing default translations already present in property files for translations using `@text/`.
Furthermore it will nicely group and sort the translations.
After building this Maven plugin you can use it on add-ons using:
`mvn org.openhab.core.tools:i18n-maven-plugin:3.2.0-SNAPSHOT:generate-default-translations`
Signed-off-by: Wouter Born <github@maindrain.net>
The issue occurs when expired entries are removed from the cache.
Also adds some unit tests in which the same issue could be reproduced.
Fixes#2528
Signed-off-by: Wouter Born <github@maindrain.net>
* [marketplace] avoid collisions with multiple AddonProviders
The current implementation could result in collision of file-path and failed in determining the installation status if other AddonProviders re-use the marketplace addon handlers.
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
* New translations audio.properties (Hungarian)
* New translations DefaultSystemChannels.properties (German)
* New translations inbox.properties (Hungarian)
* New translations magic.properties (Hebrew)
* New translations magic.properties (Hungarian)
* New translations magic.properties (Italian)
* New translations marketplace.properties (Hungarian)
* New translations sitemap.properties (Hungarian)
* Fixed unit tests
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Looks like only the POM dependencies are used by the indexer, so the JAR is unused and useless as this warning correctly indicates when you build them:
```
[WARNING] JAR will be empty - no content was marked for inclusion!
```
Signed-off-by: Wouter Born <github@maindrain.net>
* Add ser2net mDNS USB serial discovery
* Add support for using multiple UsbSerialDiscovery services
* Add Ser2NetUsbSerialDiscovery that can use mDNS to discover ser2net RFC2217 serial ports
* Use discovered USB ports in SerialConfigOptionProvider
mDNS discovery is supported in ser2net 4.3.0 and newer.
E.g. you can install a ser2net version that provides this using APT in Ubuntu 21.04 and Debian 11.
Example ser2net YAML configuration that allows a serial port to be discovered using mDNS discovery:
%YAML 1.1
---
connection: &con01
accepter: telnet(rfc2217),tcp,2222
connector: serialdev,/dev/ttyUSB0
options:
mdns: true
mdns-sysattrs: true
mdns-name: devicename
Closes#1511
Signed-off-by: Wouter Born <github@maindrain.net>
* New exception class that incorporates support for internationalization
* Add ConnectionException, CommunicationException and ConfigurationException
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Ignores warnings like:
```
Warning: /home/runner/work/openhab-addons/openhab-addons/bom/runtime-index/pom.xml [0:0]: Unused Export-Package instructions: [org.openhab.*]
Warning: /home/runner/work/openhab-addons/openhab-addons/bom/runtime-index/pom.xml [0:0]: Unused Import-Package instructions: [io.swagger.v3.oas.annotations.*,
```
These are safe to ignore because the import/export packages are globally defined and not every bundle imports/exports all these packages.
The `skipIfEmpty` configuration furthermore prevents warnings when the bnd-maven-plugin runs on projects that don't have any code like BOMs.
More important compiler/SAT warnings standout more when there are there are fewer useless warnings.
Signed-off-by: Wouter Born <github@maindrain.net>
* Checkout merged branches for pull requests
* Echo the mvn command used for builds
* Use more functions in maven-build so it is similar to what will be used for add-on builds
Signed-off-by: Wouter Born <github@maindrain.net>
Update the WebClientFactoryImpl so it no longer uses a deprecated WebSocketClient constructor.
Use a workaround so WebClientFactoryImplTest.tearDown() cannot block forever when the commonWebSocketClient is stopped when it has not yet been fully started.
Signed-off-by: Wouter Born <github@maindrain.net>
There should only be one SLF4J binding used for logging and we already use slf4j-simple.
This fixes the following warning when running unit tests:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/wouter/.m2/repository/org/slf4j/slf4j-simple/1.7.32/slf4j-simple-1.7.32.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/wouter/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
Signed-off-by: Wouter Born <github@maindrain.net>
This helps to identify what tests cause builds to fail and it will more quickly end builds.
For instance the WebClientFactoryImplTest currently often hangs on my local builds.
With this configuration in place it is easy to see and it will timeout after 15 minutes:
[ERROR] Tests run: 5, Failures: 0, Errors: 1, Skipped: 4, Time elapsed: 900.207 s <<< FAILURE! - in org.openhab.core.io.net.http.internal.WebClientFactoryImplTest
[ERROR] org.openhab.core.io.net.http.internal.WebClientFactoryImplTest.testGetClients Time elapsed: 900.194 s <<< ERROR!
java.util.concurrent.TimeoutException: tearDown() timed out after 15 minutes
See: https://junit.org/junit5/docs/current/user-guide/#writing-tests-declarative-timeouts
Signed-off-by: Wouter Born <github@maindrain.net>
This PR adds a CI build using GitHub Actions.
Besides having a backup for Jenkins, it will also make it easy for contributors to use a GitHub Actions build with their fork.
It features the following:
* Uncluttered simple build progress like we used with Travis CI
* Uploads the full build log and SAT summary report so they can be downloaded for further analysis
* Uses a Maven repository cache to speed up builds (first build takes a bit longer)
* Has some maven.wagon configuration options to prevent Maven Central artifact download issues from Azure
* Uses a matrix so we can easily add builds for other OS-es or newer Java LTS versions in the future
Signed-off-by: Wouter Born <github@maindrain.net>
New ItemChannelLinkProviders are added asynchronously to the ItemChannelLinkRegistry, which can cause this test to fail:
TEST org.openhab.core.io.rest.core.internal.link.ItemChannelLinkResourceOSGiTest#shouldReturnLinks() <<< ERROR:
Expected: a collection with size <3>
but: collection size was <0>
java.lang.AssertionError:
Expected: a collection with size <3>
but: collection size was <0>
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:6)
at org.openhab.core.io.rest.core.internal.link.ItemChannelLinkResourceOSGiTest.shouldReturnLinks(ItemChannelLinkResourceOSGiTest.java:109)
Signed-off-by: Wouter Born <github@maindrain.net>
* Exclude JUnit 4 from Whiteboard and update imports to JUnit 5
Excludes the transitive JUnit 4 dependency from the Aries JAX-RS Whiteboard.
The Whiteboard should not have a compile scope dependency on JUnit so I've created https://github.com/apache/aries-jax-rs-whiteboard/pull/135 to fix this.
The wrong scope has resulted in some tests using JUnit 4 imports which is also fixed in this PR.
Signed-off-by: Wouter Born <github@maindrain.net>
* Add commonly used JUnit 4 classes to forbidden packages
Signed-off-by: Wouter Born <github@maindrain.net>
When I ported over the code from the HABPanel gallery which was also
based on Discourse topics, the image_link field that was present on
topic lists wasn't replicated on single topic entries, but now it is:
See
https://meta.discourse.org/t/single-topic-api-endpoint-should-contain-image-url/1310203201613f13
I have confirmed the field is present on community.openhab.org.
So this should help moving the "primary image" to the place where
the logo should be in the UI.
We can prevent the same image from being displayed twice with some
measures on the Discourse posts themselves
(like have it between <details></details>).
Signed-off-by: Yannick Schaus <github@schaus.net>
* New translations brokerConnectionInstance.properties (Russian)
* New translations DefaultSystemChannels.properties (Russian)
* New translations firmware.properties (Russian)
* New translations inbox.properties (Russian)
* New translations LanguageSupport.properties (Russian)
* New translations restauth.properties (Russian)
* New translations SystemProfiles.properties (Russian)
* New translations tags.properties (Russian)
* New translations voice.properties (Russian)
The XStream.setupDefaultSecurity method is deprecated since XStream 1.4.18.
It no longer does anything, because this is the default in newer XStream versions.
Signed-off-by: Wouter Born <github@maindrain.net>
* Improve exception handling
* Add transparent themes
* Add null annotations
* Use java.time classes instead of Date and magic numbers
* Upgrade XChart to 3.1.0
* Fix buggy legend position logic:
Reinitialize counter to 0. So it does not work on legend position counter values of previously created charts.
Use a local variable for the position counter instead of a field. This prevents issues when creating multiple charts simultanuously.
For XChart release notes see:
https://knowm.org/open-source/xchart/xchart-change-log/
On newer XChart versions there is an issue when using customized grid lines:
https://github.com/knowm/XChart/issues/628Fixes#1183
Related to #2501
Supersedes #2415
Signed-off-by: Wouter Born <github@maindrain.net>