Class DefaultTargetPlatformConfigurationReader

    • 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
      • 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
      • 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
      • 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
    • Constructor Detail

      • DefaultTargetPlatformConfigurationReader

        public DefaultTargetPlatformConfigurationReader()
    • Method Detail

      • setIncludePackedArtifacts

        private void setIncludePackedArtifacts​(TargetPlatformConfiguration result,
                                               org.codehaus.plexus.util.xml.Xpp3Dom configuration)
      • 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)
      • 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 to true, 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)
      • 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)
      • 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 to null.
      • 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 check
        otherTargetFiles - 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