gradle-nexus / publish-plugin

Gradle plugin for publishing to Nexus repositories
Apache License 2.0
399 stars 29 forks source link

Event: Failed: Profile target matcher or Staging repository is not in desired state #261

Open duraivelBP90 opened 1 year ago

duraivelBP90 commented 1 year ago

Hi, I'm trying to close the repository and release it, where I;m getting this error "Event: Failed: Profile target matcher - profile-target-matching-staging"

Nexus repository manager : staging profiles screenshot

Screenshot 2023-08-17 at 8 18 33 AM

Nexus staging repository error screenshot

Screenshot 2023-08-16 at 4 14 58 PM

Screenshot while I;m run in the terminal,

Screenshot 2023-08-16 at 5 51 10 PM
szpak commented 1 year ago

It seems those files doesn't correspond to the group you are permitted to publish to. See also https://issues.sonatype.org/browse/OSSRH-70341 or https://issues.sonatype.org/browse/OSSRH-48197 . You need to fix JAR building (you can examine the generated package with gw build and looking into build/libs directory, without publishing).

Btw, it is completely not related to the plugin.

duraivelBP90 commented 1 year ago

My GroupID is : com.oustme

And I can able to see that in the staging repositories and while build the app, I;m added the group as com.oustme

So, I;m not sure what is the issue with the group?

szpak commented 1 year ago

Those files (paths) looks strange. Do you really need them in the archive? Have you been able to publish the project manually in the past?

duraivelBP90 commented 1 year ago

No, this is my first release to maven, I have followed the steps mentioned in this document : https://central.sonatype.org/publish/publish-guide/

And also I have followed this steps as well : https://github.com/gradle-nexus/publish-plugin

szpak commented 1 year ago

I propose to run gw build (or ./gradlew build), examine the produced JAR and think what would you like to publish. What is 34858478c42fac? IS that directory available in your JAR?

duraivelBP90 commented 1 year ago

Hi, I will run the above command, in the mean time, the 34858478c42fac is the staging repository available in the nexus repository manager.

Have a look at this screenshot :

Screenshot 2023-08-17 at 2 33 01 PM
szpak commented 1 year ago

After ./gradlew build please take a look into the JAR in: build/libs. What files/directories are included there?

duraivelBP90 commented 1 year ago

Hi, in the generated jar file, contains path of com/oustme/oustsdk

Where, I can able to see all the contents,

Screenshot 2023-08-17 at 3 45 34 PM
szpak commented 1 year ago

If those paths: image

are not available in your JAR, then I don't know why Nexus complains about them. This plugin - in general - only works with a staging repository in Nexus - artifact build and uploading is done outside (by the maven-publish plugin & co).

You can try to publish your JAR manually without this plugin to verify it. You can also repo it in Sonatype's Jira, but first, I would recommend check if those path aren't somehow published there.

Btw, what Gradle version do you use? In the past, there is a problem with sha256 and sha512 checksums in Nexus. However, it was years ago.

szpak commented 1 year ago

Btw, I wonder if outsSDK instrad of outssdk might also be a problem?

duraivelBP90 commented 1 year ago

I have tried with small case : oustsdk, but still the build is failing with the same error.

Screenshot 2023-08-17 at 4 44 59 PM

And, I;m using the following things, The Gradle version : gradle-7.4.2 SHA : when I create the public key by using 4096

szpak commented 1 year ago

Profile target mismatch - https://issues.sonatype.org/browse/OSSRH-65994?focusedId=1032285&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-1032285 ?

Maybe you have problem with the group ID? You can try to publish artifacts to Nexus (just publish, without using the staging repository features) and see what files are uploaded and with what path. /34858478c42fac/ - as I already mentioned -l ooks strange.

duraivelBP90 commented 1 year ago

Hi, thanks for the info, the same I found after I sent you the earlier comment. I was suppose to use com.oustme not the artefact id.

And, I can able to close the staging repository, but I;m getting this error while releasing it. Eventhough I can't able to see the build comoustme-1008 in the nexus repository manager.

"Releasing staging repository with id 'comoustme-1008' Current staging repository status: state: closed, transitioning: true Attempt 1/61 failed with result: StagingRepository(id=comoustme-1008, state=closed, transitioning=true) Current staging repository status: state: closed, transitioning: true Attempt 2/61 failed with result: StagingRepository(id=comoustme-1008, state=closed, transitioning=true)

Expiring Daemon because JVM heap space is exhausted Daemon will be stopped at the end of the build after running out of JVM memory Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Expiring Daemon because JVM heap space is exhausted Exception in thread "Thread-399" java.lang.OutOfMemoryError: Java heap space at io.github.gradlenexus.publishplugin.shadow.okhttp3.internal.http2.Http2Connection.close(Http2Connection.java:481) at io.github.gradlenexus.publishplugin.shadow.okhttp3.internal.http2.Http2Connection$ReaderRunnable.execute(Http2Connection.java:677) at io.github.gradlenexus.publishplugin.shadow.okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.base/java.lang.Thread.run(Thread.java:1589)

Task :releaseSonatypeStagingRepository Current staging repository status: state: not_found, transitioning: false Repository with id 'comoustme-1008' effectively released :releaseSonatypeStagingRepository (Thread[#543,included builds,5,main]) completed. Took 6 mins 34.473 secs. :closeAndReleaseSonatypeStagingRepository (Thread[#547,Execution worker for ':' Thread 4,5,main]) started.

Task :closeAndReleaseSonatypeStagingRepository Skipping task ':closeAndReleaseSonatypeStagingRepository' as it has no actions. :closeAndReleaseSonatypeStagingRepository (Thread[#547,Execution worker for ':' Thread 4,5,main]) completed. Took 0.006 secs. producer locations for task group 0 (Thread[#547,Execution worker for ':' Thread 4,5,main]) started. producer locations for task group 0 (Thread[#547,Execution worker for ':' Thread 4,5,main]) completed. Took 0.0 secs.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 8m 50s 35 actionable tasks: 7 executed, 28 up-to-date Watched directory hierarchies: [/Users/duraivel/AndroidStudioProjects/oustSDK] Expiring Daemon because JVM heap space is exhausted "

Attaching the screenshot for this,

Screenshot 2023-08-17 at 5 14 04 PM
duraivelBP90 commented 1 year ago

Now I;m getting this error, can you please help me with it

Artifact updating: Repository ='releases:Releases' does not allow updating artifact='/com/oustme/oustsdk/2.10.1.14/oustsdk-2.10.1.14.aar'

Screenshot 2023-08-17 at 5 42 54 PM
duraivelBP90 commented 1 year ago

Thanks for the prompt response, now I can able to successfully release the build

szpak commented 1 year ago

Artifact updating: Repository ='releases:Releases' does not allow updating artifact='/com/oustme/oustsdk/2.10.1.14/oustsdk-2.10.1.14.aar'

Probably you wanted to release the same version twice or re-uploaded the same artifacts twice to the same staging repository.

szpak commented 1 year ago

Exception in thread "Thread-399" java.lang.OutOfMemoryError: Java heap space at io.github.gradlenexus.publishplugin.shadow.okhttp3.internal.http2.Http2Connection.close(Http2Connection.java:481)

Probably you could stop the Gradle deamon gw --stop and try again

szpak commented 1 year ago

Thanks for the prompt response, now I can able to successfully release the build

Cool, I could read all the messages before answering :).

Btw, you could write what was the problem(s) in your case, for people hitting this issue from the web search engine.