appreciated / maven-springboot-electron Goto Github PK
View Code? Open in Web Editor NEWPackage your Java Web Application with Electron + OpenJDK only using Maven
License: The Unlicense
Package your Java Web Application with Electron + OpenJDK only using Maven
License: The Unlicense
nice template but would be even greater if this would be a maven plugin to reduce boilerplate in pom.xml
Can you please extend your template to build linux binary out-of-the-box
I tried to extend you template to produce linux binary too.
I noticed that in package.json
line 15 the configured platform for electron-packager is darwin
and not linux
You have profile production
to trigger the OS specific bundling.
I would suggest to split them up to
This can speed up the build and gives possibility the align your pipeline to your requirements.
I tried to build and run your app without any modifications. During the first build the following error message appeared:
[ERROR] ======================================================================================================
[ERROR] Failed to determine 'node.exe' tool.
[ERROR] Please install it either:
[ERROR] - by following the https://nodejs.org/en/download/ guide to install it globally
[ERROR] - or by running the frontend-maven-plugin goal to install it in this project:
[ERROR] $ mvn com.github.eirslett:frontend-maven-plugin:1.7.6:install-node-and-npm -DnodeVersion="v10.16.0"
[ERROR] ======================================================================================================
After running the suggested maven-command to install another local node.exe the package can be built and installed.
However after starting the packaged app it does not get past the loading window. The log shows that the npm command is not found. I am confused here. I thought after building the web app in productionmode the dev-updater shoud not be needed anymore.
2020-06-11 02:29:46.468 INFO 15540 --- [main] dev-updater : Updated npm C:\P19125 DDM\git\maven-springboot-electron\target\electron\springboot-on-electron-win32-x64\resources\app\java\package.json.
2020-06-11 02:29:46.474 INFO 15540 --- [main] dev-updater : Running `npm install` ...
2020-06-11 02:29:46.778 ERROR 15540 --- [main] c.v.f.s.frontend.FrontendToolsLocator : Command '[where, npm.cmd]' failed with exit code '1'
2020-06-11 02:29:46.793 ERROR 15540 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Exception sending context initialized event to listener instance of class [com.vaadin.flow.spring.VaadinServletContextInitializer$DevModeServletContextListener]
java.lang.RuntimeException: Unable to initialize Vaadin DevModeHandler
at com.vaadin.flow.spring.VaadinServletContextInitializer$DevModeServletContextListener.contextInitialized(VaadinServletContextInitializer.java:326) ~[vaadin-spring-12.0.6.jar!/:na]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4683) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5146) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_222]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) [na:1.8.0_222]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_222]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) [na:1.8.0_222]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:467) [tomcat-embed-core-9.0.31.jar!/:9.0.31]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:107) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:88) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:438) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:191) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:180) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:153) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544) [spring-context-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at com.github.appreciated.spring.Application.main(Application.java:14) [classes!/:2.0-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_222]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_222]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_222]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_222]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [maven-springboot-electron-2.0-SNAPSHOT.jar:2.0-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [maven-springboot-electron-2.0-SNAPSHOT.jar:2.0-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) [maven-springboot-electron-2.0-SNAPSHOT.jar:2.0-SNAPSHOT]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) [maven-springboot-electron-2.0-SNAPSHOT.jar:2.0-SNAPSHOT]
Caused by: javax.servlet.ServletException: com.vaadin.flow.server.ExecutionFailedException:
======================================================================================================
Failed to determine 'npm.cmd' tool.
Please install it either:
- by following the https://nodejs.org/en/download/ guide to install it globally
- or by running the frontend-maven-plugin goal to install it in this project:
$ mvn com.github.eirslett:frontend-maven-plugin:1.7.6:install-node-and-npm -DnodeVersion="v10.16.0"
======================================================================================================
at com.vaadin.flow.server.startup.DevModeInitializer.initDevModeHandler(DevModeInitializer.java:327) ~[flow-server-2.0.15.jar!/:2.0.15]
at com.vaadin.flow.spring.VaadinServletContextInitializer$DevModeServletContextListener.contextInitialized(VaadinServletContextInitializer.java:323) ~[vaadin-spring-12.0.6.jar!/:na]
... 46 common frames omitted
Caused by: com.vaadin.flow.server.ExecutionFailedException:
======================================================================================================
Failed to determine 'npm.cmd' tool.
Please install it either:
- by following the https://nodejs.org/en/download/ guide to install it globally
- or by running the frontend-maven-plugin goal to install it in this project:
$ mvn com.github.eirslett:frontend-maven-plugin:1.7.6:install-node-and-npm -DnodeVersion="v10.16.0"
======================================================================================================
at com.vaadin.flow.server.frontend.TaskRunNpmInstall.runNpmInstall(TaskRunNpmInstall.java:82) ~[flow-server-2.0.15.jar!/:2.0.15]
at com.vaadin.flow.server.frontend.TaskRunNpmInstall.execute(TaskRunNpmInstall.java:55) ~[flow-server-2.0.15.jar!/:2.0.15]
at com.vaadin.flow.server.frontend.NodeTasks.execute(NodeTasks.java:372) ~[flow-server-2.0.15.jar!/:2.0.15]
at com.vaadin.flow.server.startup.DevModeInitializer.initDevModeHandler(DevModeInitializer.java:322) ~[flow-server-2.0.15.jar!/:2.0.15]
... 47 common frames omitted
Caused by: java.lang.IllegalStateException:
======================================================================================================
Failed to determine 'npm.cmd' tool.
Please install it either:
- by following the https://nodejs.org/en/download/ guide to install it globally
- or by running the frontend-maven-plugin goal to install it in this project:
$ mvn com.github.eirslett:frontend-maven-plugin:1.7.6:install-node-and-npm -DnodeVersion="v10.16.0"
======================================================================================================
at com.vaadin.flow.server.frontend.FrontendUtils.getExecutable(FrontendUtils.java:293) ~[flow-server-2.0.15.jar!/:2.0.15]
at com.vaadin.flow.server.frontend.FrontendUtils.getNpmExecutable(FrontendUtils.java:251) ~[flow-server-2.0.15.jar!/:2.0.15]
at com.vaadin.flow.server.frontend.TaskRunNpmInstall.runNpmInstall(TaskRunNpmInstall.java:79) ~[flow-server-2.0.15.jar!/:2.0.15]
... 50 common frames omitted
2020-06-11 02:29:46.806 ERROR 15540 --- [main] o.apache.catalina.core.StandardContext : One or more listeners failed to start. Full details will be found in the appropriate container log file
2020-06-11 02:29:46.807 ERROR 15540 --- [main] o.apache.catalina.core.StandardContext : Context [] startup failed due to previous errors
2020-06-11 02:29:47.445 INFO 15540 --- [main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2020-06-11 02:29:47.459 WARN 15540 --- [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2020-06-11 02:29:47.481 INFO 15540 --- [main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-06-11 02:29:47.487 ERROR 15540 --- [main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:156) ~[spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544) ~[spring-context-5.2.4.RELEASE.jar!/:5.2.4.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at com.github.appreciated.spring.Application.main(Application.java:14) [classes!/:2.0-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_222]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_222]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_222]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_222]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [maven-springboot-electron-2.0-SNAPSHOT.jar:2.0-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [maven-springboot-electron-2.0-SNAPSHOT.jar:2.0-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) [maven-springboot-electron-2.0-SNAPSHOT.jar:2.0-SNAPSHOT]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) [maven-springboot-electron-2.0-SNAPSHOT.jar:2.0-SNAPSHOT]
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:126) ~[spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:88) ~[spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:438) ~[spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:191) ~[spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:180) ~[spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:153) ~[spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
... 16 common frames omitted
Caused by: java.lang.IllegalStateException: StandardEngine[Tomcat].StandardHost[localhost].TomcatEmbeddedContext[] failed to start
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.rethrowDeferredStartupExceptions(TomcatWebServer.java:171) ~[spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:110) ~[spring-boot-2.2.5.RELEASE.jar!/:2.2.5.RELEASE]
... 21 common frames omitted
Playing around with vaadin and managing to get your templat running on my linux setup I noticed the application does not respond to anything.
Opening the app in browser via localhost:8080
shows a message Cookies deactivated...
This message disappears and the app is back to working as expected when opened via 127.0.0.1:8080
.
Is this a thing or just a symptom at my local machine?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.