java.io.IOException: Failed to parse metadata: Unrecognised tag: 'version' (position: START_TAG seen ...<versioning>\n <version>... @7:11)

JFrog JIRA | Lorand Somogyi | 8 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    If remote repository with wrong maven-metadata.xml files present. AF will produce an exception and prevent resolution of the artifact even if the artifact is present in the Artifact Repository (corporate releases in our case). To reproduce: Create a simple http service for one artifact present in Artifactory. Provide a non-valid maven-metadata.xml for the artifact. - It could be a valid XML, with wrong tags. - Confiugre artifact to use the smiple http service as Remote Repositry. Try to resolve the artifact with maven. In our case the offending wrong metadata missed versions tag in XML. Excerpt from log: --------------------------------------------------------- cut --------------------------------------------------------- java.io.IOException: Failed to parse metadata: Unrecognised tag: 'version' (position: START_TAG seen ...<versioning>\n <version>... @7:11) at org.artifactory.maven.MavenModelUtils.toMavenMetadata(MavenModelUtils.java:149) [artifactory-common-2.1.0.jar:na] at org.artifactory.maven.MavenModelUtils.toMavenMetadata(MavenModelUtils.java:123) [artifactory-common-2.1.0.jar:na] at org.artifactory.repo.virtual.VirtualRepoDownloadStrategy.getMavenMetadataContent(VirtualRepoDownloadStrategy.java:262) [artifactory-core-2.1.0.jar:na] --------------------------------------------------------- cut --------------------------------------------------------- Artifactory should blacklist the repository rather then failing to resolve the artifact.

    JFrog JIRA | 8 years ago | Lorand Somogyi
    java.io.IOException: Failed to parse metadata: Unrecognised tag: 'version' (position: START_TAG seen ...<versioning>\n <version>... @7:11)
  2. 0

    If remote repository with wrong maven-metadata.xml files present. AF will produce an exception and prevent resolution of the artifact even if the artifact is present in the Artifact Repository (corporate releases in our case). To reproduce: Create a simple http service for one artifact present in Artifactory. Provide a non-valid maven-metadata.xml for the artifact. - It could be a valid XML, with wrong tags. - Confiugre artifact to use the smiple http service as Remote Repositry. Try to resolve the artifact with maven. In our case the offending wrong metadata missed versions tag in XML. Excerpt from log: --------------------------------------------------------- cut --------------------------------------------------------- java.io.IOException: Failed to parse metadata: Unrecognised tag: 'version' (position: START_TAG seen ...<versioning>\n <version>... @7:11) at org.artifactory.maven.MavenModelUtils.toMavenMetadata(MavenModelUtils.java:149) [artifactory-common-2.1.0.jar:na] at org.artifactory.maven.MavenModelUtils.toMavenMetadata(MavenModelUtils.java:123) [artifactory-common-2.1.0.jar:na] at org.artifactory.repo.virtual.VirtualRepoDownloadStrategy.getMavenMetadataContent(VirtualRepoDownloadStrategy.java:262) [artifactory-core-2.1.0.jar:na] --------------------------------------------------------- cut --------------------------------------------------------- Artifactory should blacklist the repository rather then failing to resolve the artifact.

    JFrog JIRA | 8 years ago | Lorand Somogyi
    java.io.IOException: Failed to parse metadata: Unrecognised tag: 'version' (position: START_TAG seen ...<versioning>\n <version>... @7:11)

    Root Cause Analysis

    1. java.io.IOException

      Failed to parse metadata: Unrecognised tag: 'version' (position: START_TAG seen ...<versioning>\n <version>... @7:11)

      at org.artifactory.maven.MavenModelUtils.toMavenMetadata()
    2. org.artifactory.maven
      MavenModelUtils.toMavenMetadata
      1. org.artifactory.maven.MavenModelUtils.toMavenMetadata(MavenModelUtils.java:149)[artifactory-common-2.1.0.jar:na]
      2. org.artifactory.maven.MavenModelUtils.toMavenMetadata(MavenModelUtils.java:123)[artifactory-common-2.1.0.jar:na]
      2 frames
    3. org.artifactory.repo
      VirtualRepoDownloadStrategy.getMavenMetadataContent
      1. org.artifactory.repo.virtual.VirtualRepoDownloadStrategy.getMavenMetadataContent(VirtualRepoDownloadStrategy.java:262)[artifactory-core-2.1.0.jar:na]
      1 frame