Class MvnUtils
java.lang.Object
com.vaadin.uitest.generator.utils.MvnUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaddMavenDependency(String pomFilePath, String groupId, String artifactId, String version, String scope) Adds a Maven dependency to the specified pom.xml file.static booleanaddMavenExecPlugin(String pomFilePath) Adds the exec-maven-plugin to the specified pom.xml file for executing Hilla tests.static booleanaddMavenFailsafePlugin(String pomFilePath) Adds the maven-failsafe-plugin to the specified pom.xml file.static booleanaddSpringBootPluginToItProfile(String pomFilePath) static booleanisDependencyManagementPresent(String pathToPom) Checks if the given pom.xml file contains a non-empty list of dependency nodes inside the <dependencyManagement> section.static booleanisSpringBootProject(String path)
-
Constructor Details
-
MvnUtils
public MvnUtils()
-
-
Method Details
-
addMavenDependency
public static boolean addMavenDependency(String pomFilePath, String groupId, String artifactId, String version, String scope) throws Exception Adds a Maven dependency to the specified pom.xml file.- Parameters:
pomFilePath- The path to the pom.xml file.groupId- The group ID of the dependency to add.artifactId- The artifact ID of the dependency to add.version- The version of the dependency to add, or null if not specified.scope- The scope of the dependency to add, or null if not specified.- Returns:
trueif the pom.xml was modified,falseotherwise.- Throws:
Exception- If an error occurs while reading or writing the file.
-
addMavenExecPlugin
Adds the exec-maven-plugin to the specified pom.xml file for executing Hilla tests. The plugin is added to the 'it' profile.- Parameters:
pomFilePath- The path to the pom.xml file.- Returns:
trueif the pom.xml was modified,falseif the plugin was already present.- Throws:
Exception- If an error occurs while reading or writing the file.
-
addMavenFailsafePlugin
Adds the maven-failsafe-plugin to the specified pom.xml file. The plugin is added to the 'it' profile.- Parameters:
pomFilePath- The path to the pom.xml file.- Returns:
trueif the pom.xml was modified,falseif the plugin was already present.- Throws:
Exception- If an error occurs while reading or writing the file.
-
isDependencyManagementPresent
Checks if the given pom.xml file contains a non-empty list of dependency nodes inside the <dependencyManagement> section.- Parameters:
pathToPom- The file path to thepom.xml.- Returns:
trueif the <dependencyManagement> section exists and contains at least one dependency;falseotherwise.
-
isSpringBootProject
- Throws:
Exception
-
addSpringBootPluginToItProfile
- Throws:
Exception
-