Я пытаюсь опубликовать sh артефакт в хранилище битовых корзин, используя gardle. Я запускаю задачу gradle как gradlew uploadArchives
. Она показывает, что Build успешно работает без каких-либо ошибок. Но когда я проверяю в репозитории bitbucket, ничего не происходит.
Я не понимаю, где я делаю неправильно.
build.gradle:
plugins {
id 'org.springframework.boot' version '2.2.2.RELEASE'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
id 'java'
id 'maven'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/"}
maven { url "https://raw.github.com/synergian/wagon-git/releases"}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-parent', version: '2.2.2.RELEASE'
}
task packageSources (type: Jar) {
from project.sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives packageSources
}
configurations {
deployerJar
}
dependencies {
deployerJar "ar.com.synergian:wagon-git:0.2.3"
}
uploadArchives {
configuration = configurations.archives
repositories.mavenDeployer {
configuration = configurations.deployerJar
repository(url: "https://master@bitbucket.org/kotanithin/myrepo.git"){
authentication(userName: "nithinroyal513@gmail.com", password: "xxxxxxxx")
}
snapshotRepository(url: "https://master@bitbucket.org/kotanithin/myrepo.git"){
authentication(userName: "nithinroyal513@gmail.com", password: "xxxxxxxx")
}
}
}
некоторые журналы, которые я наблюдал при отладке задачи gradle
2020-01-28T00:23:03.376+0530 [DEBUG] [org.gradle.api.internal.artifacts.mvnsettings.DefaultLocalMavenRepositoryLocator] No local repository in Settings file defined. Using default path: C:\Users\HP\.m2\repository
2020-01-28T00:23:03.398+0530 [INFO] [org.gradle.api.publication.maven.internal.action.MavenDeployAction] Deploying to https://master://git@bitbucket.org:kotanithin/myrepo.git
2020-01-28T00:23:03.401+0530 [INFO] [org.gradle.api.publication.maven.internal.action.LoggingMavenTransferListener] Downloading: com/example/demo/0.0.1-SNAPSHOT/maven-metadata.xml from repository remote at https://master://git@bitbucket.org:kotanithin/myrepo.git/
2020-01-28T00:23:03.402+0530 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: compatibility
2020-01-28T00:23:03.403+0530 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection request: [route: {s}->https://master:443][total kept alive: 0; route allocated: 0 of 20; total allocated: 0 of 40]
2020-01-28T00:23:03.403+0530 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection leased: [id: 1][route: {s}->https://master:443][total kept alive: 0; route allocated: 1 of 20; total allocated: 1 of 40]
2020-01-28T00:23:03.403+0530 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Opening connection {s}->https://master:443
2020-01-28T00:23:05.955+0530 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-1: Shutdown connection
2020-01-28T00:23:05.955+0530 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection discarded
2020-01-28T00:23:05.955+0530 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection released: [id: 1][route: {s}->https://master:443][total kept alive: 0; route allocated: 0 of 20; total allocated: 0 of 40]
2020-01-28T00:23:05.955+0530 [ERROR] [org.gradle.api.publication.maven.internal.action.LoggingMavenTransferListener] Could not transfer metadata com.example:demo:0.0.1-SNAPSHOT/maven-metadata.xml from/to remote (https://master://git@bitbucket.org:kotanithin/myrepo.git): master
2020-01-28T00:23:05.956+0530 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute upload for :uploadArchives'
2020-01-28T00:23:05.956+0530 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute upload for :uploadArchives' completed
2020-01-28T00:23:05.956+0530 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Snapshot outputs after executing task ':uploadArchives'' started
2020-01-28T00:23:05.956+0530 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Snapshot outputs after executing task ':uploadArchives''
2020-01-28T00:23:05.956+0530 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Snapshot outputs after executing task ':uploadArchives'' completed
2020-01-28T00:23:05.957+0530 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter] Removed task artifact state for task ':uploadArchives' from context.
2020-01-28T00:23:05.957+0530 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Task :uploadArchives'
2020-01-28T00:23:05.905+0530 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger]
2020-01-28T00:23:05.905+0530 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :uploadArchives FAILED
2020-01-28T00:23:05.957+0530 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :uploadArchives' completed
2020-01-28T00:23:05.957+0530 [INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :uploadArchives (Thread[Execution worker for ':',5,main]) completed. Took 3.124 secs.
2020-01-28T00:23:05.957+0530 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :uploadArchives failed
2020-01-28T00:23:05.957+0530 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :uploadArchives completed, executed: true
Когда я изменяю URL на ниже и моя основная ветвь bitbucket выпускает
https://kotanithin@bitbucket.org/kotanithin/demo.git
Ошибка:
020-01-28T11:15:14.572+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
2020-01-28T11:15:14.572+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2020-01-28T11:15:14.573+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
2020-01-28T11:15:14.573+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':uploadArchives'.
2020-01-28T11:15:14.573+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not publish configuration 'archives'
2020-01-28T11:15:14.573+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not deploy to remote repository | Failed to deploy artifacts: Could not find artifact com.example:demo:jar:0.0.1-20200128.053924-1 in remote (https://kotanithin@bitbucket.org/kotanithin/demo.git)
2020-01-28T11:15:14.573+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2020-01-28T11:15:14.574+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
2020-01-28T11:15:14.574+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --scan to get full insights.
2020-01-28T11:15:14.574+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2020-01-28T11:15:14.574+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is:
2020-01-28T11:15:14.576+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':uploadArchives'.
2020-01-28T11:15:14.576+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:187)
2020-01-28T11:15:14.576+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
2020-01-28T11:15:14.576+0530 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:185)