Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have a problem to push my lib to sonatype. #14

Open
kulik opened this issue Feb 25, 2014 · 11 comments
Open

I have a problem to push my lib to sonatype. #14

kulik opened this issue Feb 25, 2014 · 11 comments

Comments

@kulik
Copy link

kulik commented Feb 25, 2014

i have develop some lib https://github.com/kulik/AndroidJAXBLib/tree/gradle on this branch i have migrate to gradle project structure? and want to push it to mvn. As you can see i made everything by your instructions. but when i try to do
./gradlew uploadArchives

:library:androidJavadocs UP-TO-DATE
:library:androidJavadocsJar UP-TO-DATE
:.......
:library:bundleRelease UP-TO-DATE
:library:signArchives UP-TO-DATE
:library:uploadArchives
Uploading: com/github/kulik/android-jaxb/0.1-SNAPSHOT/android-jaxb-0.1-20140225.200505-1.aar to repository remote at https://oss.sonatype.org/content/repositories/snapshots/
Transferring 69K from remote
:library:uploadArchives FAILED

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 44.423 secs
also a have push gradle.properties itto homefolder/.gradle, and right credentials a setuped.(when i put some println(NEXUS_USERNAME) and same for pass it had wrote correct info). also i can login with that credentials to the https://oss.sonatype.org/ and to jira.sonatype.org. but uploading was failed.
Please help me.

@kulik
Copy link
Author

kulik commented Feb 25, 2014

22:25:48.590 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:null] Deploying to https://oss.sonatype.org/content/repositories/snapshots/
22:25:48.625 [INFO] [system.out] [INFO] Retrieving previous build number from remote
22:25:49.576 [INFO] [system.out] [INFO] repository metadata for: 'snapshot com.github.kulik:android-jaxb:0.1-SNAPSHOT' could not be found on repository: remote, so will be created
22:25:49.585 [ERROR] [system.err] Uploading: com/github/kulik/android-jaxb/0.1-SNAPSHOT/android-jaxb-0.1-20140225.202548-1.aar to repository remote at https://oss.sonatype.org/content/repositories/snapshots/
22:25:50.200 [ERROR] [system.err] Transferring 69K from remote
22:26:12.160 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:null] An error has occurred while processing the Maven artifact tasks.
Diagnosis:

Error deploying artifact 'com.github.kulik:android-jaxb:aar': Error deploying artifact: Failed to transfer file: https://oss.sonatype.org/content/repositories/snapshots/com/github/kulik/android-jaxb/0.1-SNAPSHOT/android-jaxb-0.1-20140225.202548-1.aar. Return code is: 401

22:26:12.161 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':library:uploadArchives'
22:26:12.162 [LIFECYCLE] [org.gradle.TaskExecutionLogger] :library:uploadArchives FAILED
22:26:12.164 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :library:uploadArchives (Thread[main,5,main]) completed. Took 24.839 secs.
22:26:12.165 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 27.41 secs, idle: 0.065 secs
22:26:12.174 [ERROR] [org.gradle.BuildExceptionReporter]
22:26:12.176 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
22:26:12.177 [ERROR] [org.gradle.BuildExceptionReporter]
22:26:12.178 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
22:26:12.179 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':library:uploadArchives'.
22:26:12.180 [ERROR] [org.gradle.BuildExceptionReporter] > Could not publish configuration 'archives'
22:26:12.181 [ERROR] [org.gradle.BuildExceptionReporter] > Error deploying artifact 'com.github.kulik:android-jaxb:aar': Error deploying artifact: Failed to transfer file: https://oss.sonatype.org/content/repositories/snapshots/com/github/kulik/android-jaxb/0.1-SNAPSHOT/android-jaxb-0.1-20140225.202548-1.aar. Return code is: 401

@JakeWharton
Copy link

401 means not authorized. Have you configured your credentials to Sonatype
as per the README?
On Feb 25, 2014 12:26 PM, "Yevgen Kulik" notifications@github.com wrote:

22:25:48.590 [INFO]
[org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:null]
Deploying to https://oss.sonatype.org/content/repositories/snapshots/
22:25:48.625 [INFO] [system.out] [INFO] Retrieving previous build number
from remote
22:25:49.576 [INFO] [system.out] [INFO] repository metadata for: 'snapshot
com.github.kulik:android-jaxb:0.1-SNAPSHOT' could not be found on
repository: remote, so will be created
22:25:49.585 [ERROR] [system.err] Uploading:
com/github/kulik/android-jaxb/0.1-SNAPSHOT/android-jaxb-0.1-20140225.202548-1.aar
to repository remote at
https://oss.sonatype.org/content/repositories/snapshots/
22:25:50.200 [ERROR] [system.err] Transferring 69K from remote
22:26:12.160 [INFO]
[org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:null] An error
has occurred while processing the Maven artifact tasks.
Diagnosis:

Error deploying artifact 'com.github.kulik:android-jaxb:aar': Error
deploying artifact: Failed to transfer file:
https://oss.sonatype.org/content/repositories/snapshots/com/github/kulik/android-jaxb/0.1-SNAPSHOT/android-jaxb-0.1-20140225.202548-1.aar.
Return code is: 401

22:26:12.161 [DEBUG]
[org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter]
Finished executing task ':library:uploadArchives'
22:26:12.162 [LIFECYCLE] [org.gradle.TaskExecutionLogger]
:library:uploadArchives FAILED
22:26:12.164 [INFO]
[org.gradle.execution.taskgraph.AbstractTaskPlanExecutor]
:library:uploadArchives (Thread[main,5,main]) completed. Took 24.839 secs.
22:26:12.165 [DEBUG]
[org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker
[Thread[main,5,main]] finished, busy: 27.41 secs, idle: 0.065 secs
22:26:12.174 [ERROR] [org.gradle.BuildExceptionReporter]
22:26:12.176 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build
failed with an exception.
22:26:12.177 [ERROR] [org.gradle.BuildExceptionReporter]
22:26:12.178 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
22:26:12.179 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed
for task ':library:uploadArchives'.
22:26:12.180 [ERROR] [org.gradle.BuildExceptionReporter] > Could not
publish configuration 'archives'
22:26:12.181 [ERROR] [org.gradle.BuildExceptionReporter] > Error deploying
artifact 'com.github.kulik:android-jaxb:aar': Error deploying artifact:
Failed to transfer file:
https://oss.sonatype.org/content/repositories/snapshots/com/github/kulik/android-jaxb/0.1-SNAPSHOT/android-jaxb-0.1-20140225.202548-1.aar.
Return code is: 401

Reply to this email directly or view it on GitHubhttps://github.com//issues/14#issuecomment-36053892
.

@kulik
Copy link
Author

kulik commented Feb 25, 2014

thank you for answer.
yes, look for ending of the first message i had put
println(NEXUS_USERNAME);
println(NEXUS_PASSWORD);
so it has returned my credentials which i use to login on nexus https://oss.sonatype.org
i put gradle properties to my ~/.gradle/gradle.properties. and there i have put all my credentials in way that you wrote in README.
also now i look for mvn version. now i use apache-maven-3.1.1 is it can be a problem?

@JakeWharton
Copy link

And do you have permission to access the com.github.kulik groupId from
Sonatype?
On Feb 25, 2014 12:38 PM, "Yevgen Kulik" notifications@github.com wrote:

thank you for answer.
yes, look for ending of the first message i had put
println(NEXUS_USERNAME);
println(NEXUS_PASSWORD);
so it has returned my credentials which i use to login on nexus
https://oss.sonatype.org
i put gradle properties to my ~/.gradle/gradle.properties. and there i
have put all my credentials in way that you wrote in README.
also now i look for mvn version. now i use apache-maven-3.1.1

Reply to this email directly or view it on GitHubhttps://github.com//issues/14#issuecomment-36055115
.

@kulik
Copy link
Author

kulik commented Feb 25, 2014

sorry i am very new in maven/nexus, now when i login and try to find my package i see http://gyazo.com/83e3f84b0178b43c556433eeea5d7c57 can it means that i haven't some permitions on nexus?

@JakeWharton
Copy link

Did you file a JIRA ticket to get access to the repository?

@kulik
Copy link
Author

kulik commented Feb 26, 2014

yes http://gyazo.com/952a49bc3ed10e4bb313ca478d10b3fe, also today i have uploaded artifacts manualy from UI. close it and release. but still problems with gradle-maven. also i have version up, because 0.1 already deployed manual way

@koral--
Copy link

koral-- commented Feb 27, 2014

Check for trailing whitespaces in credentials in ~/.gradle/gradle.properties.

@kulik
Copy link
Author

kulik commented Feb 27, 2014

i tried to upload builded artifacts to nexus in manual way, and it diagnostic system say http://gyazo.com/e0640f886d693eba03603d88554f600a but in /build/libs i found only
│/..
│ library-0.2-debug.aar
│ library-0.2-javadoc.jar
│ library-0.2-javadoc.jar.asc
│ library-0.2-sources.jar
│ library-0.2-sources.jar.asc
│ library-0.2.aar
│ library-0.2.aar.asc
│ library-debug.ap_
│ library-release.ap_

debug.aar is missing, i think "staging upload" on nexus ui works in the same way as automatic. that means maybe problem here

@johnjohndoe
Copy link
Contributor

@kulik The library-0.2-debug.aar might be a relict from a debug build you triggered before. When you execute the uploadArchives task the following files should be found in build/libs:

├── library-0.2.aar
├── library-0.2.aar.asc
├── library-0.2-javadoc.jar
├── library-0.2-javadoc.jar.asc
├── library-0.2-sources.jar
└── library-0.2-sources.jar.asc

Try to clean the folder before by executing: gradlew clean uploadArchives.

@ssbarnea
Copy link

It seems that I am encountering the same error while trying to migrate from a maven artefact deployment model to gradle and even if I used the same user and password as the ones from the maven config (that works), I do still get:

15:29:43.268 [ERROR] [org.gradle.BuildExceptionReporter] > Could not publish configuration 'archives'
15:29:43.269 [ERROR] [org.gradle.BuildExceptionReporter]    > Error deploying artifact 'com.citrix:sample-package:jar': Error deploying artifact: Failed to transfer file: https://nexus.example.com/content/repositories/snapshots/com/citrix/sample-package/1.0.1/sample-package-1.0.1.jar. Return code is: 401

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants