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
static VersionNumber CUT_OFF
          Hudson -> Jenkins cut-over version.
protected static org.apache.maven.artifact.repository.ArtifactRepositoryPolicy POLICY
           
 
Constructor Summary
MavenRepositoryImpl()
           
 
Method Summary
 void addRemoteRepository(String id, File indexDirectory, URL repository)
           
 void addRemoteRepository(String id, URL repository)
           
 void addRemoteRepository(String id, URL remoteIndex, URL repository)
           
protected  HPI createHpiArtifact(org.sonatype.nexus.index.ArtifactInfo a, PluginHistory p)
           
protected  HudsonWar createHudsonWarArtifact(org.sonatype.nexus.index.ArtifactInfo a)
           
 TreeMap<VersionNumber,HudsonWar> getHudsonWar()
          Discover all hudson.war versions.
 Collection<PluginHistory> listHudsonPlugins()
          Discover all plugins from this Maven repository.
protected  File resolve(org.sonatype.nexus.index.ArtifactInfo a, 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

CUT_OFF

public static final VersionNumber CUT_OFF
Hudson -> Jenkins cut-over version.

Constructor Detail

MavenRepositoryImpl

public MavenRepositoryImpl()
                    throws Exception
Throws:
Exception
Method Detail

addRemoteRepository

public void addRemoteRepository(String id,
                                File indexDirectory,
                                URL repository)
                         throws 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:
IOException
org.sonatype.nexus.index.context.UnsupportedExistingLuceneIndexException

addRemoteRepository

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

addRemoteRepository

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

resolve

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

listHudsonPlugins

public Collection<PluginHistory> listHudsonPlugins()
                                            throws org.codehaus.plexus.PlexusContainerException,
                                                   org.codehaus.plexus.component.repository.exception.ComponentLookupException,
                                                   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
IOException
org.sonatype.nexus.index.context.UnsupportedExistingLuceneIndexException
org.apache.maven.artifact.resolver.AbstractArtifactResolutionException

getHudsonWar

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

Specified by:
getHudsonWar in class MavenRepository
Throws:
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 © 2004-2011. All Rights Reserved.