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
It is not possible to place .appex files beforehand in a particular folder so that they can be placed automatically in Plugins folder of app during the build process(OSX) #235
Comments
Some reference: http://stackoverflow.com/q/39539031/1961102 Can you describe this a bit more? Where do you want that .appex-files being in what folder, and when? Maybe a small demo-project would be nice to have a more appropriate support from me. |
Have you looked into the javafx-maven-plugin/src/main/java/com/zenjava/javafx/maven/plugin/NativeMojo.java Line 210 in 3d2a4b9
|
Hi, i may have an idea what this is about, but just to be sure: please post the pom-file nox as docx-file-format, the xml-file as is should be okay, or just inline this content. Makes it more secure for me (opening foreign files can be dangerous) and makes it searchable for others having similar questions/problems. So to sum up, you need to have these appex-files not being inside the application-folder, but as part of you "whole-bundle", right? What Bundler are you using? Do you want to generate some DMG-file or PKG-file (aka "installer")? |
Hi , |
I will take a deep look into placing files outside the "Application" itself on MacOSX-bundlers. If I find something, I will report back. (I think this time I fully understood your idea/feature-request) |
Thankyou so much . I will be waiting to hear back from you soon |
I might have found a way, bit it gets tricky, and needs proper implementation for being compatible down to 1.8.0_20, don't expect this to be done within the next two days, it is more likely that this will be implemented next week. Or not even be implemented, this is currently just an idea which I have to try first, it even is possible that this will result in some new JDK-bug entry. This feature is not possible out-of-the-box, but might be another point for using this maven-plugin ;) EDIT: another reason why opening an issue rather than opening an stackoverflow-thing ;) |
Hi , Did you get a chance to look into this ? |
Yes, the solution I was thinking of seems to work, but this week was really hard for me, and I'm implementing some new stuff I'm going to release in the next time. On the upcoming weekend I hope to find the time to implement this. Sorry for having no feedback for such a long time. |
If everything works out as planned, this will get available as some snapshot-version tomorrow |
Hi @yuktikapahwa , can you try the current snapshopt-version
The same goes for the additional |
If this does not work, I might need some other tweaks, just report any problem back here :) |
Oh, you might need to duplicate some of your files, because every bundler has its own folder (I just re-read this thread to not miss anything)! |
Hi , Thankyou for your reply. Found additional bundler resources, trying to copy all files into build root. But this is not resolving the problem because we want these Plugins and Resources files to be placed inside the app not in any temp location. |
Thanks for testing this. What bundler did you use for this? The "pkg"-bundler? There should have been some output like |
Your screenshots are really worth it 👍 I didn't realized that mac-applications like this (using the "mac.app"-bundler) behave like "installers". (I really need to find some cheap one ...) It is not possible to have this working with the "mac.app"-bundler, because it is deleting the target-folder. You are required to use "mac.appStore", "dmg" or "pkg" (these are the internal IDs of the bundlers, so you need to create folders with these names below The ".app"-folder is expected to not work ... sry, but the JDK does not give this feature to us ... I'm glad I found some way for the installers tho. |
So you mean to say , if i add a tag in my plugin configuration as pkg It should work? |
It only works with installers :/ yes, but you still won't find that files inside that ".app"-folder ... |
Oh, I suspected some setup there, my fault of wrong thinking ;) This is no magic of the javafx-maven-plugin, but from the javapackager itself. It tries to "find" some cerfificate matching via Please try to add |
I have got some time assigned for my self to resolve this task. Will continue on this tomorrow and try what you told me to try. Will get back to you in 15 houtrs :) |
Hi @FibreFoX , I am attaching the first three lines of the logs . May be it is of any help |
Can you see in the above logs , it says that it is already signed and then it breaks after that.The most weird part is , when it is trying to code sign the .appex file , it prints that it is already code signed whereas it is not and then it breaks after that. |
Hm... so you did made that "A.app" with the bundler and (after it failing) you were running |
yes...from the CLI , it worked . The same codesign command to codesign the appex file works from the CLI but not from the plugin. |
That's something I can work with :) and will report back when I found the problem. But one last thing: can you try to skip signing, by setting |
I am sorry , where is this |
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.8.0-SNAPSHOT</version>
<configuration>
<mainClass>com.a.application.A</mainClass>
<deployDir>${project.basedir}/deploy</deployDir>
<!-- ... -->
<!-- other stuff -->
<!-- ... -->
<bundleArguments>
<signBundle>false</signBundle>
</bundleArguments>
</configuration>
</plugin> |
Correct.
|
This sounds wonderful, even when we are not finished yet! Just to confirm: after bundling the non-signed app, did you try to manually sign that app-bundle using the CLI-commands? And if so, did it work? (Just making sure I get it right, so sorry if I'm asking some questions again and again) If so, this means I "only" have to track down the problem with signing, and it means that everything else now is working. |
Hi @FibreFoX,
Whereas in order to perfectly codesign the appex bundle the command should be as below |
The thing is, I am not responsible for these You are right, I dont know that mac-contept of "sandboxing", all I understood is, that it requires these application-bundles to be signed in a special way, so that gatekeeper (or whatever security-system is in place) gives that application access to the system. Just a guess: if you do not add that plugin-file, creating that bundle without signing, does it work if you manually sign that thing afterwards? |
What I am going to try for you is - I have removed the plugins folder from the deploy/bundlers/mac.app .Now I am letting the app build with the code signing set to true . Let us now see if the code signing succeeds and the app builds perfectly . I will not do any manual business here. |
No need to get picky, I'm not using Mac nor am I planing to do on a daily basis. All this here is done in my spare-time. I understand that it might sound like I'm letting you do the hard work, but trust me, I easily could just say "then dont sign that app". The flaw/bug is inside the JDK, I'm doing magic and monkeyworking here to get this thing to work. If you can share a way to me, how I can create a signing certificate without the need to pay that developer account fee, I am willing to take more work on my shoulders. I never did mac-development, nor am I planing to do so ... so please don't make our frustration about this issue (which has a comment-count over 100 ... and a high life-count) increasing more. (sorry, but I felt to release some steam about it .... I'm still willing to nail that bug down!!!) |
Oh my god , I am taken aback now.
This means there is some other issue as well. |
When I try to launch the jar present inside my application a.app from the CLI using java -jar command , it launches perfectly fine . But double clicking and running the app is not doing anything. |
hm ... the log you provided looks like there is a problem with the JRE ?! I will compare some stuff inside the MacApp-bundler and the MacAppStore-bundler, I'm suspecting some clue in there. The "problem" is the requirement on mac, not the java-part so it is expected to work when you |
hmm..right. |
I now have created some apple account and registered to be part of the developer-programm. After downloading XCode, I started XCode, went to Settings > Accounts, added my fresh Apple ID and created some "Mac Development"-signing identity ... just to have some signing-key inside my local keystore. Then I added this to my pom.xml <bundleArguments>
<mac.signing-key-developer-id-app>Mac Development:</mac.signing-key-developer-id-app>
</bundleArguments> to make sure it gets picked up for codesigning. Everything went okay while signing, but the application crashed on execution ... I really don't know why, but calling The thing is, signing seems to work for me, but I haven't yet added some appex-file (which I even don't know how to create). I checked that I used And I'm running out of ideas currently ... do you have any? |
@yuktikapahwa |
Hello
<!-- Use the javafx maven plugin to produce jar/native output -->
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.5.0</version>
<configuration>
<mainClass>com.a.application.A</mainClass>
<deployDir>${project.basedir}/deploy</deployDir>
<needShortcut>true</needShortcut>
<appName>${target.name}</appName>
<jfxMainAppJarName>a-jfx.jar</jfxMainAppJarName>
<!-- Verbose logs while building the application -->
<verbose>true</verbose>
<vendor>${target.publisher}</vendor>
<!-- The 'app' output directory. This is where the base executable JavaFX
jar is built into, along with any dependent libraries (place in the 'lib'
sub-directory). The resulting JAR in this directory will be ready for distribution,
including Pre-Loaders, signing, etc. -->
<jfxAppOutputDir>${project.build.directory}/jfx/app</jfxAppOutputDir>
<!-- Files and directories in this directory will be copied to the jfxAppOutputDir. -->
<additionalAppResources>${project.build.directory}/resources/macosx/</additionalAppResources>
<jvmArgs>
<argument>-Xmx512m</argument>
</jvmArgs>
</configuration>
<!-- For the javafx maven plugin execute the following phases -->
<executions>
<!-- Package Phase : The app build a jar -->
<execution>
<id>create-jfxjar</id>
<phase>package</phase>
<goals>
<goal>build-jar</goal>
</goals>
</execution>
<!-- Package Phase : Post creating the jar create the native package -->
<execution>
<id>create-native</id>
<phase>package</phase>
<goals>
<goal>build-native</goal>
</goals>
</execution>
</executions>
</plugin>
<pluginRepositories>
<pluginRepository>
<id>oss-sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories> <!-- Use the javafx maven plugin to produce jar/native output -->
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.8.0-SNAPSHOT</version>
<configuration>
<mainClass>com.a.application.A</mainClass>
<deployDir>${project.basedir}/deploy</deployDir>
<needShortcut>true</needShortcut>
<appName>${target.name}</appName>
<jfxMainAppJarName>a-jfx.jar</jfxMainAppJarName>
<!-- Verbose logs while building the application -->
<verbose>true</verbose>
<vendor>${target.publisher}</vendor>
<!-- The 'app' output directory. This is where the base executable JavaFX
jar is built into, along with any dependent libraries (place in the 'lib'
sub-directory). The resulting JAR in this directory will be ready for distribution,
including Pre-Loaders, signing, etc. -->
<jfxAppOutputDir>${project.build.directory}/jfx/app</jfxAppOutputDir>
<!-- Files and directories in this directory will be copied to the jfxAppOutputDir. -->
<additionalAppResources>${project.build.directory}/resources/macosx/</additionalAppResources>
<additionalBundlerResources>${project.basedir}/deploy/bundlers</additionalBundlerResources>
<bundleArguments>
<signBundle>false</signBundle>
</bundleArguments>
<jvmArgs>
<argument>-Xmx512m</argument>
</jvmArgs>
</configuration>
<!-- For the javafx maven plugin execute the following phases -->
<executions>
<!-- Package Phase : The app build a jar -->
<execution>
<id>create-jfxjar</id>
<phase>package</phase>
<goals>
<goal>build-jar</goal>
</goals>
</execution>
<!-- Package Phase : Post creating the jar create the native package -->
<execution>
<id>create-native</id>
<phase>package</phase>
<goals>
<goal>build-native</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> What I feel is , something changed between the 8.5.0. and 8.8.0- SNAPSHOT version which is causing these issues. Is there a way you can do a compare and find out what changed. |
I have checked the difference, but their are not even near the JRE-creation: javafx-maven-plugin-8.5.0...master |
Sure . |
@yuktikapahwa just a quick question: I would like to CLOSE this issue, because it is now possible to place .appex-files into the app-bundle, remaining the problems with signing. But this might be a different problem, do you feel okay about me closing this issue and opening a follow-issue? (Haven't forgotten about this issue, just distracted with some other stuff currently) |
Hi @FibreFoX , Sorry for getting back to you late. |
@yuktikapahwa the changes got released with 8.8.0, will investigate about the remaining problem with signing in a different issue-ticket, |
There should be a common folder in JavaFX maven plugin for placing the .appex file initially so that it picks it up from there and places it automatically into the Plugins folder during the build process.
Currently , I have to write a script to copy the .appex file inside the Plugins folder after the application is built by the JAVAFX Maven Plugin.
This needs to be resolved.
The text was updated successfully, but these errors were encountered: