Package org.eclipse.tycho.core.resolver
Class DefaultTargetPlatformConfigurationReader
- java.lang.Object
-
- org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader
-
@Component(role=DefaultTargetPlatformConfigurationReader.class) public class DefaultTargetPlatformConfigurationReader extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ALLOW_CONFLICTING_DEPENDENCIES
static java.lang.String
BREE_HEADER_SELECTION_POLICY
static java.lang.String
DEPENDENCY_RESOLUTION
static java.lang.String
ENVIRONMENTS
static java.lang.String
EXECUTION_ENVIRONMENT
static java.lang.String
EXECUTION_ENVIRONMENT_DEFAULT
private static java.lang.String
FILE_EXTENSION
private TargetPlatformFilterConfigurationReader
filterReader
static java.lang.String
FILTERS
static java.lang.String
INCLUDE_PACKED_ARTIFACTS
private org.codehaus.plexus.logging.Logger
logger
private static java.lang.String
OPTIONAL_RESOLUTION_IGNORE
private static java.lang.String
OPTIONAL_RESOLUTION_REQUIRE
static java.lang.String
POM_DEPENDENCIES
private java.util.Map<java.lang.String,TychoProject>
projectTypes
private org.apache.maven.repository.RepositorySystem
repositorySystem
static java.lang.String
RESOLVE_WITH_EXECUTION_ENVIRONMENT_CONSTRAINTS
static java.lang.String
RESOLVER
static java.lang.String
TARGET
static java.lang.String
TARGET_DEFINITION_INCLUDE_SOURCE
-
Constructor Summary
Constructors Constructor Description DefaultTargetPlatformConfigurationReader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addTargetArtifact(TargetPlatformConfiguration result, org.apache.maven.execution.MavenSession session, org.apache.maven.project.MavenProject project, org.codehaus.plexus.util.xml.Xpp3Dom artifactDom)
private void
addTargetEnvironments(TargetPlatformConfiguration result, org.apache.maven.project.MavenProject project, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
protected TargetEnvironment
getDeprecatedTargetEnvironment(org.codehaus.plexus.util.xml.Xpp3Dom configuration)
private static java.lang.String
getStringValue(org.codehaus.plexus.util.xml.Xpp3Dom element)
Returns the string value of the given node, with all "value not set" cases normalized tonull
.TargetPlatformConfiguration
getTargetPlatformConfiguration(org.apache.maven.execution.MavenSession session, org.apache.maven.project.MavenProject project)
static boolean
isPrimaryTarget(org.apache.maven.project.MavenProject project, java.io.File targetFile, java.io.File[] otherTargetFiles)
Checks if the given target file is the "primary" target artifact file among othersstatic boolean
isTargetFile(java.io.File file)
static java.io.File[]
listTargetFiles(java.io.File folder)
List all target files in the given folderprivate static TargetEnvironment
newTargetEnvironment(org.codehaus.plexus.util.xml.Xpp3Dom environmentDom)
private void
readDependencyResolutionConfiguration(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
protected void
readExtraRequirements(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom resolverDom)
private void
readFilters(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
private void
readProfileProperties(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom resolverDom)
private void
setAllowConflictingDependencies(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
private void
setBREEHeaderSelectionPolicy(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
private void
setDisableP2Mirrors(org.codehaus.plexus.util.xml.Xpp3Dom configuration)
private void
setExecutionEnvironment(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
private void
setExecutionEnvironmentDefault(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
private void
setIncludePackedArtifacts(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
private void
setOptionalDependencies(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom resolverDom)
private void
setPomDependencies(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
private void
setResolveWithEEContraints(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom resolverDom)
Take the constraints of the configured execution environment into account when resolving dependencies or target definitions.private void
setTarget(TargetPlatformConfiguration result, org.apache.maven.execution.MavenSession session, org.apache.maven.project.MavenProject project, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
private void
setTargetDefinitionIncludeSources(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
private void
setTargetPlatformResolver(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
static void
throwNoPrimaryTargetFound(org.apache.maven.project.MavenProject project, java.io.File[] targetFiles)
-
-
-
Field Detail
-
TARGET_DEFINITION_INCLUDE_SOURCE
public static final java.lang.String TARGET_DEFINITION_INCLUDE_SOURCE
- See Also:
- Constant Field Values
-
INCLUDE_PACKED_ARTIFACTS
public static final java.lang.String INCLUDE_PACKED_ARTIFACTS
- See Also:
- Constant Field Values
-
DEPENDENCY_RESOLUTION
public static final java.lang.String DEPENDENCY_RESOLUTION
- See Also:
- Constant Field Values
-
FILTERS
public static final java.lang.String FILTERS
- See Also:
- Constant Field Values
-
RESOLVE_WITH_EXECUTION_ENVIRONMENT_CONSTRAINTS
public static final java.lang.String RESOLVE_WITH_EXECUTION_ENVIRONMENT_CONSTRAINTS
- See Also:
- Constant Field Values
-
BREE_HEADER_SELECTION_POLICY
public static final java.lang.String BREE_HEADER_SELECTION_POLICY
- See Also:
- Constant Field Values
-
EXECUTION_ENVIRONMENT_DEFAULT
public static final java.lang.String EXECUTION_ENVIRONMENT_DEFAULT
- See Also:
- Constant Field Values
-
EXECUTION_ENVIRONMENT
public static final java.lang.String EXECUTION_ENVIRONMENT
- See Also:
- Constant Field Values
-
ALLOW_CONFLICTING_DEPENDENCIES
public static final java.lang.String ALLOW_CONFLICTING_DEPENDENCIES
- See Also:
- Constant Field Values
-
POM_DEPENDENCIES
public static final java.lang.String POM_DEPENDENCIES
- See Also:
- Constant Field Values
-
TARGET
public static final java.lang.String TARGET
- See Also:
- Constant Field Values
-
RESOLVER
public static final java.lang.String RESOLVER
- See Also:
- Constant Field Values
-
ENVIRONMENTS
public static final java.lang.String ENVIRONMENTS
- See Also:
- Constant Field Values
-
OPTIONAL_RESOLUTION_REQUIRE
private static final java.lang.String OPTIONAL_RESOLUTION_REQUIRE
- See Also:
- Constant Field Values
-
OPTIONAL_RESOLUTION_IGNORE
private static final java.lang.String OPTIONAL_RESOLUTION_IGNORE
- See Also:
- Constant Field Values
-
FILE_EXTENSION
private static final java.lang.String FILE_EXTENSION
- See Also:
- Constant Field Values
-
logger
@Requirement private org.codehaus.plexus.logging.Logger logger
-
repositorySystem
@Requirement private org.apache.maven.repository.RepositorySystem repositorySystem
-
projectTypes
@Requirement private java.util.Map<java.lang.String,TychoProject> projectTypes
-
filterReader
@Requirement private TargetPlatformFilterConfigurationReader filterReader
-
-
Method Detail
-
getTargetPlatformConfiguration
public TargetPlatformConfiguration getTargetPlatformConfiguration(org.apache.maven.execution.MavenSession session, org.apache.maven.project.MavenProject project) throws BuildFailureException
- Throws:
BuildFailureException
-
setIncludePackedArtifacts
private void setIncludePackedArtifacts(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
-
setTargetDefinitionIncludeSources
private void setTargetDefinitionIncludeSources(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration) throws BuildFailureException
- Throws:
BuildFailureException
-
readDependencyResolutionConfiguration
private void readDependencyResolutionConfiguration(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
-
setOptionalDependencies
private void setOptionalDependencies(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom resolverDom)
-
readExtraRequirements
protected void readExtraRequirements(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom resolverDom) throws BuildFailureException
- Throws:
BuildFailureException
-
readProfileProperties
private void readProfileProperties(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom resolverDom)
-
setExecutionEnvironment
private void setExecutionEnvironment(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
-
setExecutionEnvironmentDefault
private void setExecutionEnvironmentDefault(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
-
setBREEHeaderSelectionPolicy
private void setBREEHeaderSelectionPolicy(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
-
setResolveWithEEContraints
private void setResolveWithEEContraints(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom resolverDom)
Take the constraints of the configured execution environment into account when resolving dependencies or target definitions. These constraints include the list of system packages and the Bundle-RequiredExecutionEnvironment header. When set totrue
, the dependency resolution verifies that the bundle and all required bundles can be used in an OSGi container with the configured execution environment.
-
setDisableP2Mirrors
private void setDisableP2Mirrors(org.codehaus.plexus.util.xml.Xpp3Dom configuration)
-
setAllowConflictingDependencies
private void setAllowConflictingDependencies(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
-
addTargetEnvironments
private void addTargetEnvironments(TargetPlatformConfiguration result, org.apache.maven.project.MavenProject project, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
-
getDeprecatedTargetEnvironment
protected TargetEnvironment getDeprecatedTargetEnvironment(org.codehaus.plexus.util.xml.Xpp3Dom configuration) throws TargetPlatformConfigurationException
-
setPomDependencies
private void setPomDependencies(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
-
setTarget
private void setTarget(TargetPlatformConfiguration result, org.apache.maven.execution.MavenSession session, org.apache.maven.project.MavenProject project, org.codehaus.plexus.util.xml.Xpp3Dom configuration) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
addTargetArtifact
protected void addTargetArtifact(TargetPlatformConfiguration result, org.apache.maven.execution.MavenSession session, org.apache.maven.project.MavenProject project, org.codehaus.plexus.util.xml.Xpp3Dom artifactDom) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
setTargetPlatformResolver
private void setTargetPlatformResolver(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
-
readFilters
private void readFilters(TargetPlatformConfiguration result, org.codehaus.plexus.util.xml.Xpp3Dom configuration)
-
newTargetEnvironment
private static TargetEnvironment newTargetEnvironment(org.codehaus.plexus.util.xml.Xpp3Dom environmentDom) throws TargetPlatformConfigurationException
-
getStringValue
private static java.lang.String getStringValue(org.codehaus.plexus.util.xml.Xpp3Dom element)
Returns the string value of the given node, with all "value not set" cases normalized tonull
.
-
listTargetFiles
public static java.io.File[] listTargetFiles(java.io.File folder)
List all target files in the given folder- Parameters:
folder
-- Returns:
- the found target files or empty array if nothing was found, folder is not a directory or the directory could not be read
-
isTargetFile
public static boolean isTargetFile(java.io.File file)
- Parameters:
file
-- Returns:
true
if the given files likely denotes are targetfile based on file naming,false
otherwise
-
isPrimaryTarget
public static boolean isPrimaryTarget(org.apache.maven.project.MavenProject project, java.io.File targetFile, java.io.File[] otherTargetFiles)
Checks if the given target file is the "primary" target artifact file among others- Parameters:
project
-targetFile
- the target file to checkotherTargetFiles
- other target files to take into account- Returns:
true
if the target file is the primary artifact,false
otherwise
-
throwNoPrimaryTargetFound
public static void throwNoPrimaryTargetFound(org.apache.maven.project.MavenProject project, java.io.File[] targetFiles) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-