esig / dss-demonstrations

Examples of DSS integration
GNU Lesser General Public License v2.1
92 stars 70 forks source link

Standalone application for Mac OS #48

Open maliffi opened 1 year ago

maliffi commented 1 year ago

Looking at the documentation available at link https://ec.europa.eu/digital-building-blocks/DSS/webapp-demo/signature-standalone it's clear that is available only a version for windows platform. The application nonetheless is written in Java, so it should be independent from running platform.

In order to make it usable on Mac OS Ventura (13), with Chip M1, I downloaded the sources from repo and I tried to compile the project by myself, but I couldn't because the build failed. In order to make it work I needed to perform the following steps, I hope this will be considered to be added into the README to help other people working with Mac OS.

  1. Modify dss-standalone-app pom adding dss repositories:
    <repositories>
        <repository>
            <id>cefdigital-nexus</id>
            <url>https://ec.europa.eu/digital-building-blocks/artifact/content/repositories/esignaturedss</url>
        </repository>
    </repositories>
  2. Increase java fx version:
    <properties>
        <javafx.version>19</javafx.version>
    </properties>
  3. Add the dependency to java fx graphics
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-graphics</artifactId>
            <version>${javafx.version}</version>
        </dependency>
  4. Download java fx 19 (I actually downloaded 20 because 19 produced a runtime error) from https://gluonhq.com/products/javafx/ setting (of course :-) ) MacOS as Operating System and unzip the file to get the folder javafx-sdk-20)
  5. Build and package the application via maven, using java 11 to compile (In case you have another jdk installed, you can use jenv to switch from one jdk to another)
    mvn clean install -pl dss-standalone-app -am -DskipTests=true -U
    mvn clean install -pl dss-standalone-app-package -am -DskipTests=true -U
  6. Using finder go to folder of module dss-standalone-app-package open target folder and unzip the file with complete version (at this moment is dss-standalone-app-package-5.12.RC1-complete-zip.zip) by double clicking on the file
  7. Launch the application:
    cd ./dss-standalone-app-package/target/dss-standalone-app-package-5.12.RC1-complete-zip
    java --module-path ~/Downloads/javafx-sdk-20/lib --add-modules=javafx.fxml,javafx.controls -jar dss-app.jar
slavistan commented 1 year ago

You could have just installed your platform's JRE and used the dss demonstrations bundle as is:

export JAVA_HOME=... # Abspath to your platform's JRE root directory
./apache-tomcat-8.5.82/bin/catalina.sh run # from within the dss-demonstrations directory
maliffi commented 1 year ago

The standalone app, as a matter of fact, is standalone, that is, does not need tomcat. The webapp is based on a obsolete version of Nexu, so it unusable.

slavistan commented 1 year ago

Fair enough, I misread your post and assumed you were interested in the webapp - my bad.

May I ask what you mean by "unusable"? I'm actively using the webapp and it's doing its job just fine.