o Refactored code to be more general/clear

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@927050 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-03-24 13:26:24 +00:00
parent 4b084a7e3f
commit dfd067b3ed
5 changed files with 26 additions and 1 deletions

View File

@ -75,6 +75,14 @@ public interface ArtifactRepository
*/
List<String> findVersions( Artifact artifact );
/**
* Indicates whether this repository is backed by actual projects. For instance, the build reactor or IDE workspace
* are examples of such repositories.
*
* @return {@code true} if the repository is backed by actual projects, {@code false} otherwise.
*/
boolean isProjectAware();
void setAuthentication( Authentication authentication );
Authentication getAuthentication();

View File

@ -216,6 +216,11 @@ public class DefaultArtifactRepository
return Collections.emptyList();
}
public boolean isProjectAware()
{
return false;
}
public Authentication getAuthentication()
{
return authentication;

View File

@ -276,4 +276,11 @@ public class ReactorArtifactRepository
return eq( reactorProjects.keySet(), other.reactorProjects.keySet() );
}
@Override
public boolean isProjectAware()
{
return true;
}
}

View File

@ -375,4 +375,9 @@ public class MavenArtifactRepository
return true;
}
public boolean isProjectAware()
{
return false;
}
}

View File

@ -238,7 +238,7 @@ public class DefaultProjectBuilder
"Error resolving project artifact: " + e.getMessage(), e );
}
boolean localProject = artifact.getRepository() != null && "reactor".equals( artifact.getRepository().getId() );
boolean localProject = artifact.getRepository() != null && artifact.getRepository().isProjectAware();
File pomFile = artifact.getFile();