• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

appreciated/maven-springboot-electron: Package your Java Web Application with El ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

appreciated/maven-springboot-electron

开源软件地址(OpenSource Url):

https://github.com/appreciated/maven-springboot-electron

开源编程语言(OpenSource Language):

JavaScript 57.8%

开源软件介绍(OpenSource Introduction):

Maven + Springboot + Electron (+ OpenJDK)

This project is a starting point to wrap any Java web application (f.e. using Springboot) with Electron as a native executable. For the build process, only Maven is being used. This project contains all the necessary configurations and some placeholder files to get you started.

This project was inspired a lot by electron-java-app, but it has some key differences:

  • Instead of Gradle only Maven is being used (of course also Node but indirectly)
  • When building the Electron application an OpenJDK will be included to start the Java web application

Proof of concept

The purpose of this project was sole of personal interest to show that this concept (Electron -> shipped JDK -> Java Web Application as Jar) is possible. Before taking it into production, you should check your requirements carefully. On one hand, the project is in its current form far from ideal. Electron wastes out of the box a lot of resources on the client-side, shipping an additional JVM and an embedded web server does not make it better (Why would I need a Browser and an OpenJDK just to use a Java Web application as a desktop application?). If it needs to be Java, why not use Swing or JavaFX? But I can imagine some use cases where this could come in handy, f.e. as an in-between solution before migrating to the cloud.
An improvement to the concept could be done by getting rid of the OpenJDK by using native images of the GraalVM. Getting rid of the browser is currently not possible but could also be improved a lot by using tauri instead of Electron. If PWAs get available for all platforms and can run applications running on localhost, the browser could eventually be dropped entirely. Currently, an updater functionality is missing, also logging needs to be done manually.

How to build

mvn clean install -Pproduction

The artifacts from the electron build will be put into:

  • target\electron\springboot-on-electron-darwin-x64
  • target\electron\springboot-on-electron-win32-x64

When using Mac OS or Linux, wine is required to build windows (check the maven build for further information).

When using Windows, admin privileges are required to build darwin (check the maven build for further information).

Shipping OpenJDK

Since not all your users have a JVM available via the classpath an OpenJDK 8 will be packed into the electron builds

Documentation

Build

When executing mvn clean install -Pproduction by default the windows (x64) and darwin (x64) will be built.

The rest is currently not supported but adding those shouldn't be too hard but some changes will need to be made at the following files:

Pull requests are welcome




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap