docs: public Metadata getMetadata( String path )
          throws IOException, MetadataNotFoundException
      {
          path = StringUtils.strip( path, "/" );
          int index = path.lastIndexOf( '/' );
          int index2 = index == -1 ? -1 : path.lastIndexOf( '/', index - 1 );
  
          String version = index2 == -1 ? null : path.substring( index + 1 );
          String artifactId = index2 == -1 ? null : path.substring( index2 + 1, index );
          String groupId = index2 == -1 ? null : path.substring( 0, index2 ).replace( '/', '.' );
  
          Metadata metadata = new Metadata();
  
          boolean foundSomething = false;
  
          // is this path a groupId:artifactId pair?
          if ( version != null && version.endsWith( "-SNAPSHOT" ) && !StringUtils.isEmpty( artifactId )
              && !StringUtils.isEmpty( groupId ) )
          {
              final org.apache.maven.artifact.Artifact artifact =
                  artifactFactory.createDependencyArtifact( groupId, artifactId,
                                                            VersionRange.createFromVersion( version ), "pom", null,
                                                            "compile" );
              final SnapshotArtifactRepositoryMetadata artifactRepositoryMetadata =
                  new SnapshotArtifactRepositoryMetadata( artifact );
              try
              {
                  repositoryMetadataManager.resolve( artifactRepositoryMetadata, remoteRepositories, localRepository );
  
                  final Metadata artifactMetadata = artifactRepositoryMetadata.getMetadata();
                  if ( artifactMetadata.getVersioning() != null
                      && artifactMetadata.getVersioning().getSnapshot() != null )
                  {
                      foundSomething = true;
                      metadata.setGroupId( groupId );
                      metadata.setArtifactId( artifactId );
                      metadata.setVersion( version );
                      metadata.merge( artifactMetadata );
                  }
                  try
                  {
                      if ( artifactMetadata.getVersioning() != null
                          && !artifactMetadata.getVersioning().getSnapshotVersions().isEmpty() )
                      {
                          // TODO up to and including Maven 3.0.3 we do not get a populated SnapshotVersions
                          for ( SnapshotVersion v : artifactMetadata.getVersioning().getSnapshotVersions() )
                          {
                              metadata.getVersioning().addSnapshotVersion( v );
                              if ( v.getVersion().endsWith( "-SNAPSHOT" ) )
                              {
                                  addResolved(
                                      new Artifact( groupId, artifactId, version, v.getClassifier(), v.getExtension() ) );
                              }
                          }
                      }
                  }
                  catch ( NoSuchMethodError e )
                  {
                      // ignore Maven 2.x doesn't give us the info
                  }
              }
              catch ( RepositoryMetadataResolutionException e )
              {
                  log.debug( e );
              }
          }
  
          // is this path a groupId:artifactId pair?
          artifactId = index == -1 ? null : path.substring( index + 1 );
          groupId = index == -1 ? null : path.substring( 0, index ).replace( '/', '.' );
          if ( !StringUtils.isEmpty( artifactId ) && !StringUtils.isEmpty( groupId ) )
          {
              final org.apache.maven.artifact.Artifact artifact =
                  artifactFactory.createDependencyArtifact( groupId, artifactId, anyVersion, "pom", null, "compile" );
              final ArtifactRepositoryMetadata artifactRepositoryMetadata = new ArtifactRepositoryMetadata( artifact );
              try
              {
                  repositoryMetadataManager.resolve( artifactRepositoryMetadata, remoteRepositories, localRepository );
  
                  final Metadata artifactMetadata = artifactRepositoryMetadata.getMetadata();
                  if ( artifactMetadata.getVersioning() != null )
                  {
                      foundSomething = true;
                      if ( StringUtils.isEmpty( metadata.getGroupId() ) )
                      {
                          metadata.setGroupId( groupId );
                          metadata.setArtifactId( artifactId );
                      }
                      metadata.merge( artifactMetadata );
                      for ( String v : artifactMetadata.getVersioning().getVersions() )
                      {
                          addResolved( path + "/" + v );
                      }
                  }
              }
              catch ( RepositoryMetadataResolutionException e )
              {
                  log.debug( e );
              }
          }
  
          // if this path a groupId on its own?
          groupId = path.replace( '/', '.' );
          final GroupRepositoryMetadata groupRepositoryMetadata = new GroupRepositoryMetadata( groupId );
          try
          {
              repositoryMetadataManager.resolve( groupRepositoryMetadata, remotePluginRepositories, localRepository );
              foundSomething = true;
              metadata.merge( groupRepositoryMetadata.getMetadata() );
              for ( Plugin plugin : groupRepositoryMetadata.getMetadata().getPlugins() )
              {
                  addResolved( path + "/" + plugin.getArtifactId() );
              }
          }
          catch ( RepositoryMetadataResolutionException e )
          {
              log.debug( e );
          }
  
          if ( !foundSomething )
          {
              throw new MetadataNotFoundException( path );
          }
          addResolved( path );
          return metadata;
      }