Malformed module path .. invalid char ':'

Hi All,

I am trying to import a module in my code from our companies git repo. https://bitbucket.mycompany:7999/project/repo but I end up with the below error. What is the right way to import this?

package bitbucket.mycompany:7999/project/repo: unknown import path “bitbucket.mycompany:7999/project/repo”: malformed module path “bitbucket.mycompany:7999/project/repo”: invalid char ‘:’

1 Like

You need to change your local ~/.gitconfig to rewrite URL, we did something similar to be able to clone via SSH instead of HTTP, to be able to authenticate using SSH keys…

[url ""]
  insteadOf =

This was our block.

You probably need to do it like this:

[url "http://bitbucket.mycompany:7999"]
  insteadOf = http://bitbucket.mycompany/

And then just leave off the port number in the imports.


@NobbZ Thanks much for your input. I am gonna try this and come back :slight_smile:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.