I am building a monolithic app using Java spring-boot and Reacjs for UI. My repository is hosted on Github and I am using Github Actions for to build the repo on every commit.
I am using the frontend-maven-plugin to configure node, npm and run npm install. Now, all this works fine when I run the app locally on my machine, however when I push the code to Github and trigger the build on Github, it fails.
This is the error I am getting on server
Error: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.15.0:npm (npm run build) on project file-share: Failed to run task: ‘npm run build’ failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
You can see the failed build here
This is what my Github workflow file looks like (it’s quite simple and nothing complicated)
name: Maven Package
on:
- push
- deployment
- fork
- issues
- label
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
# server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
# settings-path: ${{ github.workspace }} # location for the settings.xml file
cache: 'maven'
- name: Build with Maven
run: mvn -B package --file pom.xml
This is the first time I am working extensively with Github Actions so I would welcome any help.