JHipster 7.1.0 ReactJS 构建 jar
JHipster 7.1.0 ReactJS building jar
我尝试使用 JHipster 构建一个简单的应用程序。
我使用
创建应用程序
$jhipster
在我使用
添加一些实体之后
$jhipster jdl jhipster-jdl.jdl
一切正常,我可以使用 ./mvnw 启动应用程序并访问它。都很好。
但是当我尝试用
构建一个罐子时
$./mvnw -Pprod verify clean
我尝试在 webpack.prod.js 或 webpack.common.js (https://www.jhipster.tech/production/) 中添加“/hipster/”,但它没有任何改变。
我有错误:
[INFO] > test@0.0.1-SNAPSHOT webapp:build:prod [INFO] > npm run webpack -- --config webpack/webpack.prod.js --progress=profile [INFO]
[INFO] [INFO] > test@0.0.1-SNAPSHOT webpack [INFO] > node
--max_old_space_size=4096 node_modules/webpack/bin/webpack.js "--config" "webpack/webpack.prod.js" "--progress=profile"
[INFO] [webpack-cli] Failed to load '/home/charles/Code/Campus/test/webpack/webpack.prod.js' config
[INFO] [webpack-cli] Error: Cannot find module 'workbox-build/build/options/schema/webpack-generate-sw'
[INFO] Require stack: [INFO] - /home/charles/Code/Campus/test/node_modules/workbox-webpack-plugin/build/generate-sw.js
[INFO] - /home/charles/Code/Campus/test/node_modules/workbox-webpack-plugin/build/index.js
[INFO] - /home/charles/Code/Campus/test/webpack/webpack.prod.js
[INFO] - /home/charles/Code/Campus/test/node_modules/webpack-cli/lib/webpack-cli.js
[INFO] - /home/charles/Code/Campus/test/node_modules/webpack-cli/lib/bootstrap.js
[INFO] - /home/charles/Code/Campus/test/node_modules/webpack-cli/bin/cli.js
[INFO] - /home/charles/Code/Campus/test/node_modules/webpack/bin/webpack.js
[INFO] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
[INFO] at Function.Module._load (internal/modules/cjs/loader.js:746:27)
[INFO] at Module.require (internal/modules/cjs/loader.js:974:19)
[INFO] at require (/home/charles/Code/Campus/test/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
[INFO] at Object. (/home/charles/Code/Campus/test/node_modules/workbox-webpack-plugin/build/generate-sw.js:20:33)
[INFO] at Module._compile (/home/charles/Code/Campus/test/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
[INFO] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
[INFO] at Module.load (internal/modules/cjs/loader.js:950:32)
[INFO] at Function.Module._load (internal/modules/cjs/loader.js:790:14)
[INFO] at Module.require (internal/modules/cjs/loader.js:974:19) {
[INFO] code: 'MODULE_NOT_FOUND',
[INFO] requireStack: [
[INFO] '/home/charles/Code/Campus/test/node_modules/workbox-webpack-plugin/build/generate-sw.js',
[INFO] '/home/charles/Code/Campus/test/node_modules/workbox-webpack-plugin/build/index.js',
[INFO] '/home/charles/Code/Campus/test/webpack/webpack.prod.js',
[INFO] '/home/charles/Code/Campus/test/node_modules/webpack-cli/lib/webpack-cli.js',
[INFO] '/home/charles/Code/Campus/test/node_modules/webpack-cli/lib/bootstrap.js',
[INFO] '/home/charles/Code/Campus/test/node_modules/webpack-cli/bin/cli.js',
[INFO] '/home/charles/Code/Campus/test/node_modules/webpack/bin/webpack.js'
Maven 的错误:
[INFO]
------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 19.942 s [INFO] Finished at:
2021-08-24T08:57:01+02:00 [INFO]
------------------------------------------------------------------------ [ERROR] Failed to execute goal
com.github.eirslett:frontend-maven-plugin:1.12.0:npm (webapp build
prod) on project jhipster: Failed to run task: 'npm run webapp:prod'
failed. org.apache.commons.exec.ExecuteException: Process exited with
an error: 2 (Exit value: 2) -> [Help 1] [ERROR] [ERROR] To see the
full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] [ERROR] For more information about the errors and possible
solutions, please read the following articles: [ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
如果有帮助我在 package.json 中找到了解决方案 我更改了 :
"workbox-webpack-plugin": "6.1.5"
至
"workbox-webpack-plugin": "6.2.4"
我尝试使用 JHipster 构建一个简单的应用程序。 我使用
创建应用程序$jhipster
在我使用
添加一些实体之后$jhipster jdl jhipster-jdl.jdl
一切正常,我可以使用 ./mvnw 启动应用程序并访问它。都很好。 但是当我尝试用
构建一个罐子时$./mvnw -Pprod verify clean
我尝试在 webpack.prod.js 或 webpack.common.js (https://www.jhipster.tech/production/) 中添加“/hipster/”,但它没有任何改变。
我有错误:
[INFO] > test@0.0.1-SNAPSHOT webapp:build:prod [INFO] > npm run webpack -- --config webpack/webpack.prod.js --progress=profile [INFO] [INFO] [INFO] > test@0.0.1-SNAPSHOT webpack [INFO] > node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "--config" "webpack/webpack.prod.js" "--progress=profile"
[INFO] [webpack-cli] Failed to load '/home/charles/Code/Campus/test/webpack/webpack.prod.js' config
[INFO] [webpack-cli] Error: Cannot find module 'workbox-build/build/options/schema/webpack-generate-sw'
[INFO] Require stack: [INFO] - /home/charles/Code/Campus/test/node_modules/workbox-webpack-plugin/build/generate-sw.js
[INFO] - /home/charles/Code/Campus/test/node_modules/workbox-webpack-plugin/build/index.js
[INFO] - /home/charles/Code/Campus/test/webpack/webpack.prod.js
[INFO] - /home/charles/Code/Campus/test/node_modules/webpack-cli/lib/webpack-cli.js
[INFO] - /home/charles/Code/Campus/test/node_modules/webpack-cli/lib/bootstrap.js
[INFO] - /home/charles/Code/Campus/test/node_modules/webpack-cli/bin/cli.js
[INFO] - /home/charles/Code/Campus/test/node_modules/webpack/bin/webpack.js
[INFO] at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
[INFO] at Function.Module._load (internal/modules/cjs/loader.js:746:27)
[INFO] at Module.require (internal/modules/cjs/loader.js:974:19)
[INFO] at require (/home/charles/Code/Campus/test/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
[INFO] at Object. (/home/charles/Code/Campus/test/node_modules/workbox-webpack-plugin/build/generate-sw.js:20:33)
[INFO] at Module._compile (/home/charles/Code/Campus/test/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
[INFO] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
[INFO] at Module.load (internal/modules/cjs/loader.js:950:32)
[INFO] at Function.Module._load (internal/modules/cjs/loader.js:790:14)
[INFO] at Module.require (internal/modules/cjs/loader.js:974:19) {
[INFO] code: 'MODULE_NOT_FOUND',
[INFO] requireStack: [
[INFO] '/home/charles/Code/Campus/test/node_modules/workbox-webpack-plugin/build/generate-sw.js',
[INFO] '/home/charles/Code/Campus/test/node_modules/workbox-webpack-plugin/build/index.js',
[INFO] '/home/charles/Code/Campus/test/webpack/webpack.prod.js',
[INFO] '/home/charles/Code/Campus/test/node_modules/webpack-cli/lib/webpack-cli.js',
[INFO] '/home/charles/Code/Campus/test/node_modules/webpack-cli/lib/bootstrap.js',
[INFO] '/home/charles/Code/Campus/test/node_modules/webpack-cli/bin/cli.js',
[INFO] '/home/charles/Code/Campus/test/node_modules/webpack/bin/webpack.js'
Maven 的错误:
[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 19.942 s [INFO] Finished at: 2021-08-24T08:57:01+02:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.0:npm (webapp build prod) on project jhipster: Failed to run task: 'npm run webapp:prod' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
如果有帮助我在 package.json 中找到了解决方案 我更改了 :
"workbox-webpack-plugin": "6.1.5"
至
"workbox-webpack-plugin": "6.2.4"