Build failing with message there is no POM in this directory (/opt/atlassian/pipelines/agent/build).

I have configured enabled and configured bitbucket-pipeline with my  code(java, maven,spring boot) in bit bucket. But each time I try to run build it fails with below message

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.080 s
[INFO] Finished at: 2016-10-23T11:06:58+00:00
[INFO] Final Memory: 13M/483M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/opt/atlassian/pipelines/agent/build). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR]

 Not Sure why it is looking for path 

/opt/atlassian/pipelines/agent/build.

Below is my bitbucket-pipelines.yml

# You can specify a custom docker image from Docker Hub as your build environment.

image: maven:3.3.3

pipelines:

  default:

    - step:

        script: # Modify the commands below to build your repository.

          - mvn clean install

Please let me know what I am missing in my setup. Thanks.

2 answers

1 accepted

1 vote
Accepted answer

Fixed by adding  - cd projectName  to script  bitbucket-pipelines.yml. Since my pom.xml was inside my project directory.

 

0 votes

@sunny mattas I am facing the same issue. I tried adding below:

script:

- mvn clean install
- git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD:master

 

but getting following error:

build issue.JPG

Look for location of pom.xml in your project. Seems bitbucket assumes your pom.xml is inside folder "/opt/atlassian/pipelines/agent/build". But for me and I am assuming for you also it is inside a folder(project name) at this location. So run  mvn clean install inside the folder having pom.xml. For this change your script to following

script:
- cd path_to_pom.xml
- mvn clean install
- git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD:master

path_to_pom.xml is relative from  /opt/atlassian/pipelines/agent/build. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

246 views 3 7
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you