Class InvocationRequestBuilder

java.lang.Object
org.wildfly.qa.tooling.maven.InvocationRequestBuilder

public class InvocationRequestBuilder extends Object
Builder for InvocationRequest, reducing code redundancy
  • Constructor Details

    • InvocationRequestBuilder

      public InvocationRequestBuilder()
  • Method Details

    • setMavenDebug

      public InvocationRequestBuilder setMavenDebug(Boolean mavenDebug)
    • setGoals

      public InvocationRequestBuilder setGoals(String... mavenGoals)
      Set maven goals
      Parameters:
      mavenGoals - set of Maven goals to invoke (e.g. "clean", "test")
      Returns:
      instance of this builder
    • setPomFilePath

      public InvocationRequestBuilder setPomFilePath(String pomFilePath)
      Set path to invoked pom.xml relative to test resources folder
      Parameters:
      pomFilePath - path to pom.xml (e.g. "pom-configs/pom-feature-pack-missing.xml")
      Returns:
      instance of this builder
    • setWildflyJarMavenPluginVersion

      public InvocationRequestBuilder setWildflyJarMavenPluginVersion(String wildflyJarMavenPluginVersion)
      Set WildFly Maven JAR plugin version
      Parameters:
      wildflyJarMavenPluginVersion - WildFly JAR Maven plugin
      Returns:
      instance of this builder
    • setMavenPluginGav

      public InvocationRequestBuilder setMavenPluginGav(MavenCoordinates mavenPluginGav)
      Set WildFly Maven plugin GAV
      Parameters:
      mavenPluginGav - Maven plugin GAV
      Returns:
      instance of this builder
    • setWildflyJarMavenPluginDevMode

      public InvocationRequestBuilder setWildflyJarMavenPluginDevMode()
      Set WildFly Maven JAR plugin to run in the dev mode, i.e. dev property is added: -Ddev
      Returns:
      instance of this builder
    • setEeGalleonPackGav

      public InvocationRequestBuilder setEeGalleonPackGav(MavenCoordinates eeGalleonPackGav)
      Set ee-galleon-pack GAV coordinates
      Parameters:
      eeGalleonPackGav - Galleon pack GAV coordinates
      Returns:
      instance of this builder
    • setGalleonPackGav

      public InvocationRequestBuilder setGalleonPackGav(MavenCoordinates galleonPackGav)
      Set galleon-pack GAV coordinates
      Parameters:
      galleonPackGav - Galleon pack GAV coordinates
      Returns:
      instance of this builder
    • setCloudGalleonPackGav

      public InvocationRequestBuilder setCloudGalleonPackGav(MavenCoordinates cloudGalleonPackGav)
      Set cloud-galleon-pack GAV coordinates
      Parameters:
      cloudGalleonPackGav - Galleon pack GAV coordinates
      Returns:
      instance of this builder
    • addChannelManifestGav

      public InvocationRequestBuilder addChannelManifestGav(MavenCoordinates channelManifestGav)
      Add channel manifest GAV coordinates to list of GAVs. First manifest will replace placeholders. This method is also used in setDefaultProperties() method, so that default manifest could be first manifest. testsuite.channel.manifest.* in pom.xml , every following i one will replace testsuite.channel.manifest[i].*
      Parameters:
      channelManifestGav - Channel manifest GAV coordinates
      Returns:
      instance of this builder
    • setChannelManifestGavs

      public InvocationRequestBuilder setChannelManifestGavs(List<MavenCoordinates> channelManifestGavs)
      Set list of channel manifest GAV coordinates. First manifest will replace placeholders testsuite.channel.manifest.* in pom.xml , every following i one will replace testsuite.channel.manifest[i].*
      Parameters:
      channelManifestGavs - List of channel manifest GAV coordinates
      Returns:
      instance of this builder
    • setChannelManifestGav

      public InvocationRequestBuilder setChannelManifestGav(MavenCoordinates channelManifestGav)
      Clean list of channel manifest gavs. Create new list wtih manifest GAV coordinates from method parameter to list of GAVs. testsuite.channel.manifest.* in pom.xml , every following i one will replace testsuite.channel.manifest[i].*
      Parameters:
      channelManifestGav - Channel manifest GAV coordinates
      Returns:
      instance of this builder
    • setDumpOriginalArtifacts

      public InvocationRequestBuilder setDumpOriginalArtifacts()
      Enable dump of upgradable artifacts to a file
      Returns:
      instance of this builder
    • setProperty

      public InvocationRequestBuilder setProperty(String key, String value)
      Use for properties like artifact versions which are not controlling the invocation and are used one-time mostly.
      Parameters:
      key - property key
      value - property value
      Returns:
      instance of this builder
    • setMavenRepoLocalPath

      public InvocationRequestBuilder setMavenRepoLocalPath(String mavenRepoLocalPath)
      Set path to local Maven repository. This path will be used by invoked Maven instance.
      Parameters:
      mavenRepoLocalPath - absolute path to local maven repository
      Returns:
      instance of this builder
      See Also:
    • setUseBrewRepo

      @Deprecated public InvocationRequestBuilder setUseBrewRepo(boolean useBrewRepo)
      Deprecated.
      Use setUserSettingsFile(String) with proper settings instead to configure repository
      Set whether the Maven profile that declares the internal Brew repo should be activated. This flag will be used by invoked Maven instance.
      Parameters:
      useBrewRepo - sets the property that activates the use-brew-repo profile.
      Returns:
      instance of this builder
    • setUserSettingsFile

      public InvocationRequestBuilder setUserSettingsFile(String userSettingsFile)
      Set path to user settings.xml relative to resources directory.
      Parameters:
      userSettingsFile - path to settings.xml
      Returns:
      instance of this builder
    • setUserSettingsFileWithReplacements

      public InvocationRequestBuilder setUserSettingsFileWithReplacements(String userSettingsFile, org.wildfly.qa.tooling.strings.ReplacementPairs pairs)
      Set path to user settings.xml relative to resources directory and edit provided file.
      Parameters:
      userSettingsFile - path to settings.xml
      pairs - pairs of pattern-replacement to be used in editing provided settings xml. Each found pattern in file will be replaced by corresponding replacement
      Returns:
      instance of this builder
    • build

      public org.apache.maven.shared.invoker.InvocationRequest build()