Java, Maven and Angular in one image

I have a project based on Java Spring Boot and Angular. In the maven pom.xml I call “ng build” externally.
And I get error upon running maven on this pom.xml: Cannot run program “ng” (in directory “/drone/src/src/main/frontend”)

folder “/drone/src/src/main/frontend” exists, I checked that, so I suppose, that drone is unable to find ng executable in the maven image. My .drone.yml looks like that:

kind: pipeline
name: default


  • name: Install Angular
    image: node

    • npm install -g @angular/cli
    • ls
    • pwd
    • cd src/main/frontend
    • npm install
    • cd /drone/src/src/main/frontend
    • ng --version
  • name: test
    image: maven:3-jdk-8

    • mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
    • mvn test -B

Part of my pom.xml where I call “ng build”


My questions:
Is it possible to make angular available for the maven image? When I run “ng --version” on the node image, it runs ok. But when I run “ng build” from my pom.xml file, that is processed in maven image, I get the error I described above.

Or for such kind of projects I should not use isolated images and use ‘exec pipeline’ approach: Overview | Drone

Am I right?

Thank you.

the recommend solution is to build and publish your own docker image, with all the tools and software you need, so that you can use the image in your pipeline

1 Like

Thank you for your help :slight_smile: