Class ModelUtils


  • public class ModelUtils
    extends Object
    Author:
    Alexey Loubyansky
    • Constructor Detail

      • ModelUtils

        public ModelUtils()
    • Method Detail

      • getStateArtifact

        public static ArtifactCoords getStateArtifact​(ArtifactCoords appArtifact)
        Returns the provisioning state artifact for the given application artifact
        Parameters:
        appArtifact - application artifact
        Returns:
        provisioning state artifact
      • getUpdateCandidates

        public static List<AppDependency> getUpdateCandidates​(List<org.apache.maven.model.Dependency> deps,
                                                              List<AppDependency> appDeps,
                                                              Set<String> groupIds)
        Filters out non-platform from application POM dependencies.
        Parameters:
        deps - POM model application dependencies
        appDeps - resolved application dependencies
        Returns:
        dependencies that can be checked for updates
      • getGroupId

        public static String getGroupId​(org.apache.maven.model.Model model)
      • getRawVersion

        public static String getRawVersion​(org.apache.maven.model.Model model)
        Returns the raw version of the model. If the model does not include the version directly, it will return the version of the parent. The version is raw in a sense if it's a property expression, the expression will not be resolved.
        Parameters:
        model - POM
        Returns:
        raw model
      • getVersion

        public static String getVersion​(org.apache.maven.model.Model model)
      • isUnresolvedVersion

        public static boolean isUnresolvedVersion​(String version)
      • resolveVersion

        public static String resolveVersion​(String rawVersion,
                                            org.apache.maven.model.Model rawModel)
      • applySystemProperties

        public static org.apache.maven.model.Model applySystemProperties​(org.apache.maven.model.Model model)
        If the model contains properties, this method overrides those that appear to be defined as system properties.
      • persistModel

        public static void persistModel​(Path pomFile,
                                        org.apache.maven.model.Model model)
                                 throws IOException
        Throws:
        IOException