o fixed javadoc
o removed some "TODO Auto-generated method stub" o handled some "TODO Auto-generated catch block" git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@610987 13f79535-47bb-0310-9956-ffa450edef68master
parent
c2eb4273ab
commit
cfa95697e9
|
|
@ -36,9 +36,7 @@ import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
|
|||
public class ResolverExpressionEvaluatorStub
|
||||
implements ExpressionEvaluator
|
||||
{
|
||||
/**
|
||||
* @see org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator#evaluate(java.lang.String)
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public Object evaluate( String expr )
|
||||
throws ExpressionEvaluationException
|
||||
{
|
||||
|
|
@ -123,18 +121,14 @@ public class ResolverExpressionEvaluatorStub
|
|||
return expr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator#alignToBaseDirectory(java.io.File)
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public File alignToBaseDirectory( File file )
|
||||
{
|
||||
if ( file.getAbsolutePath().startsWith( PlexusTestCase.getBasedir() ) )
|
||||
{
|
||||
return file;
|
||||
}
|
||||
else
|
||||
{
|
||||
return new File( PlexusTestCase.getBasedir() + File.pathSeparator + file.getPath() );
|
||||
}
|
||||
|
||||
return new File( PlexusTestCase.getBasedir() + File.pathSeparator + file.getPath() );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,171 +25,304 @@ import org.codehaus.plexus.logging.Logger;
|
|||
/**
|
||||
* This logger implements both types of logs currently in use. It can be injected where needed
|
||||
* to turn off logs during testing where they aren't desired.
|
||||
*
|
||||
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
|
||||
* @version $Id: SilentLog.java 546355 2007-06-12 02:00:02Z brianf $
|
||||
*/
|
||||
public class SilentLog
|
||||
implements Log, Logger
|
||||
{
|
||||
|
||||
/**
|
||||
* @return <code>false</code>
|
||||
* @see org.apache.maven.plugin.logging.Log#isDebugEnabled()
|
||||
*/
|
||||
public boolean isDebugEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.apache.maven.plugin.logging.Log#debug(java.lang.CharSequence)
|
||||
*/
|
||||
public void debug( CharSequence content )
|
||||
{
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.apache.maven.plugin.logging.Log#debug(java.lang.CharSequence, java.lang.Throwable)
|
||||
*/
|
||||
public void debug( CharSequence content, Throwable error )
|
||||
{
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.apache.maven.plugin.logging.Log#debug(java.lang.Throwable)
|
||||
*/
|
||||
public void debug( Throwable error )
|
||||
{
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>false</code>
|
||||
* @see org.apache.maven.plugin.logging.Log#isInfoEnabled()
|
||||
*/
|
||||
public boolean isInfoEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.apache.maven.plugin.logging.Log#info(java.lang.CharSequence)
|
||||
*/
|
||||
public void info( CharSequence content )
|
||||
{
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.apache.maven.plugin.logging.Log#info(java.lang.CharSequence, java.lang.Throwable)
|
||||
*/
|
||||
public void info( CharSequence content, Throwable error )
|
||||
{
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.apache.maven.plugin.logging.Log#info(java.lang.Throwable)
|
||||
*/
|
||||
public void info( Throwable error )
|
||||
{
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.apache.maven.plugin.logging.Log#isWarnEnabled()
|
||||
*/
|
||||
public boolean isWarnEnabled()
|
||||
{
|
||||
// nop
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.apache.maven.plugin.logging.Log#warn(java.lang.CharSequence)
|
||||
*/
|
||||
public void warn( CharSequence content )
|
||||
{
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.apache.maven.plugin.logging.Log#warn(java.lang.CharSequence, java.lang.Throwable)
|
||||
*/
|
||||
public void warn( CharSequence content, Throwable error )
|
||||
{
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.apache.maven.plugin.logging.Log#warn(java.lang.Throwable)
|
||||
*/
|
||||
public void warn( Throwable error )
|
||||
{
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>false</code>
|
||||
* @see org.apache.maven.plugin.logging.Log#isErrorEnabled()
|
||||
*/
|
||||
public boolean isErrorEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.apache.maven.plugin.logging.Log#error(java.lang.CharSequence)
|
||||
*/
|
||||
public void error( CharSequence content )
|
||||
{
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.apache.maven.plugin.logging.Log#error(java.lang.CharSequence, java.lang.Throwable)
|
||||
*/
|
||||
public void error( CharSequence content, Throwable error )
|
||||
{
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.apache.maven.plugin.logging.Log#error(java.lang.Throwable)
|
||||
*/
|
||||
public void error( Throwable error )
|
||||
{
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.codehaus.plexus.logging.Logger#debug(java.lang.String)
|
||||
*/
|
||||
public void debug( String message )
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.codehaus.plexus.logging.Logger#debug(java.lang.String, java.lang.Throwable)
|
||||
*/
|
||||
public void debug( String message, Throwable throwable )
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.codehaus.plexus.logging.Logger#info(java.lang.String)
|
||||
*/
|
||||
public void info( String message )
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.codehaus.plexus.logging.Logger#info(java.lang.String, java.lang.Throwable)
|
||||
*/
|
||||
public void info( String message, Throwable throwable )
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.codehaus.plexus.logging.Logger#warn(java.lang.String)
|
||||
*/
|
||||
public void warn( String message )
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.codehaus.plexus.logging.Logger#warn(java.lang.String, java.lang.Throwable)
|
||||
*/
|
||||
public void warn( String message, Throwable throwable )
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.codehaus.plexus.logging.Logger#error(java.lang.String)
|
||||
*/
|
||||
public void error( String message )
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.codehaus.plexus.logging.Logger#error(java.lang.String, java.lang.Throwable)
|
||||
*/
|
||||
public void error( String message, Throwable throwable )
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.codehaus.plexus.logging.Logger#fatalError(java.lang.String)
|
||||
*/
|
||||
public void fatalError( String message )
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.codehaus.plexus.logging.Logger#fatalError(java.lang.String, java.lang.Throwable)
|
||||
*/
|
||||
public void fatalError( String message, Throwable throwable )
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>false</code>
|
||||
* @see org.codehaus.plexus.logging.Logger#isFatalErrorEnabled()
|
||||
*/
|
||||
public boolean isFatalErrorEnabled()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>null</code>
|
||||
* @see org.codehaus.plexus.logging.Logger#getChildLogger(java.lang.String)
|
||||
*/
|
||||
public Logger getChildLogger( String name )
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>0</code>
|
||||
* @see org.codehaus.plexus.logging.Logger#getThreshold()
|
||||
*/
|
||||
public int getThreshold()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>null</code>
|
||||
* @see org.codehaus.plexus.logging.Logger#getName()
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.codehaus.plexus.logging.Logger#setThreshold(int)
|
||||
*/
|
||||
public void setThreshold( int theThreshold )
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,49 +67,37 @@ public class ArtifactStub
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.maven.artifact.Artifact#getGroupId()
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public String getGroupId()
|
||||
{
|
||||
return groupId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.maven.artifact.Artifact#getArtifactId()
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public String getArtifactId()
|
||||
{
|
||||
return artifactId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.maven.artifact.Artifact#getVersion()
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public String getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.maven.artifact.Artifact#setVersion(java.lang.String)
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public void setVersion( String version )
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.maven.artifact.Artifact#getScope()
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public String getScope()
|
||||
{
|
||||
return scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.maven.artifact.Artifact#getType()
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
|
|
@ -125,41 +113,32 @@ public class ArtifactStub
|
|||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.maven.artifact.Artifact#getClassifier()
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public String getClassifier()
|
||||
{
|
||||
return classifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.maven.artifact.Artifact#hasClassifier()
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public boolean hasClassifier()
|
||||
{
|
||||
return classifier != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.maven.artifact.Artifact#getFile()
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public File getFile()
|
||||
{
|
||||
return file;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.maven.artifact.Artifact#setFile(java.io.File)
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public void setFile( File file )
|
||||
{
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, return <code>null</code>.
|
||||
*
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.Artifact#getBaseVersion()
|
||||
*/
|
||||
public String getBaseVersion()
|
||||
|
|
@ -178,8 +157,7 @@ public class ArtifactStub
|
|||
}
|
||||
|
||||
/**
|
||||
* By default, return <code>null</code>.
|
||||
*
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.Artifact#getId()
|
||||
*/
|
||||
public String getId()
|
||||
|
|
@ -188,8 +166,7 @@ public class ArtifactStub
|
|||
}
|
||||
|
||||
/**
|
||||
* By default, return <code>groupId:artifactId:type:classifier</code>.
|
||||
*
|
||||
* @return <code>groupId:artifactId:type:classifier</code>.
|
||||
* @see org.apache.maven.artifact.Artifact#getDependencyConflictId()
|
||||
*/
|
||||
public String getDependencyConflictId()
|
||||
|
|
@ -215,8 +192,7 @@ public class ArtifactStub
|
|||
}
|
||||
|
||||
/**
|
||||
* By default, return <code>null</code>.
|
||||
*
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.Artifact#getMetadataList()
|
||||
*/
|
||||
public Collection getMetadataList()
|
||||
|
|
@ -224,21 +200,13 @@ public class ArtifactStub
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a new artifact repository
|
||||
*
|
||||
* @see org.apache.maven.artifact.Artifact#setRepository(org.apache.maven.artifact.repository.ArtifactRepository)
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public void setRepository( ArtifactRepository artifactRepository )
|
||||
{
|
||||
this.artifactRepository = artifactRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns repository for artifact
|
||||
*
|
||||
* @see org.apache.maven.artifact.Artifact#getRepository()
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public ArtifactRepository getRepository()
|
||||
{
|
||||
return artifactRepository;
|
||||
|
|
@ -255,8 +223,7 @@ public class ArtifactStub
|
|||
}
|
||||
|
||||
/**
|
||||
* By default, return <code>null</code>.
|
||||
*
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.Artifact#getDownloadUrl()
|
||||
*/
|
||||
public String getDownloadUrl()
|
||||
|
|
@ -275,8 +242,7 @@ public class ArtifactStub
|
|||
}
|
||||
|
||||
/**
|
||||
* By default, return <code>null</code>.
|
||||
*
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.Artifact#getDependencyFilter()
|
||||
*/
|
||||
public ArtifactFilter getDependencyFilter()
|
||||
|
|
@ -295,8 +261,7 @@ public class ArtifactStub
|
|||
}
|
||||
|
||||
/**
|
||||
* By default, return <code>null</code>.
|
||||
*
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.Artifact#getArtifactHandler()
|
||||
*/
|
||||
public ArtifactHandler getArtifactHandler()
|
||||
|
|
@ -305,8 +270,7 @@ public class ArtifactStub
|
|||
}
|
||||
|
||||
/**
|
||||
* By default, return <code>null</code>.
|
||||
*
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.Artifact#getDependencyTrail()
|
||||
*/
|
||||
public List getDependencyTrail()
|
||||
|
|
@ -324,17 +288,14 @@ public class ArtifactStub
|
|||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.maven.artifact.Artifact#setScope(java.lang.String)
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public void setScope( String scope )
|
||||
{
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, return <code>null</code>.
|
||||
*
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.Artifact#getVersionRange()
|
||||
*/
|
||||
public VersionRange getVersionRange()
|
||||
|
|
@ -362,25 +323,20 @@ public class ArtifactStub
|
|||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.maven.artifact.Artifact#setGroupId(java.lang.String)
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public void setGroupId( String groupId )
|
||||
{
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.maven.artifact.Artifact#setArtifactId(java.lang.String)
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public void setArtifactId( String artifactId )
|
||||
{
|
||||
this.artifactId = artifactId;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, return <code>false</code>.
|
||||
*
|
||||
* @return <code>false</code>.
|
||||
* @see org.apache.maven.artifact.Artifact#isSnapshot()
|
||||
*/
|
||||
public boolean isSnapshot()
|
||||
|
|
@ -400,8 +356,7 @@ public class ArtifactStub
|
|||
}
|
||||
|
||||
/**
|
||||
* By default, return <code>false</code>.
|
||||
*
|
||||
* @return <code>false</code>.
|
||||
* @see org.apache.maven.artifact.Artifact#isResolved()
|
||||
*/
|
||||
public boolean isResolved()
|
||||
|
|
@ -430,8 +385,7 @@ public class ArtifactStub
|
|||
}
|
||||
|
||||
/**
|
||||
* By default, return <code>false</code>.
|
||||
*
|
||||
* @return <code>false</code>.
|
||||
* @see org.apache.maven.artifact.Artifact#isRelease()
|
||||
*/
|
||||
public boolean isRelease()
|
||||
|
|
@ -450,8 +404,7 @@ public class ArtifactStub
|
|||
}
|
||||
|
||||
/**
|
||||
* By default, return <code>null</code>.
|
||||
*
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.Artifact#getAvailableVersions()
|
||||
*/
|
||||
public List getAvailableVersions()
|
||||
|
|
@ -470,8 +423,7 @@ public class ArtifactStub
|
|||
}
|
||||
|
||||
/**
|
||||
* By default, return <code>false</code>.
|
||||
*
|
||||
* @return <code>false</code>.
|
||||
* @see org.apache.maven.artifact.Artifact#isOptional()
|
||||
*/
|
||||
public boolean isOptional()
|
||||
|
|
@ -490,8 +442,7 @@ public class ArtifactStub
|
|||
}
|
||||
|
||||
/**
|
||||
* By default, return <code>null</code>.
|
||||
*
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.Artifact#getSelectedVersion()
|
||||
*/
|
||||
public ArtifactVersion getSelectedVersion()
|
||||
|
|
@ -501,8 +452,7 @@ public class ArtifactStub
|
|||
}
|
||||
|
||||
/**
|
||||
* By default, return <code>false</code>.
|
||||
*
|
||||
* @return <code>false</code>.
|
||||
* @see org.apache.maven.artifact.Artifact#isSelectedVersionKnown()
|
||||
*/
|
||||
public boolean isSelectedVersionKnown()
|
||||
|
|
@ -547,5 +497,4 @@ public class ArtifactStub
|
|||
sb.append( getClassifier() );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,9 +22,10 @@ package org.apache.maven.plugin.testing.stubs;
|
|||
import org.apache.maven.artifact.handler.ArtifactHandler;
|
||||
|
||||
/**
|
||||
* minimal artifact handler used by the stub factory to create unpackable archives.
|
||||
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
|
||||
* Minimal artifact handler used by the stub factory to create unpackable archives.
|
||||
*
|
||||
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
|
||||
* @version $Id: $
|
||||
*/
|
||||
public class DefaultArtifactHandlerStub
|
||||
implements ArtifactHandler
|
||||
|
|
@ -45,6 +46,10 @@ public class DefaultArtifactHandlerStub
|
|||
|
||||
private boolean addedToClasspath;
|
||||
|
||||
/**
|
||||
* @param t the artifact handler type
|
||||
* @param c the artifact handler classifier
|
||||
*/
|
||||
public DefaultArtifactHandlerStub( String t, String c )
|
||||
{
|
||||
type = t;
|
||||
|
|
@ -56,11 +61,15 @@ public class DefaultArtifactHandlerStub
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param t the artifact handler type
|
||||
*/
|
||||
public DefaultArtifactHandlerStub( String type )
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public String getExtension()
|
||||
{
|
||||
if ( extension == null )
|
||||
|
|
@ -70,16 +79,21 @@ public class DefaultArtifactHandlerStub
|
|||
return extension;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the artifact handler type
|
||||
*/
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public String getClassifier()
|
||||
{
|
||||
return classifier;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public String getDirectory()
|
||||
{
|
||||
if ( directory == null )
|
||||
|
|
@ -89,6 +103,7 @@ public class DefaultArtifactHandlerStub
|
|||
return directory;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public String getPackaging()
|
||||
{
|
||||
if ( packaging == null )
|
||||
|
|
@ -98,11 +113,13 @@ public class DefaultArtifactHandlerStub
|
|||
return packaging;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public boolean isIncludesDependencies()
|
||||
{
|
||||
return includesDependencies;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public String getLanguage()
|
||||
{
|
||||
if ( language == null )
|
||||
|
|
@ -113,6 +130,7 @@ public class DefaultArtifactHandlerStub
|
|||
return language;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public boolean isAddedToClasspath()
|
||||
{
|
||||
return addedToClasspath;
|
||||
|
|
|
|||
|
|
@ -35,34 +35,21 @@ import org.apache.maven.artifact.resolver.ResolutionNode;
|
|||
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
|
||||
*
|
||||
* @version $Id: $
|
||||
*/
|
||||
public class StubArtifactCollector
|
||||
implements ArtifactCollector
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* Default constructor
|
||||
*/
|
||||
public StubArtifactCollector()
|
||||
{
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.apache.maven.artifact.resolver.ArtifactCollector#collect(java.util.Set,
|
||||
* org.apache.maven.artifact.Artifact,
|
||||
* org.apache.maven.artifact.repository.ArtifactRepository,
|
||||
* java.util.List,
|
||||
* org.apache.maven.artifact.metadata.ArtifactMetadataSource,
|
||||
* org.apache.maven.artifact.resolver.filter.ArtifactFilter,
|
||||
* java.util.List)
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public ArtifactResolutionResult collect( Set theArtifacts, Artifact theOriginatingArtifact,
|
||||
ArtifactRepository theLocalRepository, List theRemoteRepositories,
|
||||
ArtifactMetadataSource theSource, ArtifactFilter theFilter,
|
||||
|
|
@ -81,17 +68,7 @@ public class StubArtifactCollector
|
|||
return arr;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.apache.maven.artifact.resolver.ArtifactCollector#collect(java.util.Set,
|
||||
* org.apache.maven.artifact.Artifact, java.util.Map,
|
||||
* org.apache.maven.artifact.repository.ArtifactRepository,
|
||||
* java.util.List,
|
||||
* org.apache.maven.artifact.metadata.ArtifactMetadataSource,
|
||||
* org.apache.maven.artifact.resolver.filter.ArtifactFilter,
|
||||
* java.util.List)
|
||||
*/
|
||||
/** {@inheritDoc} */
|
||||
public ArtifactResolutionResult collect( Set theArtifacts, Artifact theOriginatingArtifact, Map theManagedVersions,
|
||||
ArtifactRepository theLocalRepository, List theRemoteRepositories,
|
||||
ArtifactMetadataSource theSource, ArtifactFilter theFilter,
|
||||
|
|
@ -109,5 +86,4 @@ public class StubArtifactCollector
|
|||
arr.setArtifactResolutionNodes( nodes );
|
||||
return arr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,99 +26,148 @@ import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
|
|||
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
|
||||
*
|
||||
* @version $Id: $
|
||||
*/
|
||||
public class StubArtifactRepository
|
||||
implements ArtifactRepository
|
||||
{
|
||||
String baseDir = null;
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*
|
||||
* @param dir the basedir
|
||||
*/
|
||||
public StubArtifactRepository( String dir )
|
||||
{
|
||||
baseDir = dir;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the <code>artifactId</code>.
|
||||
* @see org.apache.maven.artifact.repository.ArtifactRepository#pathOf(org.apache.maven.artifact.Artifact)
|
||||
*/
|
||||
public String pathOf( Artifact artifact )
|
||||
{
|
||||
return artifact.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.repository.ArtifactRepository#pathOfRemoteRepositoryMetadata(org.apache.maven.artifact.metadata.ArtifactMetadata)
|
||||
*/
|
||||
public String pathOfRemoteRepositoryMetadata( ArtifactMetadata artifactMetadata )
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the filename of this metadata on the local repository.
|
||||
* @see org.apache.maven.artifact.repository.ArtifactRepository#pathOfLocalRepositoryMetadata(org.apache.maven.artifact.metadata.ArtifactMetadata, org.apache.maven.artifact.repository.ArtifactRepository)
|
||||
*/
|
||||
public String pathOfLocalRepositoryMetadata( ArtifactMetadata metadata, ArtifactRepository repository )
|
||||
{
|
||||
return metadata.getLocalFilename( repository );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.repository.ArtifactRepository#getUrl()
|
||||
*/
|
||||
public String getUrl()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>basedir</code>.
|
||||
* @see org.apache.maven.artifact.repository.ArtifactRepository#getBasedir()
|
||||
*/
|
||||
public String getBasedir()
|
||||
{
|
||||
return baseDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.repository.ArtifactRepository#getProtocol()
|
||||
*/
|
||||
public String getProtocol()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.repository.ArtifactRepository#getId()
|
||||
*/
|
||||
public String getId()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.repository.ArtifactRepository#getSnapshots()
|
||||
*/
|
||||
public ArtifactRepositoryPolicy getSnapshots()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.repository.ArtifactRepository#getReleases()
|
||||
*/
|
||||
public ArtifactRepositoryPolicy getReleases()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.repository.ArtifactRepository#getLayout()
|
||||
*/
|
||||
public ArtifactRepositoryLayout getLayout()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.repository.ArtifactRepository#getKey()
|
||||
*/
|
||||
public String getKey()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>false</code>.
|
||||
* @see org.apache.maven.artifact.repository.ArtifactRepository#isUniqueVersion()
|
||||
*/
|
||||
public boolean isUniqueVersion()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.apache.maven.artifact.repository.ArtifactRepository#setBlacklisted(boolean)
|
||||
*/
|
||||
public void setBlacklisted( boolean blackListed )
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>false</code>.
|
||||
* @see org.apache.maven.artifact.repository.ArtifactRepository#isBlacklisted()
|
||||
*/
|
||||
public boolean isBlacklisted()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,8 +36,9 @@ import org.apache.maven.plugin.testing.ArtifactStubFactory;
|
|||
|
||||
/**
|
||||
* Stub resolver. The constructor allows the specification of the exception to throw so that handling can be tested too.
|
||||
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
|
||||
*
|
||||
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
|
||||
* @version $Id: $
|
||||
*/
|
||||
public class StubArtifactResolver
|
||||
implements ArtifactResolver
|
||||
|
|
@ -49,6 +50,13 @@ public class StubArtifactResolver
|
|||
|
||||
ArtifactStubFactory factory;
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*
|
||||
* @param factory
|
||||
* @param throwArtifactResolutionException
|
||||
* @param throwArtifactNotFoundException
|
||||
*/
|
||||
public StubArtifactResolver( ArtifactStubFactory factory, boolean throwArtifactResolutionException,
|
||||
boolean throwArtifactNotFoundException )
|
||||
{
|
||||
|
|
@ -79,8 +87,7 @@ public class StubArtifactResolver
|
|||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
throw new ArtifactResolutionException( "IOException: " + e.getMessage(), artifact, e );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -89,74 +96,93 @@ public class StubArtifactResolver
|
|||
{
|
||||
throw new ArtifactResolutionException( "Catch!", artifact );
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArtifactNotFoundException( "Catch!", artifact );
|
||||
}
|
||||
|
||||
throw new ArtifactNotFoundException( "Catch!", artifact );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.resolver.ArtifactResolver#resolveTransitively(java.util.Set, org.apache.maven.artifact.Artifact, java.util.List, org.apache.maven.artifact.repository.ArtifactRepository, org.apache.maven.artifact.metadata.ArtifactMetadataSource)
|
||||
*/
|
||||
public ArtifactResolutionResult resolveTransitively( Set artifacts, Artifact originatingArtifact,
|
||||
List remoteRepositories, ArtifactRepository localRepository,
|
||||
ArtifactMetadataSource source )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.resolver.ArtifactResolver#resolveTransitively(java.util.Set, org.apache.maven.artifact.Artifact, java.util.List, org.apache.maven.artifact.repository.ArtifactRepository, org.apache.maven.artifact.metadata.ArtifactMetadataSource, java.util.List)
|
||||
*/
|
||||
public ArtifactResolutionResult resolveTransitively( Set artifacts, Artifact originatingArtifact,
|
||||
List remoteRepositories, ArtifactRepository localRepository,
|
||||
ArtifactMetadataSource source, List listeners )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.resolver.ArtifactResolver#resolveTransitively(java.util.Set, org.apache.maven.artifact.Artifact, org.apache.maven.artifact.repository.ArtifactRepository, java.util.List, org.apache.maven.artifact.metadata.ArtifactMetadataSource, org.apache.maven.artifact.resolver.filter.ArtifactFilter)
|
||||
*/
|
||||
public ArtifactResolutionResult resolveTransitively( Set artifacts, Artifact originatingArtifact,
|
||||
ArtifactRepository localRepository, List remoteRepositories,
|
||||
ArtifactMetadataSource source, ArtifactFilter filter )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.resolver.ArtifactResolver#resolveTransitively(java.util.Set, org.apache.maven.artifact.Artifact, java.util.Map, org.apache.maven.artifact.repository.ArtifactRepository, java.util.List, org.apache.maven.artifact.metadata.ArtifactMetadataSource)
|
||||
*/
|
||||
public ArtifactResolutionResult resolveTransitively( Set artifacts, Artifact originatingArtifact,
|
||||
Map managedVersions, ArtifactRepository localRepository,
|
||||
List remoteRepositories, ArtifactMetadataSource source )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.resolver.ArtifactResolver#resolveTransitively(java.util.Set, org.apache.maven.artifact.Artifact, java.util.Map, org.apache.maven.artifact.repository.ArtifactRepository, java.util.List, org.apache.maven.artifact.metadata.ArtifactMetadataSource, org.apache.maven.artifact.resolver.filter.ArtifactFilter)
|
||||
*/
|
||||
public ArtifactResolutionResult resolveTransitively( Set artifacts, Artifact originatingArtifact,
|
||||
Map managedVersions, ArtifactRepository localRepository,
|
||||
List remoteRepositories, ArtifactMetadataSource source,
|
||||
ArtifactFilter filter )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>null</code>.
|
||||
* @see org.apache.maven.artifact.resolver.ArtifactResolver#resolveTransitively(java.util.Set, org.apache.maven.artifact.Artifact, java.util.Map, org.apache.maven.artifact.repository.ArtifactRepository, java.util.List, org.apache.maven.artifact.metadata.ArtifactMetadataSource, org.apache.maven.artifact.resolver.filter.ArtifactFilter, java.util.List)
|
||||
*/
|
||||
public ArtifactResolutionResult resolveTransitively( Set artifacts, Artifact originatingArtifact,
|
||||
Map managedVersions, ArtifactRepository localRepository,
|
||||
List remoteRepositories, ArtifactMetadataSource source,
|
||||
ArtifactFilter filter, List listeners )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, do nothing.
|
||||
*
|
||||
* @see org.apache.maven.artifact.resolver.ArtifactResolver#resolveAlways(org.apache.maven.artifact.Artifact, java.util.List, org.apache.maven.artifact.repository.ArtifactRepository)
|
||||
*/
|
||||
public void resolveAlways( Artifact artifact, List remoteRepositories, ArtifactRepository localRepository )
|
||||
throws ArtifactResolutionException, ArtifactNotFoundException
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
// nop
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue