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

About Spring Boot JavaFX Integration #92

Open
zemise opened this issue Dec 25, 2023 · 2 comments
Open

About Spring Boot JavaFX Integration #92

zemise opened this issue Dec 25, 2023 · 2 comments

Comments

@zemise
Copy link

zemise commented Dec 25, 2023

I'm trying use this to packaging my project that use javaFX and sprigboot, but found some problem.

first of all, my project can be packaged to jar and run normally with springboot-plugin. Meantime, It use the maven-jpackage-template also can be packaged to macOS dmg, but when it installed and run , they error notification is: ClassNotFoundException: XXXX.

I try to add <jvm.modules>, like this

before

  <jvm.modules>
            javafx.web,javafx.controls,javafx.fxml
 </jvm.modules>

after

  <jvm.modules>
            javafx.web,javafx.controls,javafx.fxml,java.logging,java.naming,java.sql,java.management,java.security.jgss,java.instrument,
  </jvm.modules>

they do solve some ClassNotFoundException, but still produce new ClassNotFoundException, I have no idea with the problem.

this is my pom.xml, could you give me some advice, thk......

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.1.4</version>
    </parent>

    <groupId>io.github.labcentral</groupId>
    <artifactId>labcentral</artifactId>
    <version>1.0.3</version>

    <!-- This description text is included in the Windows installer by default, see windows-jpackage.txt -->
    <description>For LabCentral use</description>


    <!-- todo:  for now, just not use for packaging  -->
    <name>LabCentral</name>
    <!--  spring-boot-maven-plugin packaging to jar, it can also can set to war  -->
    <packaging>jar</packaging>

    <properties>
        <main-class>io.github.labcentral.LabCentralMain</main-class>
        <start-class>io.github.labcentral.LabCentralMain</start-class>
        <!--  app's name, avoid spaces just to safe for compatibility across operating systems      -->
        <app.name>LabCentral</app.name>
        <!-- This converts the build timestamp to a Windows-installer friendly version number (minute level resolution).
        Note that Maven generated timestamp is in UTC, not local time. For more information see:
         https://docs.microsoft.com/en-us/windows/win32/msi/productversion
         https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/text/SimpleDateFormat.html
         -->
        <app.version>1.0.3</app.version>
        <!-- This property is used to specify the modules included in the (custom) JVM image. -->
        <!-- Reminder: javafx.web (the embedded browser component) is not included in this project by default due
        to GitHub template size restrictions. You can download the full SDK from https://openjfx.io -->
        <!-- ToDo: need to expand      -->
        <jvm.modules>
            javafx.web,javafx.controls,javafx.fxml,java.logging,java.naming,java.sql,java.management,java.security.jgss,java.instrument,
        </jvm.modules>
        <!-- Set the project to UTF-8, avoiding warnings in the build logs -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <maven.compiler.source>18</maven.compiler.source>
        <maven.compiler.target>18</maven.compiler.target>

        <!-- Used to set both the path to find the JavaFX modules and also the versions for Maven dependencies -->
        <javafx.version>18.0.2</javafx.version>
        <mysql.version>8.0.30</mysql.version>

        <!-- Replace this UUID with a custom one for your project. This ID is used by the Windows installer system
        to know that an installer is intended to replace/upgrade an earlier version. The easiest thing to do is
        grab a unique UUID via https://www.uuidgenerator.net -->
        <windows.upgrade.uuid>aaaaaaaa-0000-aaaa-aaaa-aaaaaaaaaaaa</windows.upgrade.uuid>
        <!-- This is used to set many user-visible fields in the Windows Installer. See windows-jpackage.txt -->
        <windows.vendor>Lab</windows.vendor>

        <!-- Empty properties to skip signing by default. Set with the macos-sign Maven profile -->
        <macos.sign></macos.sign>
        <macos.sign.identity></macos.sign.identity>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>

        <!-- openjfx        -->
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>${javafx.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>${javafx.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-web</artifactId>
            <version>${javafx.version}</version>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${mysql.version}</version>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>compile</scope>
            <!--            <scope>runtime</scope>-->
        </dependency>
        <dependency>
            <groupId>org.xerial</groupId>
            <artifactId>sqlite-jdbc</artifactId>
            <version>3.25.2</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate.orm</groupId>
            <artifactId>hibernate-community-dialects</artifactId>
            <scope>compile</scope>
        </dependency>

        <!--  materialFX controllers      -->
        <dependency>
            <groupId>io.github.palexdev</groupId>
            <artifactId>materialfx</artifactId>
            <version>11.17.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.github.palexdev</groupId>
            <artifactId>mfxresources</artifactId>
            <version>11.13.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.github.palexdev</groupId>
            <artifactId>mfxcore</artifactId>
            <version>11.8.0</version>
        </dependency>
        <dependency>
            <groupId>io.github.palexdev</groupId>
            <artifactId>virtualizedfx</artifactId>
            <version>11.9.6</version>
        </dependency>

        <!--   fontawesome    -->
        <dependency>
            <groupId>de.jensd</groupId>
            <artifactId>fontawesomefx-fontawesome</artifactId>
            <version>4.7.0-9.1.2</version>
        </dependency>
    </dependencies>
    <build>
        <extensions>
            <!-- Used to inject the OS and architecture values in a consistent manner -->
            <!-- https://github.com/trustin/os-maven-plugin -->
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>1.7.0</version>
            </extension>
        </extensions>
        <resources>
            <resource>
                <!-- Here we are processing the platform-specific jpackage command files, adding in Maven
                 properties for configuration. -->
                <directory>${project.basedir}/src/packaging</directory>
                <filtering>true</filtering>
                <targetPath>${project.build.directory}/packaging</targetPath>
            </resource>
            <!-- Add the default resource path back in - by overriding above it disables the default -->
            <resource>
                <directory>${project.basedir}/src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>${project.basedir}/src/main/resources/build-info/</directory>
                <filtering>true</filtering>
            </resource>
        </resources>


        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <configuration>
                    <!-- This is an app, so we don't want to install it in the local Maven repository -->
                    <skip>true</skip>
                </configuration>
            </plugin>

            <!--  use spring-boot-maven-plugin to packaging    -->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <!--                    <skip>true</skip>-->
<!--                    <excludes>-->
<!--                        <exclude>-->
<!--                            <groupId>org.projectlombok</groupId>-->
<!--                            <artifactId>lombok</artifactId>-->
<!--                        </exclude>-->
<!--                    </excludes>-->
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <!-- This copies the jar files declared by the Maven build into a single directory.
                        This makes it easy to assemble the final installer package -->
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <!-- Include only compile stage dependencies (no test dependencies) -->
                            <includeScope>compile</includeScope>
                            <!-- The JavaFX libraries are bundled into the custom JVM, so we don't want to duplicate
                            them in the bundled app and installer. This command skips all of the JavaFX by groupId. -->
                            <excludeGroupIds>org.openjfx</excludeGroupIds>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <!-- Put the application jar generated by the project into the dependency folder - the default folder
                for the maven-dependency-plugin output. -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <outputDirectory>${project.build.directory}/dependency</outputDirectory>
                </configuration>
            </plugin>

            <plugin>
                <!-- Plugin to make working with JavaFX nicer. See https://github.com/openjfx/javafx-maven-plugin -->
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.8</version>
                <configuration>
                    <mainClass>${main-class}</mainClass>
                </configuration>
            </plugin>

            <plugin>
                <!-- https://github.com/wiverson/jtoolprovider-plugin -->
                <groupId>io.github.wiverson</groupId>
                <artifactId>jtoolprovider-plugin</artifactId>
                <version>1.0.34</version>
                <executions>
                    <!-- This command runs jlink, generating a custom JVM by combining the JavaFX modules bundled in
                    this project with the JDK modules. -->
                    <execution>
                        <id>jlink</id>
                        <phase>package</phase>
                        <goals>
                            <goal>java-tool</goal>
                        </goals>
                        <configuration>
                            <toolName>jlink</toolName>
                            <removeDirectories>${project.build.directory}/jvm-image/</removeDirectories>
                            <addModules>${jvm.modules}</addModules>
                            <output>${project.build.directory}/jvm-image</output>
                            <args>
                                <arg>--strip-native-commands</arg>
                                <arg>--no-header-files</arg>
                                <arg>--strip-debug</arg>
                                <arg>--no-man-pages</arg>
                                <arg>--compress=2</arg>
                            </args>
                        </configuration>
                    </execution>
                    <!-- The command that actually generates the installer. The options for each platform
                    are found the /src/packaging directory. These files are copied into the target directory by
                    the Maven resources plugin, which does the filtering to replace the original values with
                    the actual Maven properties.

                    https://github.com/wiverson/jtoolprovider-plugin/blob/main/java-tool-doc.md
                    -->
                    <execution>
                        <id>jpackage</id>
                        <phase>install</phase>
                        <goals>
                            <goal>java-tool</goal>
                        </goals>
                        <configuration>
                            <toolName>jpackage</toolName>
                            <writeOutputToLog>true</writeOutputToLog>
                            <writeErrorsToLog>true</writeErrorsToLog>
                            <failOnError>true</failOnError>
                            <removeDirectories>${project.build.directory}/installer-work</removeDirectories>
                            <args>@${project.build.directory}/packaging/${os.detected.name}-jpackage.txt</args>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.10.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.0.0-M1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.2.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>4.0.0-M1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M7</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <!-- todo: for now reporting just not use    -->
    <reporting>

    </reporting>
    <profiles>
        <profile>
            <id>GitHub Run</id>
            <activation>
                <property>
                    <name>env.GITHUB_ACTIONS</name>
                </property>
            </activation>
            <properties>
                <!--suppress UnresolvedMavenProperty -->
                <app.version>1.1.${env.GITHUB_RUN_NUMBER}</app.version>
            </properties>
        </profile>
        <profile>
            <id>Local Development Run</id>
            <activation>
                <property>
                    <name>!env.GITHUB_ACTIONS</name>
                </property>
            </activation>
            <properties>
                <app.version>1.1.0</app.version>
            </properties>
        </profile>


        <!-- We use the built-in Maven profile activation system to set the platform property.
        These properties are then use to build the directory paths to the platform specific resources.
        It would be great if Maven automatically added the os family as a property by default
         -->

        <profile>
            <id>macos-sign</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <macos.sign>--mac-sign</macos.sign>
                <!-- You will have to replace this with your own dev information from your Apple identity -->
                <macos.sign.identity>--mac-signing-key-user-name "Company Name, Inc. (BXPXTXC35S)"</macos.sign.identity>
            </properties>
        </profile>

    </profiles>

</project>

When run packaged app in terminal, Full Error like this;

2023-12-25T22:55:58.637+08:00  INFO 3512 --- [onPool-worker-1] o.s.boot.SpringApplication               : Starting application using Java 21.0.1 with PID 3512 (started by zhaowang in /Users/zhaowang)
2023-12-25T22:55:58.640+08:00  INFO 3512 --- [onPool-worker-1] o.s.boot.SpringApplication               : The following 1 profile is active: "dev"
2023-12-25T22:55:58.974+08:00  INFO 3512 --- [onPool-worker-1] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2023-12-25T22:55:59.001+08:00  INFO 3512 --- [onPool-worker-1] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 23 ms. Found 1 JPA repository interfaces.
2023-12-25T22:55:59.286+08:00  INFO 3512 --- [onPool-worker-1] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8055 (http)
2023-12-25T22:55:59.292+08:00  INFO 3512 --- [onPool-worker-1] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-12-25T22:55:59.292+08:00  INFO 3512 --- [onPool-worker-1] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.13]
2023-12-25T22:55:59.340+08:00  INFO 3512 --- [onPool-worker-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-12-25T22:55:59.341+08:00  INFO 3512 --- [onPool-worker-1] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 671 ms
2023-12-25T22:55:59.444+08:00  INFO 3512 --- [onPool-worker-1] o.s.b.a.h2.H2ConsoleAutoConfiguration    : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:labdb'
2023-12-25T22:55:59.489+08:00  WARN 3512 --- [onPool-worker-1] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactory' parameter 0: Error creating bean with name 'entityManagerFactoryBuilder' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactoryBuilder' parameter 0: Error creating bean with name 'jpaVendorAdapter' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception with message: org/jboss/logging/Logger
2023-12-25T22:55:59.491+08:00  INFO 3512 --- [onPool-worker-1] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2023-12-25T22:55:59.497+08:00  INFO 3512 --- [onPool-worker-1] .s.b.a.l.ConditionEvaluationReportLogger : 

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-12-25T22:55:59.507+08:00 ERROR 3512 --- [onPool-worker-1] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactory' parameter 0: Error creating bean with name 'entityManagerFactoryBuilder' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactoryBuilder' parameter 0: Error creating bean with name 'jpaVendorAdapter' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception with message: org/jboss/logging/Logger
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:801) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:545) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1332) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1162) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1158) ~[spring-context-6.0.12.jar:6.0.12]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) ~[spring-context-6.0.12.jar:6.0.12]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:608) ~[spring-context-6.0.12.jar:6.0.12]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.1.4.jar:3.1.4]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) ~[spring-boot-3.1.4.jar:3.1.4]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439) ~[spring-boot-3.1.4.jar:3.1.4]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-3.1.4.jar:3.1.4]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1309) ~[spring-boot-3.1.4.jar:3.1.4]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1298) ~[spring-boot-3.1.4.jar:3.1.4]
	at de.felixroske.jfxsupport.AbstractJavaFxApplicationSupport.lambda$init$1(AbstractJavaFxApplicationSupport.java:126) ~[labcentral-1.0.3.jar:1.0.3]
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source) ~[na:na]
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(Unknown Source) ~[na:na]
	at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[na:na]
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source) ~[na:na]
	at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source) ~[na:na]
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) ~[na:na]
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) ~[na:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactoryBuilder' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactoryBuilder' parameter 0: Error creating bean with name 'jpaVendorAdapter' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception with message: org/jboss/logging/Logger
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:801) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:545) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1332) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1162) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1417) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:910) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788) ~[spring-beans-6.0.12.jar:6.0.12]
	... 26 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaVendorAdapter' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception with message: org/jboss/logging/Logger
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:654) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:488) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1332) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1162) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1417) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:910) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788) ~[spring-beans-6.0.12.jar:6.0.12]
	... 40 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception with message: org/jboss/logging/Logger
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:171) ~[spring-beans-6.0.12.jar:6.0.12]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:650) ~[spring-beans-6.0.12.jar:6.0.12]
	... 54 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/jboss/logging/Logger
	at org.hibernate.jpa.HibernatePersistenceProvider.<clinit>(HibernatePersistenceProvider.java:38) ~[hibernate-core-6.2.9.Final.jar:6.2.9.Final]
	at org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter.<init>(HibernateJpaVendorAdapter.java:86) ~[spring-orm-6.0.12.jar:6.0.12]
	at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration.createJpaVendorAdapter(HibernateJpaConfiguration.java:137) ~[spring-boot-autoconfigure-3.1.4.jar:3.1.4]
	at org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.jpaVendorAdapter(JpaBaseConfiguration.java:103) ~[spring-boot-autoconfigure-3.1.4.jar:3.1.4]
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:139) ~[spring-beans-6.0.12.jar:6.0.12]
	... 55 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.jboss.logging.Logger
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source) ~[na:na]
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source) ~[na:na]
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source) ~[na:na]
	... 62 common frames omitted
@wiverson
Copy link
Owner

This is the source of the issue - this missing logger class. Caused by: java.lang.ClassNotFoundException: org.jboss.logging.Logger

Not sure off the cuff what you want to do RE: logging, check out https://www.baeldung.com/spring-boot-logging for some tips and ideas.

FWIW you might want to think hard about what you are trying to do combining Spring Boot & a native desktop client. 99% of the you're probably better off just putting up a Spring Boot REST server and then having the desktop client access the API. Lately I've found SvelteKit + Tauri or Capacitor a much easier system for building client apps.

@zemise
Copy link
Author

zemise commented Dec 26, 2023

thanks...

I have solve my issue by manually compile some dependencies. And finally I packaging my springboot-javaFX project to DMG and run app normolly. thanks a lot for your maven-jpackage-template. that very powerful for packaging javaFX project.

I am a beginner in programming,so At present,I just focus on java and javafx, but thanks your advices.

this is my pom.xml with springboot

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.2.1</version>
    </parent>

    <groupId>io.github.labcentral</groupId>
    <artifactId>labcentral</artifactId>
    <version>1.0.3</version>

    <!-- This description text is included in the Windows installer by default, see windows-jpackage.txt -->
    <description>For LabCentral use, design by zemise</description>


    <!-- todo:  for now, just not use for packaging  -->
    <name>LabCentral</name>
    <!--  spring-boot-maven-plugin packaging to jar, it can also can set to war  -->
    <packaging>jar</packaging>

    <properties>
        <main-class>io.github.labcentral.LabCentralMain</main-class>
        <start-class>io.github.labcentral.LabCentralMain</start-class>
        <!--  app's name, avoid spaces just to safe for compatibility across operating systems      -->
        <app.name>LabCentral</app.name>
        <!-- This converts the build timestamp to a Windows-installer friendly version number (minute level resolution).
        Note that Maven generated timestamp is in UTC, not local time. For more information see:
         https://docs.microsoft.com/en-us/windows/win32/msi/productversion
         https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/text/SimpleDateFormat.html
         -->
        <app.version>1.0.3</app.version>
        <!-- This property is used to specify the modules included in the (custom) JVM image. -->
        <!-- Reminder: javafx.web (the embedded browser component) is not included in this project by default due
        to GitHub template size restrictions. You can download the full SDK from https://openjfx.io -->
        <!-- ToDo: need to expand      -->
        <jvm.modules>
            javafx.web,javafx.controls,javafx.fxml,java.logging,java.naming,java.sql,java.management,java.security.jgss,java.instrument,
        </jvm.modules>
        <!-- Set the project to UTF-8, avoiding warnings in the build logs -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <maven.compiler.source>18</maven.compiler.source>
        <maven.compiler.target>18</maven.compiler.target>

        <!-- Used to set both the path to find the JavaFX modules and also the versions for Maven dependencies -->
        <javafx.version>18.0.2</javafx.version>
        <!-- Replace this UUID with a custom one for your project. This ID is used by the Windows installer system
        to know that an installer is intended to replace/upgrade an earlier version. The easiest thing to do is
        grab a unique UUID via https://www.uuidgenerator.net -->
        <windows.upgrade.uuid>aaaaaaaa-0000-aaaa-aaaa-aaaaaaaaaaaa</windows.upgrade.uuid>
        <!-- This is used to set many user-visible fields in the Windows Installer. See windows-jpackage.txt -->
        <windows.vendor>Lab</windows.vendor>

        <!-- Empty properties to skip signing by default. Set with the macos-sign Maven profile -->
        <macos.sign></macos.sign>
        <macos.sign.identity></macos.sign.identity>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- openjfx        -->
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>${javafx.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>${javafx.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-web</artifactId>
            <version>${javafx.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.mysql</groupId>
            <artifactId>mysql-connector-j</artifactId>
            <version>8.2.0</version>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.xerial</groupId>
            <artifactId>sqlite-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.orm</groupId>
            <artifactId>hibernate-community-dialects</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate.common</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
            <version>6.0.6.Final</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml</groupId>
            <artifactId>classmate</artifactId>
            <scope>compile</scope>
        </dependency>

        <!--  materialFX controllers      -->
        <dependency>
            <groupId>io.github.palexdev</groupId>
            <artifactId>materialfx</artifactId>
            <version>11.17.0</version>
            <exclusions>
                <exclusion>
                    <artifactId>javafx-controls</artifactId>
                    <groupId>org.openjfx</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>javafx-fxml</artifactId>
                    <groupId>org.openjfx</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <!--   fontawesome    -->
        <dependency>
            <groupId>de.jensd</groupId>
            <artifactId>fontawesomefx-fontawesome</artifactId>
            <version>4.7.0-9.1.2</version>
        </dependency>
    </dependencies>
    <build>
        <extensions>
            <!-- Used to inject the OS and architecture values in a consistent manner -->
            <!-- https://github.com/trustin/os-maven-plugin -->
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>1.7.0</version>
            </extension>
        </extensions>
        <resources>
            <resource>
                <!-- Here we are processing the platform-specific jpackage command files, adding in Maven
                 properties for configuration. -->
                <directory>${project.basedir}/src/packaging</directory>
                <filtering>true</filtering>
                <targetPath>${project.build.directory}/packaging</targetPath>
            </resource>
            <!-- Add the default resource path back in - by overriding above it disables the default -->
            <resource>
                <directory>${project.basedir}/src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>${project.basedir}/src/main/resources/build-info/</directory>
                <filtering>true</filtering>
            </resource>
        </resources>


        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <configuration>
                    <!-- This is an app, so we don't want to install it in the local Maven repository -->
                    <skip>true</skip>
                </configuration>
            </plugin>

            <!--  use spring-boot-maven-plugin to packaging    -->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <!--  This set when Run main class don't produce packaging jar with spring-boot-maven-plugin  -->
                    <!--                    <skip>true</skip>-->
                    <!--                    <excludes>-->
                    <!--                        <exclude>-->
                    <!--                            <groupId>org.projectlombok</groupId>-->
                    <!--                            <artifactId>lombok</artifactId>-->
                    <!--                        </exclude>-->
                    <!--                    </excludes>-->
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <!-- This copies the jar files declared by the Maven build into a single directory.
                        This makes it easy to assemble the final installer package -->
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <!-- Include only compile stage dependencies (no test dependencies) -->
                            <includeScope>compile</includeScope>
                            <!-- The JavaFX libraries are bundled into the custom JVM, so we don't want to duplicate
                            them in the bundled app and installer. This command skips all of the JavaFX by groupId. -->
                            <excludeGroupIds>org.openjfx</excludeGroupIds>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <!-- Put the application jar generated by the project into the dependency folder - the default folder
                for the maven-dependency-plugin output. -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <outputDirectory>${project.build.directory}/dependency</outputDirectory>
                </configuration>
            </plugin>

            <plugin>
                <!-- Plugin to make working with JavaFX nicer. See https://github.com/openjfx/javafx-maven-plugin -->
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.8</version>
                <configuration>
                    <mainClass>${main-class}</mainClass>
                </configuration>
            </plugin>

            <plugin>
                <!-- https://github.com/wiverson/jtoolprovider-plugin -->
                <groupId>io.github.wiverson</groupId>
                <artifactId>jtoolprovider-plugin</artifactId>
                <version>1.0.34</version>
                <executions>
                    <!-- This command runs jlink, generating a custom JVM by combining the JavaFX modules bundled in
                    this project with the JDK modules. -->
                    <execution>
                        <id>jlink</id>
                        <phase>package</phase>
                        <goals>
                            <goal>java-tool</goal>
                        </goals>
                        <configuration>
                            <toolName>jlink</toolName>
                            <removeDirectories>${project.build.directory}/jvm-image/</removeDirectories>
                            <addModules>${jvm.modules}</addModules>
                            <output>${project.build.directory}/jvm-image</output>
                            <args>
                                <arg>--strip-native-commands</arg>
                                <arg>--no-header-files</arg>
                                <arg>--strip-debug</arg>
                                <arg>--no-man-pages</arg>
                                <arg>--compress=2</arg>
                            </args>
                        </configuration>
                    </execution>
                    <!-- The command that actually generates the installer. The options for each platform
                    are found the /src/packaging directory. These files are copied into the target directory by
                    the Maven resources plugin, which does the filtering to replace the original values with
                    the actual Maven properties.

                    https://github.com/wiverson/jtoolprovider-plugin/blob/main/java-tool-doc.md
                    -->
                    <execution>
                        <id>jpackage</id>
                        <phase>install</phase>
                        <goals>
                            <goal>java-tool</goal>
                        </goals>
                        <configuration>
                            <toolName>jpackage</toolName>
                            <writeOutputToLog>true</writeOutputToLog>
                            <writeErrorsToLog>true</writeErrorsToLog>
                            <failOnError>true</failOnError>
                            <removeDirectories>${project.build.directory}/installer-work</removeDirectories>
                            <args>@${project.build.directory}/packaging/${os.detected.name}-jpackage.txt</args>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.10.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.0.0-M1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.2.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>4.0.0-M1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M7</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <!-- todo: for now reporting just not use    -->
    <reporting>

    </reporting>
    <profiles>
        <profile>
            <id>GitHub Run</id>
            <activation>
                <property>
                    <name>env.GITHUB_ACTIONS</name>
                </property>
            </activation>
            <properties>
                <!--suppress UnresolvedMavenProperty -->
                <app.version>1.1.${env.GITHUB_RUN_NUMBER}</app.version>
            </properties>
        </profile>
        <profile>
            <id>Local Development Run</id>
            <activation>
                <property>
                    <name>!env.GITHUB_ACTIONS</name>
                </property>
            </activation>
            <properties>
                <app.version>1.1.0</app.version>
            </properties>
        </profile>


        <!-- We use the built-in Maven profile activation system to set the platform property.
        These properties are then use to build the directory paths to the platform specific resources.
        It would be great if Maven automatically added the os family as a property by default
         -->

        <profile>
            <id>macos-sign</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <macos.sign>--mac-sign</macos.sign>
                <!-- You will have to replace this with your own dev information from your Apple identity -->
                <macos.sign.identity>--mac-signing-key-user-name "Company Name, Inc. (BXPXTXC35S)"</macos.sign.identity>
            </properties>
        </profile>

    </profiles>

</project>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants