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

unexpected InvalidArtifactRTException from ProjectBuilder#build

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.2.5
    • None
    • None

    Description

      Calling into ProjectBuilder#build(File, ProjectBuildingRequest) results in InvalidArtifactRTException below if project pom.xml has managed dependency without <version>. Although the pom is invalid, I expected to get ProjectBuildingException that includes location of problematic dependency, similar to what I get during command line build.

      org.apache.maven.artifact.InvalidArtifactRTException: For artifact {org.apache.maven.its:a:null:jar}: The version cannot be empty.
      	at org.apache.maven.artifact.DefaultArtifact.validateIdentity(DefaultArtifact.java:148)
      	at org.apache.maven.artifact.DefaultArtifact.<init>(DefaultArtifact.java:123)
      	at org.apache.maven.bridge.MavenRepositorySystem.XcreateArtifact(MavenRepositorySystem.java:695)
      	at org.apache.maven.bridge.MavenRepositorySystem.XcreateDependencyArtifact(MavenRepositorySystem.java:613)
      	at org.apache.maven.bridge.MavenRepositorySystem.createDependencyArtifact(MavenRepositorySystem.java:121)
      	at org.apache.maven.project.DefaultProjectBuilder.initProject(DefaultProjectBuilder.java:808)
      	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:174)
      	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:118)
      ...
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              igorf Igor Fedorenko
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: