Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-666

need to be able to operate on a Maven 1 repository

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.0-alpha-3
    • 2.0-beta-1
    • None
    • Not of importance.

    Description

      I have an ANT script using maven antlib (alpha-3) as follows:

      ...

      <target name="getdeps">
      <artifact:remoteRepository
      id="remote.repository" url="http://172.16.40.249/ourrepo" layout="legacy"/>

      <artifact:dependencies verbose="true">
      <remoteRepository refid="remote.repository"/>
      <dependency groupId="sis2" artifactId="sis2-common" version="0.1"/>
      </artifact:dependencies>
      </target>

      ...

      The central repository contains only artifacts with model-3.0.0 POMs (generated by Maven 1.1)

      However when executing the ANT target I get the following exception:

      — Nested Exception —
      org.apache.maven.artifact.resolver.TransitiveArtifactResolutionException: Unable to read the metadata file
      sis2:sis2-common:0.1:jar

      from the specified remote repositories:
      http://172.16.40.249/ourrepo
      Path to dependency:
      1) unspecified:unspecified:jar:0.0

      at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(DefaultArtifactCollector.java:164)
      at org.apache.maven.artifact.resolver.DefaultArtifactCollector.collect(DefaultArtifactCollector.java:66)
      at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:173)
      at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:199)
      at org.apache.maven.artifact.ant.DependenciesTask.execute(DependenciesTask.java:115)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      at org.apache.tools.ant.Task.perform(Task.java:364)
      at org.apache.tools.ant.Target.execute(Target.java:341)
      at org.apache.tools.ant.Target.performTasks(Target.java:369)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
      at org.apache.tools.ant.Main.runBuild(Main.java:668)
      at org.apache.tools.ant.Main.startAnt(Main.java:187)
      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
      Caused by: org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException: Unable to read the metadata file
      at org.apache.maven.project.artifact.MavenMetadataSource.retrieve(MavenMetadataSource.java:88)
      at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(DefaultArtifactCollector.java:151)
      ... 16 more
      Caused by: org.apache.maven.project.ProjectBuildingException: Failed to validate POM for 'Artifact [sis2:sis2-common:pom:0.1]'.

      Reason(s):
      [0] 'modelVersion' is missing.

      at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLogic(DefaultMavenProjectBuilder.java:439)
      at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:317)
      at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:220)
      at org.apache.maven.project.artifact.MavenMetadataSource.retrieve(MavenMetadataSource.java:81)
      ... 17 more

      The problem is that in the class DefaultModelValidator (apparently always called when retrieving a dependency) a check is done to verify whether the element <modelVersion> is present in the POM. However for model-3.0.0 POMs this element isn't defined in the XSD!

      Regards,
      Davy Toch

      Attachments

        Issue Links

          Activity

            People

              jdcasey John Dennis Casey
              dtoch Davy Toch
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 2h
                  2h
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h
                  2h