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

Ceate native installers does not work after embedding custom ui #1

Open
bj03rnv0ss opened this issue Apr 28, 2017 · 7 comments
Open

Comments

@bj03rnv0ss
Copy link

I am using FXLauncher to enable auto updating my FX Application. I realized the maven build according to the demo project and everything worked fine. As next step I tried to embed a custom ui following the instruccions of the demo video on youtube using the here provided demo project. After adding the additional execution required to embed the custom ui into the fylauncher.jar, the execution of the javapackager to create the native installers isn`t executed any more with the following log:

[INFO] --- exec-maven-plugin:1.6.0:java (create-manifest) @ drive.flashSync ---
[INFO] 
[INFO] --- exec-maven-plugin:1.6.0:exec (embed-manifest-in-launcher) @ drive.flashSync ---
[INFO] 
[INFO] --- exec-maven-plugin:1.6.0:exec (embed-custom-ui-in-launcher) @ drive.flashSync ---
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ drive.flashSync ---
[INFO] Installing C:\flashDrive\SVN\current\JavaFXSyncClient\target\jfx\app\flashSync.jar to C:\Users\bvoss\.m2\repository\de\throne\products\drive.flashSync\4.0.1-SNAPSHOT\drive.flashSync-4.0.1-SNAPSHOT.jar
[INFO] Installing C:\flashDrive\SVN\current\JavaFXSyncClient\pom.xml to C:\Users\bvoss\.m2\repository\de\throne\products\drive.flashSync\4.0.1-SNAPSHOT\drive.flashSync-4.0.1-SNAPSHOT.pom
[INFO] 
[INFO] --- exec-maven-plugin:1.6.0:exec (installer) @ drive.flashSync ---
No base JDK. Package will use system JRE.
No base JDK. Package will use system JRE.
Bundler Windows Application Image skipped because of a configuration problem: Main application jar is missing.  
Advice to fix: Make sure to use fx:jar task to create main application jar.
Bundler EXE Installer skipped because of a configuration problem: Main application jar is missing.  
Advice to fix: Make sure to use fx:jar task to create main application jar.
Bundler MSI Installer skipped because of a configuration problem: Main application jar is missing.  
Advice to fix: Make sure to use fx:jar task to create main application jar.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.415 s
[INFO] Finished at: 2017-04-28T17:38:30-04:00
[INFO] Final Memory: 33M/264M
[INFO] ------------------------------------------------------------------------
@edvin
Copy link
Owner

edvin commented Apr 29, 2017

I'm guessing you didn't embed the code correctly, and ended up with an invalid jar. Can you post the jar and/or the pom.xml here?

@bj03rnv0ss
Copy link
Author

Thank's for the reply, you're right with the invalid jar. The execution adding the custom style classes makes the jar invalid. I can*t figure out why, because I am doing everything exactly as demonstrated in the instruccions. I just added my pom.xml and the resulting invalid fxlauncher.jar.

fxlauncher.zip

@edvin
Copy link
Owner

edvin commented Apr 30, 2017

So what happens is that META-INF/MANIFEST.MF is missing from the jar, so if you run java -jar fxlauncher.jar, it doesn't know what class to start. If you run it with java -cp fxlauncher.jar fxlauncher.Launcher however, it works fine, even including the custom ui.

I'm not sure why that last jar step would remove META-INF/MANIFEST.MF from your jar file, but you can add it back with this command:

jar uef fxlauncher.Launcher fxlauncher.jar

Can you show me the contents (tree) of ${project.basedir}/../fxlauncher-custom-ui/target/classes?

@bj03rnv0ss
Copy link
Author

It might be because the classes folder contains a MANIFEST.MF file too. This MANIFEST ist autogenerated by eclipse within the maven compile phase. But the more probable would be that the existing MANIFEST file if the jar gets overwritten but deleted?!

├───classes
│   │   launcherstyles.css
│   │
│   ├───com
│   │   └───example
│   │       └───launcherui
│   │               CustomLauncherUI.class
│   │
│   └───META-INF
│       │   MANIFEST.MF
│       │
│       ├───maven
│       │   └───no.tornado
│       │       └───fxlauncher-custom-ui
│       │               pom.properties
│       │               pom.xml
│       │
│       └───services
│               fxlauncher.UIProvider

@edvin
Copy link
Owner

edvin commented May 9, 2017

I don't understand how Eclipse is involved in the maven compile phase? Do you have some kind of eclipse specific plugin in your maven config?

@bj03rnv0ss
Copy link
Author

No, there isn't any specific Eclipse plugin in the maven config. I am using your custom ui sample project and also in the pom.xml of my FX application there is nothing depending on eclipse.

What I wanted to say is, that eclipse automatically executes the maven compile phase for every project in the workspace. I hadn't to compile your custom ui example before executing the maven install on my FX application project. The required sources (class files etc.) in the target folder of the custom ui project already existed because of the auto compile.

The target/classes/META-INF folder of the custom ui project contains a MANIFEST.MF file. This could be what's causing the problem when executing the following step in the FX application using fx launcher:

<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>

@timoreichen
Copy link

for others maybe.. doing an install with mvn on eclipse indeed creates an extra Manifest.mf which will then lead to a corrupt jar. mvn install from the console will do the trick. do a clean before: mvn clean install

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

3 participants