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

Invalid description in published POM #706

Open
abelsromero opened this issue Jan 9, 2024 · 5 comments
Open

Invalid description in published POM #706

abelsromero opened this issue Jan 9, 2024 · 5 comments
Labels
4.x Issues related to the 4.x series

Comments

@abelsromero
Copy link
Member

Description of deployed POMs has a dot in the description <description>.</description> instead of the actual one.

As per #702 (comment)
We should anyway rather refactor that pomXml code to be done in buildSrc rather than in publishing.gradle. It should also be easy to make it conditional to only be done when the maven-publish plugin is applied in the build.

Conversation started in #702 (comment)

@abelsromero abelsromero added the 4.x Issues related to the 4.x series label Jan 9, 2024
@aalmiray
Copy link
Member

aalmiray commented Jan 9, 2024

FWIW PomChecker may be used to validate poms before publication https://kordamp.org/pomchecker/pomchecker-gradle-plugin/index.html

@ysb33r
Copy link
Member

ysb33r commented Jan 9, 2024

@aalmiray It would be great if you can integrate kordamp/jreleaser when you have time.

@abelsromero
Copy link
Member Author

I was able to make a quick-fix but there's something wrong under the hood.

By default without any configuration, 2 publications are created, for example for asciidoctor-gradle-base, orgasciidoctorbasePluginPluginMarkerMaven and pluginMaven 🤷 I suspect Groolifant.

image

The pom failing validation is orgasciidoctorbasePluginPluginMarkerMaven (below) which has the dot. But the pom actually being published in my local repo is pluginMaven which a plain simple one.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.asciidoctor.base</groupId>
  <artifactId>org.asciidoctor.base.gradle.plugin</artifactId>
  <version>4.0.1</version>
  <packaging>pom</packaging>
  <name>Asciidoctor Base Plugin</name>
  <description>.</description>
  <dependencies>
    <dependency>
      <groupId>org.asciidoctor</groupId>
      <artifactId>asciidoctor-gradle-base</artifactId>
      <version>4.0.1</version>
    </dependency>
  </dependencies>
</project>

The quickfix is to override pluginMaven with some older code (slightly modified).

publishing {
    publications {
        pluginMaven(MavenPublication) {
            pom.withXml {
                asNode().children().last() + project.ext.pomConfig
                asNode().appendNode('description', project.project_description)
            }
        }
    }
}

@ysb33r
Copy link
Member

ysb33r commented Jan 9, 2024

I won't be Grolifant as it contains no code related to POM management.

@aalmiray
Copy link
Member

aalmiray commented Jan 9, 2024

PluginMarker comes from Gradle's plugin publish plugin which does not care about additional POM properties at all.

I wouldn't push much into this as proper POM elements make sense when publishing to Maven Central but not to the Gradle Plugin Portal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Issues related to the 4.x series
Projects
None yet
Development

No branches or pull requests

3 participants