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

Support for publishing Android projects #75

Open
szpak opened this issue Mar 4, 2021 · 11 comments
Open

Support for publishing Android projects #75

szpak opened this issue Mar 4, 2021 · 11 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@szpak
Copy link
Contributor

szpak commented Mar 4, 2021

Looking at the report by @jahirfiquitiva in #74, it seems that there is a problem with publishing Android projects. It would be good to have a minimal Android project to play with it and use in e2e tests.


[...] This suggests that GNPP (this plugin) doesn't correctly detect publishing configuration in an Android project. As a result, it doesn't enhance the publishing task to use the explicitly created staging repository and in general - doesn't work.

I don't have an Android SDK installed locally and I would prefer not to setup it. However, if you created/generated (or stripped down the current one) a totally minimal Android project which does nothing, but builds fine and publishes artifacts to Nexus (as your does), I/we could try to take a look at it to solve the problem with GNPP <-> Android project interaction. Otherwise, it could be hard to do anything about that :-(.

It would be best to publish it to a separate GitHub repo with set up GH Actions (to be able to play with it there) and after (hopefully) successful triage and fix, it could be eventually also converted to an automatic regression e2e tests (as we currently have for single and multi-project regular Java builds) to prevent that kind of problems also in the future. Does it sound good for you? :-).

Originally posted by @szpak in #74 (comment)

@cosmos33
Copy link

cosmos33 commented Mar 30, 2021

I use GNPP to publish libs to Sonatype and I get the error.After run " ./gradlew publishToSonatype closeAndReleaseStagingRepository".
`

Task :closeSonatypeStagingRepository FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':closeSonatypeStagingRepository'.

Staging repository is not in desired state [closed]: StagingRepository(id=comimmomo-1009, state=open, transitioning=false). It is unexpected. Please checkNexus logs using its web interface - it can be caused by validation rules violation. If not, please report it to https://github.com/gradle-nexus/publish-plugin/issues/ with '--info' logs

`
As above shows , the tips suggest me to check its web interface.
And the web interface show some error like

`

typeId | pom-staging
failureMessage | Invalid POM: /com/immomo/cosmos/auth/authbase-noui/1.0.6_112301/authbase-noui-1.0.6_112301.pom: Project name missing, Project description missing, Project URL missing, License information missing, SCM URL missing, Developer information missing
`

and

`
typeId | signature-staging
failureMessage | Missing Signature: '/com/immomo/cosmos/auth/authbase-noui/1.0.6_112301/authbase-noui-1.0.6_112301.jar.asc' does not exist for 'authbase-noui-1.0.6_112301.jar'.
failureMessage | Missing Signature: '/com/immomo/cosmos/auth/authbase-noui/1.0.6_112301/authbase-noui-1.0.6_112301.pom.asc' does not exist for 'authbase-noui-1.0.6_112301.pom'.

`

I guess that GNPP dismiss "Signing Artifacts" stage as the sonatype website shows https://central.sonatype.org/pages/gradle.html . Forget my poor English.

@szpak
Copy link
Contributor Author

szpak commented Mar 30, 2021

@cosmos33 In regards to:

Looking at the report by @jahirfiquitiva in #74, it seems that there is a problem with publishing Android projects. It would be good to have a minimal Android project to play with it and use in e2e tests.

Having some "minimal releasable Android project" would be much more efficient to try to pinpoint the issue than playing with "hit & miss". Maybe you can provide one?

@vlsi
Copy link
Contributor

vlsi commented Mar 30, 2021

Project name missing, Project description missing, Project URL missing, License information missing, SCM URL missing, Developer information missing

It means the pom is not really valid. It is up to build author to fill all the required information to pom.xml

@szpak , what do you think of adding https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom to the front page of g-n-p-p?

@jahirfiquitiva
Copy link

I just tried with these changes and it seems like it worked

jahirfiquitiva/Frames@2329872

@jahirfiquitiva
Copy link

jahirfiquitiva commented Apr 17, 2021

update: it works as in uploading to staging, but closeAndReleaseStagingRepository doesn't seem to work

I see this in the output

Task :closeAndReleaseStagingRepository SKIPPED

@jahirfiquitiva
Copy link

when running closeAndReleaseSonatypeStagingRepository, output is

Execution failed for task ':closeSonatypeStagingRepository'.
> No staging repository with name sonatype created

@jahirfiquitiva
Copy link

@joebowbeer
Copy link

@jahirfiquitiva publication will fail without javadoc

@jahirfiquitiva
Copy link

@joebowbeer I have it in another library and still isn't closed and released by this plugin

also, the package is uploaded to staging fine, what doesn't work is closing and releasing, just in case it was misunderstood.

and also, manually closing and releasing works, so I guess the plugin should also be able to do so? idk

@ViliusSutkus89
Copy link

ViliusSutkus89 commented Jun 14, 2021

Hello,

I'm gonna go ahead and just shamelessly plug my project here.
https://github.com/ViliusSutkus89/Sample_Android_Library-MavenCentral-Instrumented_Tests/
Android library (aar), deployed to MavenCentral using gradle-nexus.publish-plugin with instrumented tests running on GitHub CI Android emulators.

Each CI run publishes and closes Sonatype staging repo - ./gradlew publishToSonatype closeSonatypeStagingRepository, runs instrumented tests (on Android emulator) against the published library and waits for manual approval. These two extra steps require releaseSonatypeStagingRepository to be called at a later time, not during the initial publishToSonatype call.

Still trying to figure out how can I feed staging-repository-id to releaseSonatypeStagingRepository.
In the meantime I release manually through oss.sonatype.org web interface.

Regards,
Vilius

@greedyjude
Copy link

Any update on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants