org.jvnet.hudson.update_center
Class MavenRepositoryImpl

java.lang.Object
  extended by org.jvnet.hudson.update_center.MavenRepository
      extended by org.jvnet.hudson.update_center.MavenRepositoryImpl

public class MavenRepositoryImpl
extends MavenRepository

Maven repository and its nexus index. Using Maven embedder 2.0.4 results in problem caused by Plexus incompatibility.

Author:
Kohsuke Kawaguchi

Field Summary
protected static org.apache.maven.artifact.repository.ArtifactRepositoryPolicy POLICY
           
 
Constructor Summary
MavenRepositoryImpl()
           
 
Method Summary
 void addRemoteRepository(java.lang.String id, java.io.File indexDirectory, java.net.URL repository)
           
 void addRemoteRepository(java.lang.String id, java.net.URL repository)
           
 void addRemoteRepository(java.lang.String id, java.net.URL remoteIndex, java.net.URL repository)
           
protected  HPI createHpiArtifact(org.sonatype.nexus.index.ArtifactInfo a, PluginHistory p)
           
protected  HudsonWar createHudsonWarArtifact(org.sonatype.nexus.index.ArtifactInfo a)
           
 java.util.TreeMap<VersionNumber,HudsonWar> getHudsonWar()
          Discover all hudson.war versions.
 java.util.Collection<PluginHistory> listHudsonPlugins()
          Discover all plugins from this Maven repository.
protected  java.io.File resolve(org.sonatype.nexus.index.ArtifactInfo a, java.lang.String type)
           
 
Methods inherited from class org.jvnet.hudson.update_center.MavenRepository
listHudsonPluginsByReleaseDate, resolve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POLICY

protected static final org.apache.maven.artifact.repository.ArtifactRepositoryPolicy POLICY
Constructor Detail

MavenRepositoryImpl

public MavenRepositoryImpl()
                    throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

addRemoteRepository

public void addRemoteRepository(java.lang.String id,
                                java.io.File indexDirectory,
                                java.net.URL repository)
                         throws java.io.IOException,
                                org.sonatype.nexus.index.context.UnsupportedExistingLuceneIndexException
Parameters:
id - Repository ID. This ID has to match the ID in the repository index, due to a design bug in Maven.
indexDirectory - Directory that contains exploded index zip file.
repository - URL of the Maven repository. Used to resolve artifacts.
Throws:
java.io.IOException
org.sonatype.nexus.index.context.UnsupportedExistingLuceneIndexException

addRemoteRepository

public void addRemoteRepository(java.lang.String id,
                                java.net.URL repository)
                         throws java.io.IOException,
                                org.sonatype.nexus.index.context.UnsupportedExistingLuceneIndexException
Throws:
java.io.IOException
org.sonatype.nexus.index.context.UnsupportedExistingLuceneIndexException

addRemoteRepository

public void addRemoteRepository(java.lang.String id,
                                java.net.URL remoteIndex,
                                java.net.URL repository)
                         throws java.io.IOException,
                                org.sonatype.nexus.index.context.UnsupportedExistingLuceneIndexException
Throws:
java.io.IOException
org.sonatype.nexus.index.context.UnsupportedExistingLuceneIndexException

resolve

protected java.io.File resolve(org.sonatype.nexus.index.ArtifactInfo a,
                               java.lang.String type)
                        throws org.apache.maven.artifact.resolver.AbstractArtifactResolutionException
Specified by:
resolve in class MavenRepository
Throws:
org.apache.maven.artifact.resolver.AbstractArtifactResolutionException

listHudsonPlugins

public java.util.Collection<PluginHistory> listHudsonPlugins()
                                                      throws org.codehaus.plexus.PlexusContainerException,
                                                             org.codehaus.plexus.component.repository.exception.ComponentLookupException,
                                                             java.io.IOException,
                                                             org.sonatype.nexus.index.context.UnsupportedExistingLuceneIndexException,
                                                             org.apache.maven.artifact.resolver.AbstractArtifactResolutionException
Description copied from class: MavenRepository
Discover all plugins from this Maven repository.

Specified by:
listHudsonPlugins in class MavenRepository
Throws:
org.codehaus.plexus.PlexusContainerException
org.codehaus.plexus.component.repository.exception.ComponentLookupException
java.io.IOException
org.sonatype.nexus.index.context.UnsupportedExistingLuceneIndexException
org.apache.maven.artifact.resolver.AbstractArtifactResolutionException

getHudsonWar

public java.util.TreeMap<VersionNumber,HudsonWar> getHudsonWar()
                                                        throws java.io.IOException,
                                                               org.apache.maven.artifact.resolver.AbstractArtifactResolutionException
Description copied from class: MavenRepository
Discover all hudson.war versions.

Specified by:
getHudsonWar in class MavenRepository
Throws:
java.io.IOException
org.apache.maven.artifact.resolver.AbstractArtifactResolutionException

createHpiArtifact

protected HPI createHpiArtifact(org.sonatype.nexus.index.ArtifactInfo a,
                                PluginHistory p)
                         throws org.apache.maven.artifact.resolver.AbstractArtifactResolutionException
Throws:
org.apache.maven.artifact.resolver.AbstractArtifactResolutionException

createHudsonWarArtifact

protected HudsonWar createHudsonWarArtifact(org.sonatype.nexus.index.ArtifactInfo a)


Copyright © 2010. All Rights Reserved.