vogler75 / automation-gateway

A OPC UA gateway which gives you access to your OPC UA values via MQTT or GraphQL (HTTP). If you have an OPC UA server in your PLC, or a SCADA system with an OPC UA server, you can query data from there via MQTT and GraphQL (HTTP). In addition, the gateway can also log value changes from OPC UA nodes in an InfluxDB, IoTDB, Kafka, and others.
GNU General Public License v3.0
222 stars 34 forks source link

gradle build on windows 11 #9

Closed manprinsen closed 1 month ago

manprinsen commented 1 month ago

Hi :)

I tried to build the app on my windows 11 machine.

The build seems successfull but the app does not start

PS C:\Users\lemling\SynologyDrive\dev\frankenstein\development\automation-gateway\source\app> gradle build
Starting a Gradle Daemon (subsequent builds will be faster)

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.8/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 18s
39 actionable tasks: 13 executed, 26 up-to-date
PS C:\Users\lemling\SynologyDrive\dev\frankenstein\development\automation-gateway\source\app> java -jar .\build\libs\app.jar    
no main manifest attribute, in .\build\libs\app.jar

In build.gradle i added id 'com.github.johnrengelman.shadow' version '7.1.2' and build the app as shadowJar

PS C:\Users\lemling\SynologyDrive\dev\frankenstein\development\automation-gateway\source\app> gradle shadowJar

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.8/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 18s
36 actionable tasks: 10 executed, 26 up-to-date
<-------------> 0% WAITING
> IDLE
PS C:\Users\lemling\SynologyDrive\dev\frankenstein\development\automation-gateway\source\app> java -jar .\build\libs\app-all.jar
Jul 08, 2024 10:21:57 AM at.rocworks.gateway.core.opcua.KeyStoreLoader load
INFO: Loading Client KeyStore at .\security\rocworks-gateway.pfx
Jul 08, 2024 10:21:57 AM at.rocworks.gateway.core.opcua.KeyStoreLoader load
INFO: Load existing certificate...
Jul 08, 2024 10:21:58 AM at.rocworks.gateway.core.opcua.KeyStoreLoader load
INFO: Loaded certificate.
Loading logging.properties...
Using default logging.properties...

Building as shadowJar seem to do the trick :) But is this a recommended way?

vogler75 commented 1 month ago

In the app/distributions folder you get a zip with everything you need. It also includes a app.bat file to start it. But on windows you may have to replace the content of the CLASSPATH variable with "%APP_HOME%\lib*". Because the string is otherwise too long.

manprinsen commented 1 month ago

oh i see :) thanks very much 🙏