Using Maven git-commit-id-plugin in Pipelines

Deleted user October 12, 2016

Hello!

I'm trying to run my maven build script in Pipelines, but it fails with this error message:

 

 

[ERROR] Failed to execute goal pl.project13.maven:git-commit-id-plugin:2.2.1:revision (default) on project omc-server: Could not complete Mojo execution... java.net.URISyntaxException: Illegal character in authority at index 8: https://x-token-auth:{access_token}@bitbucket.org/imavis/omc.git -> [Help 1]

any ideas?

Thanks for yout help!

4 answers

1 accepted

3 votes
Answer accepted
Steven Vaccarella
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 16, 2016

Hi Aldo,

It looks like you're using a maven plugin (git-commit-id-plugin) that requires a valid origin url in your local git configuration.

If this is not an essential plugin for your build then the easiest way to fix the issue is to disable the plugin (perhaps move the plugin into a maven profile that is not enabled when your build is run in Pipelines).

If it is an essential plugin then you'll need to set a valid origin url and probably set up ssh authentication so that your build can communicate with the remote repository.

Initially I would try just setting a valid origin url at the beginning of your script:

git remote set-url origin https://bitbucket.org/imavis/omc.git

However there's a good chance this still won't work if the plugin needs to actually communicate with the remote server. It may fail with an authentication error or the build may hang waiting for user input (be sure to watch the build and stop it manually if it hangs).

If that doesn't work then you'll need to set an ssh-based origin url and also set up ssh authentication.

The ssh-based url will look something like this:

git remote set-url origin git@bitbucket.org:imavis/omc.git

And the following guides describe how to set up ssh authentication:

https://answers.atlassian.com/questions/39429257

https://answers.atlassian.com/questions/39243415

cheers,

Steven

 

Deleted user October 16, 2016

Thank you very much: I just needed to retrieve the local commit id, so simply setting the origin url did the trick.

Thomas Arp April 18, 2017

Yes, thank you. This solved the problem for us as well.

0 votes
Tom Bradshaw
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 13, 2016

Hi Aldo,
This looks like it's probably caused by an error as a result of a plugin overriding a default lifecycle hook in your pom.xml. I'd recommend trying to mount and run the build on a local docker container to see whether it works and start debugging. If there are still problems please raise an issue at https://support.atlassian.com/ so we can investigate further.

0 votes
Deleted user October 13, 2016

I'm using the unmodified standard template for a maven project:

# This is a sample build configuration for Maven.
# Check our guides at https://confluence.atlassian.com/x/VYk8Lw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# 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
0 votes
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 13, 2016

Would you be able to paste in the contents of your bitbucket-pipelines.yml? 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events