spring-boot - 使用 Github Action CI/CD 时构建失败
问题描述
我正在使用 CI CD Github Action 进行构建,但我的构建在 github 上的分支失败。这是我遇到的错误:
Error: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.11.2:npm (npm run build) on project demo: Failed to run task: 'npm run build' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [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/.../MAVEN/MojoFailureException
Error: Process completed with exit code 1.
我尝试在本地运行 npm run build ,它工作得很好。
解决方案
进入你的 pom.xml 文件,如果你的代码是这样的
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
...
<execution>
<id>npm audit fix</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
...
</plugin>
删除<configuration>...</configuration>
部分,并更改为喜欢这个
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
...
<execution>
<id>npm audit fix</id>
<goals>
<goal>npm</goal>
</goals>
</execution>
...
</plugin>
在你所有的<execution>...</execution>
. 我希望你的代码能正常工作。
推荐阅读
- csv - 有没有办法将文件设置为在 GODOT 中只读
- spring-mvc - 无法准备陈述;嵌套异常是 org.hibernate.exception.GenericJDBCException:无法准备语句
- sql - 根据给定的输入获取上一个和下一个数据
- angular - 在Angular 7中动态添加行
- vue.js - Vue + Vuex:如果没有存储更改,则存储不设置输入值
- r - 使用模式 mutate_at 重命名多个变量
- php - 在 Codeigniter 中提交表单后无法保留下拉值
- php - WP 自定义字段包含 50 个以逗号分隔的名称:如何仅列出前 5 个?
- css - 如何根据图像是风景还是肖像来更改图像的尺寸?
- ms-word - Word web 加载项:检测文档 关闭