【问题标题】:Build Failing when using Github Action CI/CD使用 Github Action CI/CD 时构建失败
【发布时间】:2021-05-30 08:02:02
【问题描述】:

我使用 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 ,它工作得很好。

【问题讨论】:

    标签: spring-boot github npm cicd


    【解决方案1】:

    进入你的 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>
    

    删除&lt;configuration&gt;...&lt;/configuration&gt; 部分,并更改为喜欢这个

                 <plugin>
                        <groupId>com.github.eirslett</groupId>
                        <artifactId>frontend-maven-plugin</artifactId> 
                            ...
    
                            <execution>
                                <id>npm audit fix</id>
                                <goals>
                                    <goal>npm</goal>
                                </goals>
                            </execution>
    
                           ...
                 </plugin>
    

    在您所有的&lt;execution&gt;...&lt;/execution&gt; 中。 我希望你的代码能正常工作。

    【讨论】:

      猜你喜欢
      • 2021-11-13
      • 2021-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-05
      • 2020-01-08
      • 2020-04-04
      • 1970-01-01
      相关资源
      最近更新 更多