Deploy maven plugin to gitlab repository

Hello everyone,

I would like to ask about maven-plugin deployment. In my project, I have a lot of custom maven-modules. Since it is a private project, I’m deploying modules to GitLab repository. This works like a charm and without any issues. But for some reason I’m not able to deploy maven modul with maven-plugin. First I though it was because this maven-plugin modul was part of bigger maven-modul, but the problem still occurs after I extracted this maven-plugin modul to it’s own module.

In pipeline I’m getting following error:

Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.0.0:deploy (default-deploy) on project XXX: Failed to deploy metadata: Could not transfer metadata XXX from/to gitlab-maven (https://gitlab.com/api/v4/projects/xxxxxxxx/packages/maven): status code: 400, reason phrase: Bad Request (400) -> [Help 1]

I have double checked distributionManagement configuration and also scm in my pom.xml configuration.

Does anyone have experience with custom maven-plugin deployment on GitLab?

Many thanks,
Petr