vanniktech / gradle-maven-publish-plugin

A Gradle plugin that publishes your Android and Kotlin libraries, including sources and javadoc, to Maven Central or any other Nexus instance.
https://vanniktech.github.io/gradle-maven-publish-plugin
Apache License 2.0
1.31k stars 120 forks source link

POM: name and description could be set by default #827

Closed joffrey-bion closed 1 month ago

joffrey-bion commented 3 months ago

The Gradle Project type already has a name and description that we can set for various purposes.

Couldn't we use them as default values for the POM's name and description fields?

There is a clear benefit because those fields are required by Maven Central, so it would be 2 lines of boilerplate gone.

gabrielittner commented 1 month ago

For name it's because they are different. The POM name is supposed to be a human readable name while Gradle's project.name is usually just the directory name. In multi module projects name could also be duplicated because you :foo:a and :bar:a both have a as name. So I don't think it's a good default.

For the description, too be honest I didn't even know it existed and I haven't seen it used before. It would work but for consistency I think it's better to just leave it as is.

joffrey-bion commented 1 month ago

The pom's name is not clearly defined, indeed. That doesn't mean it has to be different from the artifact id though (which is set to the project name by default AFAIK).

Maven Central guidelines mention that an acceptable practice is to use groupId:artifactId as name. Could this be a more reasonable default in your opinion?

https://central.sonatype.org/publish/requirements/#project-name-description-and-url

Do you foresee any issue with the description defaulting to the project description? You said "for consistency", you mean consistency with what?

joffrey-bion commented 1 month ago

Fun fact: on mavenrepository.com's artifact page the artifact ID that I put in the name is actually split by words and capitalized 😆

The pom for this one: https://repo1.maven.org/maven2/org/hildan/krossbow/krossbow-websocket-core/7.3.0/krossbow-websocket-core-7.3.0.pom