Dropwizzard bundle filed to build

Hello everyone,

I’ve got a problem while building jar.

[INFO] --- frontend-maven-plugin:1.10.0:npm (build custom model editor) @ graphhopper-web-bundle ---
[DEBUG] Configuring mojo com.github.eirslett:frontend-maven-plugin:1.10.0:npm from plugin realm ClassRealm[plugin>com.github.eirslett:frontend-maven-plugin:1.10.0, parent: sun.misc.Launcher$AppClassLoader@7852e922]
[DEBUG] Configuring mojo 'com.github.eirslett:frontend-maven-plugin:1.10.0:npm' with basic configurator -->
[DEBUG]   (f) arguments = run build
[DEBUG]   (f) installDirectory = /opt/graphhopper/web-bundle
[DEBUG]   (f) npmInheritsProxyConfigFromMaven = true
[DEBUG]   (f) project = MavenProject: com.graphhopper:graphhopper-web-bundle:3.0-SNAPSHOT @ /opt/graphhopper/web-bundle/pom.xml
[DEBUG]   (f) repositorySystemSession = org.eclipse.aether.DefaultRepositorySystemSession@c568f91
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@1a6f5124
[DEBUG]   (f) skipTests = true
[DEBUG]   (f) testFailureIgnore = false
[DEBUG]   (f) workingDirectory = /opt/graphhopper/web-bundle/src/main/js/custom-model-editor
[DEBUG]   (f) execution = com.github.eirslett:frontend-maven-plugin:1.10.0:npm {execution: build custom model editor}
[DEBUG] -- end configuration --
[INFO] Running 'npm run build' in /opt/graphhopper/web-bundle/src/main/js/custom-model-editor
[DEBUG] Executing command line [/opt/graphhopper/web-bundle/node/node, /opt/graphhopper/web-bundle/node/node_modules/npm/bin/npm-cli.js, run, build]
[INFO] 
[INFO] > custom-model-editor@0.0.1 build /opt/graphhopper/web-bundle/src/main/js/custom-model-editor
[INFO] > webpack --mode production
[INFO] 
[INFO] [webpack-cli] Error: For the selected environment is no default script chunk format available:
[INFO] JSONP Array push can be chosen when 'document' or 'importScripts' is available.
[INFO] CommonJs exports can be chosen when 'require' or node builtins are available.
[INFO] Select an appropriate 'target' to allow selecting one by default, or specify the 'output.chunkFormat' directly.
[INFO]     at /opt/graphhopper/web-bundle/src/main/js/custom-model-editor/node_modules/webpack/lib/config/defaults.js:669:11
[INFO]     at F (/opt/graphhopper/web-bundle/src/main/js/custom-model-editor/node_modules/webpack/lib/config/defaults.js:71:15)
[INFO]     at applyOutputDefaults (/opt/graphhopper/web-bundle/src/main/js/custom-model-editor/node_modules/webpack/lib/config/defaults.js:650:2)
[INFO]     at applyWebpackOptionsDefaults (/opt/graphhopper/web-bundle/src/main/js/custom-model-editor/node_modules/webpack/lib/config/defaults.js:182:2)
[INFO]     at createCompiler (/opt/graphhopper/web-bundle/src/main/js/custom-model-editor/node_modules/webpack/lib/webpack.js:78:2)
[INFO]     at create (/opt/graphhopper/web-bundle/src/main/js/custom-model-editor/node_modules/webpack/lib/webpack.js:127:16)
[INFO]     at webpack (/opt/graphhopper/web-bundle/src/main/js/custom-model-editor/node_modules/webpack/lib/webpack.js:135:47)
[INFO]     at WebpackCLI.f [as webpack] (/opt/graphhopper/web-bundle/src/main/js/custom-model-editor/node_modules/webpack/lib/index.js:55:16)
[INFO]     at WebpackCLI.createCompiler (/opt/graphhopper/web-bundle/src/main/js/custom-model-editor/node_modules/webpack-cli/lib/webpack-cli.js:2053:29)
[INFO]     at async WebpackCLI.buildCommand (/opt/graphhopper/web-bundle/src/main/js/custom-model-editor/node_modules/webpack-cli/lib/webpack-cli.js:2173:20)
[INFO] npm ERR! code ELIFECYCLE
[INFO] npm ERR! errno 2
[INFO] npm ERR! custom-model-editor@0.0.1 build: `webpack --mode production`
[INFO] npm ERR! Exit status 2
[INFO] npm ERR! 
[INFO] npm ERR! Failed at the custom-model-editor@0.0.1 build script.
[INFO] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[INFO] 
[INFO] npm ERR! A complete log of this run can be found in:
[INFO] npm ERR!     /root/.npm/_logs/2021-07-09T11_00_38_041Z-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for GraphHopper Parent Project 3.0-SNAPSHOT:
[INFO] 
[INFO] GraphHopper Parent Project ......................... SUCCESS [  0.061 s]
[INFO] GraphHopper API .................................... SUCCESS [  1.040 s]
[INFO] GraphHopper Web API ................................ SUCCESS [  0.612 s]
[INFO] GraphHopper Core ................................... SUCCESS [  3.348 s]
[INFO] GraphHopper Reader for Gtfs Data ................... SUCCESS [  0.195 s]
[INFO] hmm-lib ............................................ SUCCESS [  0.248 s]
[INFO] GraphHopper Map Matching ........................... SUCCESS [  0.304 s]
[INFO] GraphHopper Directions API hand-crafted Java Client. SUCCESS [  0.255 s]
[INFO] GraphHopper Dropwizard Bundle ...................... FAILURE [  6.495 s]
[INFO] GraphHopper Navigation ............................. SKIPPED
[INFO] GraphHopper Web .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  12.916 s
[INFO] Finished at: 2021-07-09T11:00:38Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.10.0:npm (build custom model editor) on project graphhopper-web-bundle: Failed to run task: 'npm run build' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.10.0:npm (build custom model editor) on project graphhopper-web-bundle: Failed to run task

Does anyone knows has a cloue what’s going on? Im building container using docker with openjdk:8-slim image.

Thank you for any help.

This seems to be the problem, something goes wrong when some of the javascript source are bundled. But honestly no idea what this error message means.

Hello!
I am not a developer and I don’t have a lot of experience in Java compiling.
But I faced with the same problem.
From the log I saw that problem is webpack dependency.
I thought that graphopper released at 18 May. And I decided to downgrade version of webpack to version before 18 May and webpack-cli also.
In file /web-bundle/src/main/js/custom-model-editor/package.json
I have changed vesrion of webpack and webpack-cli:
“webpack”: “5.37.0”,
“webpack-cli”: “4.7.0”
And now build is success.
I hope somebody with good expirince can fix it in the rigth way.

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for GraphHopper Parent Project 3.0-SNAPSHOT:
[INFO]
[INFO] GraphHopper Parent Project ......................... SUCCESS [  1.388 s]
[INFO] GraphHopper API .................................... SUCCESS [ 10.414 s]
[INFO] GraphHopper Web API ................................ SUCCESS [ 11.351 s]
[INFO] GraphHopper Core ................................... SUCCESS [ 41.876 s]
[INFO] GraphHopper Reader for Gtfs Data ................... SUCCESS [ 14.027 s]
[INFO] GraphHopper Tools .................................. SUCCESS [ 19.892 s]
[INFO] hmm-lib ............................................ SUCCESS [  7.459 s]
[INFO] GraphHopper Map Matching ........................... SUCCESS [  5.683 s]
[INFO] GraphHopper Directions API hand-crafted Java Client. SUCCESS [  8.143 s]
[INFO] GraphHopper Dropwizard Bundle ...................... SUCCESS [03:08 min]
[INFO] GraphHopper Navigation ............................. SUCCESS [ 10.180 s]
[INFO] GraphHopper Web .................................... SUCCESS [ 36.360 s]
[INFO] GraphHopper Example ................................ SUCCESS [  6.505 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
2 Likes

Thank you, that worked!

Thanks. Yes, apparently this issue comes up with the latest version of webpack-cli. You can use an older version, but I also adjusted the webpack config, which fixed the issue for me (for 3.x here: Setup webpack chunkFormat explicitly · graphhopper/graphhopper@07c3667 · GitHub and for master here: Set webpack output chunk format to array-push explicitly · graphhopper/custom-model-editor@f1a974f · GitHub)

Powered by Discourse