Class ModelUtils
- java.lang.Object
-
- io.quarkus.bootstrap.resolver.maven.workspace.ModelUtils
-
public class ModelUtils extends Object
- Author:
- Alexey Loubyansky
-
-
Constructor Summary
Constructors Constructor Description ModelUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.maven.model.ModelapplySystemProperties(org.apache.maven.model.Model model)If the model contains properties, this method overrides those that appear to be defined as system properties.static StringgetGroupId(org.apache.maven.model.Model model)static StringgetRawVersion(org.apache.maven.model.Model model)Returns the raw version of the model.static ArtifactCoordsgetStateArtifact(ArtifactCoords appArtifact)Returns the provisioning state artifact for the given application artifactstatic List<AppDependency>getUpdateCandidates(List<org.apache.maven.model.Dependency> deps, List<AppDependency> appDeps, Set<String> groupIds)Filters out non-platform from application POM dependencies.static StringgetVersion(org.apache.maven.model.Model model)static booleanisUnresolvedVersion(String version)static voidpersistModel(Path pomFile, org.apache.maven.model.Model model)static org.apache.maven.model.ModelreadAppModel(Path appJar, AppArtifact appArtifact)static org.apache.maven.model.ModelreadModel(InputStream stream)static org.apache.maven.model.ModelreadModel(Path pomXml)static AppArtifactresolveAppArtifact(Path appJar)static StringresolveVersion(String rawVersion, org.apache.maven.model.Model rawModel)
-
-
-
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 dependenciesappDeps- resolved application dependencies- Returns:
- dependencies that can be checked for updates
-
resolveAppArtifact
public static AppArtifact resolveAppArtifact(Path appJar) throws IOException
- Throws:
IOException
-
readAppModel
public static org.apache.maven.model.Model readAppModel(Path appJar, AppArtifact appArtifact) throws IOException
- Throws:
IOException
-
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.
-
readModel
public static org.apache.maven.model.Model readModel(Path pomXml) throws IOException
- Throws:
IOException
-
readModel
public static org.apache.maven.model.Model readModel(InputStream stream) throws IOException
- Throws:
IOException
-
persistModel
public static void persistModel(Path pomFile, org.apache.maven.model.Model model) throws IOException
- Throws:
IOException
-
-