Package org.eclipse.tycho.p2.facade
Class RepositoryReferenceTool
- java.lang.Object
-
- org.eclipse.tycho.p2.facade.RepositoryReferenceTool
-
@Component(role=RepositoryReferenceTool.class) public class RepositoryReferenceTool extends java.lang.Object
Tool to obtain the list of p2 repositories that contain the dependencies of a module.
-
-
Field Summary
Fields Modifier and Type Field Description private DefaultDependencyResolverFactory
dependencyResolverLocator
private EquinoxServiceFactory
osgiServices
static int
REPOSITORIES_INCLUDE_CURRENT_MODULE
Option to indicate that the publisher results of the given module shall be included in the list of repositories.
-
Constructor Summary
Constructors Constructor Description RepositoryReferenceTool()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addTargetPlatformRepository(RepositoryReferences sources, org.apache.maven.execution.MavenSession session, org.apache.maven.project.MavenProject project)
Restores the p2 metadata view on the module's build target platform that was calculated during the initial dependency resolution (see org.eclipse.tycho.p2.resolver.P2ResolverImpl.toResolutionResult(...)).RepositoryReferences
getVisibleRepositories(org.apache.maven.project.MavenProject module, org.apache.maven.execution.MavenSession session, int flags)
Returns the list of visible p2 repositories for the build of the current module.
-
-
-
Field Detail
-
REPOSITORIES_INCLUDE_CURRENT_MODULE
public static int REPOSITORIES_INCLUDE_CURRENT_MODULE
Option to indicate that the publisher results of the given module shall be included in the list of repositories.
-
osgiServices
@Requirement private EquinoxServiceFactory osgiServices
-
dependencyResolverLocator
@Requirement private DefaultDependencyResolverFactory dependencyResolverLocator
-
-
Method Detail
-
getVisibleRepositories
public RepositoryReferences getVisibleRepositories(org.apache.maven.project.MavenProject module, org.apache.maven.execution.MavenSession session, int flags) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
Returns the list of visible p2 repositories for the build of the current module. The list includes the p2 repositories of the referenced reactor modules, the target platform, and optionally the current module itself. The repositories are sorted in a reasonable order of precedence, so if there should be duplicate installable units or artifacts, the hope is that it is deterministic from which repository the unit or artifact is taken. The order is:- The publisher results of the current module (only if the flag
REPOSITORIES_INCLUDE_CURRENT_MODULE
is set), - The results of the referenced reactor modules,
- The non-reactor content of the module's target platform.
- Parameters:
module
- The current Maven projectsession
- The current Maven sessionflags
- Options flags; supported flags areREPOSITORIES_INCLUDE_CURRENT_MODULE
- Returns:
- a
RepositoryReferences
instance with the repositories. - Throws:
org.apache.maven.plugin.MojoExecutionException
- in case of internal errorsorg.apache.maven.plugin.MojoFailureException
- in case required artifacts are missing
- The publisher results of the current module (only if the flag
-
addTargetPlatformRepository
private void addTargetPlatformRepository(RepositoryReferences sources, org.apache.maven.execution.MavenSession session, org.apache.maven.project.MavenProject project) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
Restores the p2 metadata view on the module's build target platform that was calculated during the initial dependency resolution (see org.eclipse.tycho.p2.resolver.P2ResolverImpl.toResolutionResult(...)).- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
-