fxlauncher
fxlauncher copied to clipboard
No conf folder exists
I'm new to JavaFx and in Maven. I used FXLauncher to do automatic updates. Everything works great. But I have one question, after executing the package I have a conf folder where I have the properties files and the lib folder where I have dependencies. After creating a native installer and run, in "USERLIB / myApp" I only have the lib folder. There is no conf folder. Here's my main pom.xml
<build>
<plugins>
<!-- Copy dependencies to appdir -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven.dependency.plugin.version}</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<excludeScope>provided</excludeScope>
<outputDirectory>${app.dir}/lib</outputDirectory>
<stripVersion>true</stripVersion>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
<executions>
<execution>
<id>copy-resources</id>
<!-- here the phase you need -->
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${app.dir}/conf</outputDirectory>
<resources>
<resource>
<directory>src/main/resources/conf</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven.jar.plugin.version}</version>
<configuration>
<outputDirectory>${app.dir}</outputDirectory>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>pl.qweb.fpApp.coreMain.view.MainApp</mainClass> <classpathLayoutType>custom</classpathLayoutType> <customClasspathLayout>./lib/$${artifact.artifactId}.$${artifact.extension}</customClasspathLayout>
</manifest>
<manifestEntries>
<Class-Path>./conf/</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>**/*.properties</exclude>
</excludes>
</resource>
</resources>
</build>
<modules>
<module>coreMain</module>
<module>administrator</module>
<module>coreInterface</module>
<module>mod1</module>
<module>coreLauncher</module>
</modules>
<organization>
<name>qweb.pl</name>
</organization>
<description>App fpApp</description>
<scm>
<developerConnection>Grzegorz Viola (qweb)</developerConnection>
</scm>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${logging.log4j.version}</version>
</dependency>
<dependency>
<groupId>org.controlsfx</groupId>
<artifactId>controlsfx</artifactId>
<version>${controlsfx.version}</version>
</dependency>
<dependency>
<groupId>no.tornado</groupId>
<artifactId>fxlauncher</artifactId>
<version>${fxlauncher.version}</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>${oracle.jdbc.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
And this is my jar pom.xml
<properties>
<!-- Configuration for fxlauncher -->
<exec.maven.plugin.version>1.4.0</exec.maven.plugin.version>
<!-- Installer Filename without suffix -->
<app.filename>FpApp</app.filename>
<!-- The JavaFX Application class name -->
<app.mainClass>pl.qweb.fpApp.coreMain.view.MainApp</app.mainClass>
<!-- Optional override to specify where the cached files are stored. Default is current working directory -->
<app.cacheDir>USERLIB/FpApp</app.cacheDir>
<!-- The Application vendor used by javapackager -->
<app.vendor>Grzegorz Viola (qweb.pl)</app.vendor>
<!-- The Application version used by javapackager -->
<app.version>0.0.0</app.version>
<!-- Base URL where you will host the application artifacts -->
<app.url>http://fp.qweb.pl/</app.url>
<!-- Optional scp target for application artifacts hosted at the above url -->
<app.deploy.target>[email protected]:/usr/local/fpApp</app.deploy.target>
<!-- The app and launcher will be assembled in this folder -->
<app.dir>${project.build.directory}/app</app.dir>
<!-- Native installers will be built in this folder -->
<app.installerdir>${project.build.directory}/installer</app.installerdir>
<!-- Should the client downgrade if the server version is older than the local version? -->
<app.acceptDowngrade>false</app.acceptDowngrade>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>${maven.javafx.plugin.version}</version>
<configuration>
<vendor>Grzegorz Viola (qweb)</vendor>
<mainClass>pl.qweb.fpApp.coreMain.view.MainApp</mainClass>
</configuration>
<executions>
<execution>
<!-- required before build-native -->
<id>create-jfxjar</id>
<phase>package</phase>
<goals>
<goal>build-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<!-- Generate app.xml manifest -->
<executions>
<execution>
<id>create-manifest</id>
<phase>package</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>fxlauncher.CreateManifest</mainClass>
<arguments>
<argument>${app.url}</argument>
<argument>${app.mainClass}</argument>
<argument>${app.dir}</argument>
<argument>--cache-dir=${app.cacheDir}</argument>
<argument>--accept-downgrade=${app.acceptDowngrade}</argument>
<argument>--include-extensions=jpg</argument>
<argument>${app.parameters}</argument>
</arguments>
</configuration>
</execution>
<!-- Embed app.xml inside fxlauncher.xml so we don't need to reference app.xml to start the app -->
<execution>
<id>embed-manifest-in-launcher</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>jar</executable>
<workingDirectory>${app.dir}</workingDirectory>
<arguments>
<argument>uf</argument>
<argument>/lib/fxlauncher.jar</argument>
<argument>app.xml</argument>
</arguments>
</configuration>
</execution>
<!-- Optional step to include custom UI, see https://github.com/edvin/fxlauncher-custom-ui -->
<!--<execution>-->
<!--<id>embed-custom-ui-in-launcher</id>-->
<!--<phase>package</phase>-->
<!--<goals>-->
<!--<goal>exec</goal>-->
<!--</goals>-->
<!--<configuration>-->
<!--<executable>jar</executable>-->
<!--<workingDirectory>${app.dir}</workingDirectory>-->
<!--<arguments>-->
<!--<argument>uf</argument>-->
<!--<argument>fxlauncher.jar</argument>-->
<!--<argument>-C</argument>-->
<!--<argument>${project.basedir}/../fxlauncher-custom-ui/target/classes</argument>-->
<!--<argument>.</argument>-->
<!--</arguments>-->
<!--</configuration>-->
<!--</execution>-->
<!-- Create native installer. Feel free to add more arguments as needed.
https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javapackager.html
-->
<execution>
<id>installer</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>javapackager</executable>
<arguments>
<argument>-deploy</argument>
<argument>-native</argument>
<argument>-outdir</argument>
<argument>${app.installerdir}</argument>
<argument>-outfile</argument>
<argument>${app.filename}</argument>
<argument>-srcdir</argument>
<argument>${app.dir}</argument>
<argument>-srcfiles</argument>
<argument>/lib/fxlauncher.jar</argument>
<argument>-appclass</argument>
<argument>fxlauncher.Launcher</argument>
<argument>-name</argument>
<argument>${project.name}</argument>
<argument>-title</argument>
<argument>${project.name}</argument>
<argument>-vendor</argument>
<argument>${app.vendor}</argument>
<argument>-BappVersion=${app.version}</argument>
<argument>-Bidentifier=${project.groupId}.${project.artifactId}</argument>
</arguments>
</configuration>
</execution>
<!-- Copy application artifacts to remote site using scp (optional) -->
<execution>
<id>deploy-app</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>scp</executable>
<arguments>
<argument>-r</argument>
<argument>target/app/.</argument>
<argument>${app.deploy.target}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>pl.qweb.fpApp</groupId>
<artifactId>administrator</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>pl.qweb.fpApp</groupId>
<artifactId>mod1</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>org.controlsfx</groupId>
<artifactId>controlsfx</artifactId>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
</dependency>
<dependency>
<groupId>no.tornado</groupId>
<artifactId>fxlauncher</artifactId>
</dependency>
</dependencies>
<description>Moduł odpowiedzialny za urruchomienie i ustawienie szkieletu aplikacji.</description>
</project>
This is the structure of the $ {app.dir} folders, after the package has been executed and is identical to the one deployed at the remote location.
This is the structure of the native installer
Thank you for your help
I have the same problem, I have a folder with a bunch of groovy scripts that I'd like to get updated with the jar. I could package the scripts in the jar, but the whole point of having groovy scripts was so that end users could easily change stuff, which wouldn't be possible with them packed in as resources EDIT: fixed it
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${app.dir}/groovy</outputDirectory>
<resources>
<resource>
<directory>groovy</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
The conf
folder is created on demand by TornadoFX whenever a config setting is stored. Until you save your first config setting there is no need for the folder, seen from the framework's perspective. However, there is nothing magical about that folder and you can create it manually.
That said, I don't think it's a good idea to put other stuff than what the framework expects in that conf folder. I would recommend that you make your own folder for those scripts. Reusing the conf folder will not give you anything special :)