Skip to content

Could not find a field for name (nmcp.internal.task.ArtifactMetadata) metadata/modelVersionΒ #142

@SimonMarquis

Description

@SimonMarquis

Expected and Results

Executing publishAllPublicationsToCentralSnapshots lead to this error, after it successfuly uploaded all binaries.
From the logs (of 0.2.1) it seems to happen right after re-fetching the root maven-metadata.xml.

Execution failed for task ':processor:nmcpPublishAllPublicationsToCentralPortalSnapshots'.
> A failure occurred while executing nmcp.internal.task.NmcpPublishFileByFileToSnapshotsWorkAction
   > Could not find a field for name (nmcp.internal.task.ArtifactMetadata) metadata/modelVersion (Attribute)
       candidates: versioning (Element), groupId (Element), artifactId (Element) at position 2:12

Reproduced on both 0.2.1 and 1.0.0.

Here are examples of it on one of my repositories:

The referenced "missing" field is likely to be this:

@Serializable
@XmlSerialName("metadata")
internal data class VersionMetadata(
val modelVersion: String = "1.1.0",

And here is the maven-metadata.xml fetched (nothing wrong with it):

<metadata modelVersion="1.1.0">
  <groupId>fr.smarquis.sealed</groupId>
  <artifactId>sealed-object-instances</artifactId>
  <versioning>
    <latest>1.11.0-SNAPSHOT</latest>
    <versions>
      <version>1.10.0-SNAPSHOT</version>
      <version>1.11.0-SNAPSHOT</version>
    </versions>
    <lastUpdated>20250601220426</lastUpdated>
  </versioning>
</metadata>

Related environment and versions

No response

Reproduction steps

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions