当前位置: 首页 > 软件库 > Web应用开发 > >

maven-springboot-electron

授权协议 Unlicense License
开发语言 Java
所属分类 Web应用开发
软件类型 开源软件
地区 不详
投 递 者 那利
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

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 configuration 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 a JVM and an embedded web server does not make it better (Why would I need a Browser and a 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 inbetween 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. If PWAs get available for all platforms and can run applications running on localhost, the browser could eventually be dropped. 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 a 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

  • 我在开发一个Electron桌面应用,其中需要连接mysql或oracle数据库,我的方案是用spring boot写了一个restful API服务器,然后在Electron上以网络请求的方式来调用这个服务,现在我希望通过我的应用来任意启动或关闭这个服务,我用maven将这个restful服务打成了个jar包,我该如何启动它呢? 我试着用了nodejs 的child_process 模块,以命令

  • 我在开发一个Electron桌面应用,其中需要连接mysql或oracle数据库,我的方案是用spring boot写了一个restful API服务器,然后在Electron上以网络请求的方式来调用这个服务,现在我希望通过我的应用来任意启动或关闭这个服务,我用maven将这个restful服务打成了个jar包,我该如何启动它呢? 我试着用了nodejs 的child_process 模块,以命令

  • 实现核心功能:完成Linux环境下Springboot自动打包发布功能 详细功能: 自动更新Svn最新代码 删除原有打包文件 自动打包 将打包之后的项目文件复制到其他服务器 关闭本地项目进程 重新启动本地项目服务 使用到的相关技术:SVN,Maven,Spring Boot #!/bin/bash echo "正在获取最新PS3000FS..." svn co https://10.122.111

 相关资料
  • 当试图在eclipse上运行spring boot maven项目时,会出现错误。“启动配置附件引用不存在的项目演示2.”请任何人帮忙修正那个错误。

  • 父项目为demo-mybatis子模块为mybatis-dao、demo-service。demo-mybatis pom.xml如下: 4.0.0 pom mybatis-DAO Demo-service Demo-mybatis-app org.springframework.Boot spring-boot-starter-parent 2.3.2.release com.example D

  • 当运行我的jar文件:java-jar target/places-1.0-snapshot.jar时,我得到了下一个错误: 我的pom.xml包含spring-boot-maven-plugin: 知道我还能试试什么吗?

  • 本文向大家介绍maven+springboot打成jar包的方法,包括了maven+springboot打成jar包的方法的使用技巧和注意事项,需要的朋友参考一下 maven的命令: 1.mvn clean package -DskipTests:在项目目录下运行此命令,在target目录下生成jar包或war包。 2.mvn clean:清理项目生产的临时文件,一般是模块下的target目录 3

  • 我想用Gitlab CI自动构建我的Spring Boot项目,但它给了我以下错误消息。我已经尝试了一些我在这里找到的解决方案,但没有一个对我有效。当我在本地机器上运行时,它运行时没有任何错误。

  • 本文向大家介绍Springboot的maven间接依赖的实现,包括了Springboot的maven间接依赖的实现的使用技巧和注意事项,需要的朋友参考一下 在项目中经常使用 maven 来管理项目,但是有时候对于 maven 的细节还是了解的不是很清楚,因此今天复习下。 maven项目 首先开始建立一个最简单的 maven 项目,其配置如下图: 可以看到最上面一行是 xml 的文件描述符,然后再是