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

Upgrade to gradle 8 #310

Merged
merged 1 commit into from
Mar 20, 2023
Merged

Upgrade to gradle 8 #310

merged 1 commit into from
Mar 20, 2023

Conversation

maths22
Copy link
Contributor

@maths22 maths22 commented Mar 16, 2023

This allows local development to work with java 17.

I have tested that publishing to maven local works correctly
with javas 8, 11, and 17. I have not tested publishing to
maven central/staging as I do not have access to do so. I
have tested publishing to a different repository with a
custom repository block, and that appeared to work correctly,
but I wouldn't be surprised if this needs tweaks to be happy
for maven central.

@fvarrui
Copy link
Owner

fvarrui commented Mar 19, 2023

Hi @maths22,
We'll know when the next version of JavaPackager is released 😅
Thanks so much!!

@fvarrui
Copy link
Owner

fvarrui commented Mar 19, 2023

Now it seems to be a little better organized, because Gradle is not my thing.

@fvarrui fvarrui changed the base branch from devel to pr-310 March 20, 2023 00:00
@fvarrui fvarrui merged commit b98438c into fvarrui:pr-310 Mar 20, 2023
@fvarrui
Copy link
Owner

fvarrui commented Mar 20, 2023

Merged in branch pr-310

@fvarrui
Copy link
Owner

fvarrui commented May 4, 2023

Thanks so much!!! It worked like a charm. I was able to release JP 1.7.1. to Maven Central with minor changes. Merged into devel.

@fvarrui
Copy link
Owner

fvarrui commented May 5, 2023

Hi @maths22! Maybe you can throw some light, because I'm having a problem when releasing the plugin to Maven Central. My minor changes in build.gradle broken the Gradle compatibility (but fixes the next problem), so I revert those minor changes. Now, the problem is that the publish task uploads JP jar, source jar, docs and some other necessary files, but it also uploads a folder called plugin, which is detected as a bad thing when releasing .... so, I have to access to OSS Sonatype web interface, delete this folder, and finally close and release the repo manually. Do you know how we can avoid to upload this folder?

@maths22
Copy link
Contributor Author

maths22 commented May 14, 2023

Hmm I'll look into this.

@maths22
Copy link
Contributor Author

maths22 commented May 14, 2023

@fvarrui if you are able to provide a screenshot or log of the error message I think that would be helpful. Since I can't try publishing to the repo I can't directly reproduce it myself, and it doesn't seem to publish a plugin directory when i push to mavenlocal

@fvarrui
Copy link
Owner

fvarrui commented May 17, 2023

As you can see here, it generates a plugin directory into my local repo (maybe needed if the plugin is released to Gradle plugin portal) ... but it's detected as a wrong artifact when releasing to Maven Central.

C:\Users\fvarrui\.m2\repository\io\github\fvarrui\javapackager>tree /f
Listado de rutas de carpetas
El número de serie del volumen es E4F9-DB0F
C:.
│   maven-metadata-local.xml
│
├───1.7.2-SNAPSHOT
│       javapackager-1.7.2-20230504.125631-4.jar
│       javapackager-1.7.2-20230504.125631-4.jar.sha1
│       javapackager-1.7.2-20230504.125631-4.pom
│       javapackager-1.7.2-20230504.125631-4.pom.sha1
│       javapackager-1.7.2-SNAPSHOT.jar
│       javapackager-1.7.2-SNAPSHOT.pom
│       m2e-lastUpdated.properties
│       _remote.repositories
│
├───1.7.3-SNAPSHOT
│       javapackager-1.7.3-SNAPSHOT-javadoc.jar
│       javapackager-1.7.3-SNAPSHOT-javadoc.jar.asc
│       javapackager-1.7.3-SNAPSHOT-sources.jar
│       javapackager-1.7.3-SNAPSHOT-sources.jar.asc
│       javapackager-1.7.3-SNAPSHOT.jar
│       javapackager-1.7.3-SNAPSHOT.jar.asc
│       javapackager-1.7.3-SNAPSHOT.module
│       javapackager-1.7.3-SNAPSHOT.module.asc
│       javapackager-1.7.3-SNAPSHOT.pom
│       javapackager-1.7.3-SNAPSHOT.pom.asc
│       m2e-lastUpdated.properties
│       maven-metadata-local.xml
│       maven-metadata-nexus.xml
│       maven-metadata-nexus.xml.sha1
│       resolver-status.properties
│
└───plugin
    └───io.github.fvarrui.javapackager.plugin.gradle.plugin
        │   maven-metadata-local.xml
        │
        └───1.7.3-SNAPSHOT
                io.github.fvarrui.javapackager.plugin.gradle.plugin-1.7.3-SNAPSHOT.pom
                io.github.fvarrui.javapackager.plugin.gradle.plugin-1.7.3-SNAPSHOT.pom.asc
                maven-metadata-local.xml

But when releasing to Maven Central:

> Task :closeRepository
DEPRECATION WARNING. The staging repository ID is not provided. The fallback mode may impact release reliability and is deprecated. Please consult the project FAQ how it can be fixed.
Requested operation was executed successfully in attempt 13 (maximum allowed 21)

> Task :closeRepository FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':closeRepository'.
> Wrong 'iogithubfvarrui-1060' repository state 'open' after transition (expected [closed]). Possible staging rules violation. Check repository status using Nexus UI.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 6s
16 actionable tasks: 14 executed, 2 up-to-date

And this is the error message in Nexus Repository Manager:

image

image

@fvarrui
Copy link
Owner

fvarrui commented May 17, 2023

And when I delete this folder (1) and manually close the repo (2), the plugin is released successfully:

image

@maths22
Copy link
Contributor Author

maths22 commented May 17, 2023

I filed #327 to hopefully deal with this. Thanks for the additional info-that was helpful in tracking down the POM and figuring out which part of the gradle docs to look at.

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

Successfully merging this pull request may close these issues.

2 participants