Home>
I want to publish my library via gitlab Tried doing this
maven {
url "https://******/api/v4/projects/***/packages/maven"
credentials(HttpHeaderCredentials) {
name= "Deploy-Token"
value= DEPLOY_TOKEN
}
authentication {
header(HttpHeaderAuthentication)
}
}
But this is with the command from.gitlab-ci.yml
deployLib:
stage: deploy
script:
-./gradlew publish
only:
-develop
Provided an error
Execution failed for task ':auth:publishReleaseAarPublicationToMavenRepository'.
> Failed to publish publication 'releaseAar' to repository 'maven'
> Could not PUT 'https://****/api/v4/projects/***/packages/maven/org/****/***/auth/1.0.0-beta/auth-1.0. 0-beta.aar'. Received status code 404 from server: Not Found
Found on one source that you need to add not Deploy-token but Job-Token
maven {
url "${CI_API_V4_URL}/groups/***/packages/maven"
credentials(HttpHeaderCredentials) {
name= 'Job Token'
value= System.getenv("CI_JOB_TOKEN")
}
authentication {
header(HttpHeaderAuthentication)
}
}
Now the code looks like this, but I can't even figure out where to get it from the docksCI_JOB_TOKEN
andCI_API_V4_URL
tell me either in a word or a link to a suitable article, what is wrong, do not criticize too much, for the first time I am publishing my lib
There are a lot of interesting things about GitLab variables here: docs.gitlab.com/ee/ci/variables
Eugene Krivenja2022-01-18 13:45:44What about CI_API_V4_URL?
Svetl9chok2022-01-18 13:47:18dox.gitlab.com/her/ki/variables/#enable-debug-logging
Eugene Krivenja2022-01-18 13:49:16Related questions
- java : It's not always possible to load data from Firebase
- java : How to implement notification in Android by time?
- java : What is outerClass.get ()? .Tv_receive?
- java : SharedPreferences for persistence
- java : XML markup in Android application
- android : I want to always display a camera preview on the Surface View
- java : I got a build error using Lombok on Android.
- How do I fix the Task: app: compileDebugJavaWithJavac FAILED error?
- java : Multiple languages in the app
You don't need to take it. When a pipeline job is about to run, GitLab generates a unique token and injects it as the CI_JOB_TOKEN predefined variable. docs.gitlab.com/ee/ci/jobs/ci_job_token.html
Eugene Krivenja2022-01-18 13:43:53