Class PluginUtils

java.lang.Object
org.jfrog.gradle.plugin.artifactory.utils.PluginUtils

public class PluginUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addArtifactoryResolutionRepositoryAction(org.gradle.api.artifacts.repositories.MavenArtifactRepository mavenArtifactRepository, String contextUrl, org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration.ResolverHandler resolver)
    Adds an Artifactory resolution repository to a given MavenArtifactRepository.
    static void
    assertGradleVersionSupported(org.gradle.api.invocation.Gradle gradle)
    Throws an exception if the Gradle version is below 6.8.1.
    static org.jfrog.build.api.builder.ModuleType
    getModuleType(String moduleType)
    Get the ModuleType object from the user input or GRADLE.
    static org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration.ResolverHandler
    getResolverHandler(org.jfrog.build.api.util.Log log)
    Extract the resolver information from the build-info.properties file generated by the JFrog CLI or by the Jenkins Artifactory plugin.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PluginUtils

      public PluginUtils()
  • Method Details

    • assertGradleVersionSupported

      public static void assertGradleVersionSupported(org.gradle.api.invocation.Gradle gradle) throws org.gradle.api.GradleException
      Throws an exception if the Gradle version is below 6.8.1.
      Parameters:
      gradle - - Represents an invocation of Gradle
      Throws:
      org.gradle.api.GradleException - if the Gradle version is below 6.8.1.
    • getModuleType

      public static org.jfrog.build.api.builder.ModuleType getModuleType(String moduleType)
      Get the ModuleType object from the user input or GRADLE.
      Parameters:
      moduleType - - Module type input from the user
      Returns:
      the ModuleType to set.
    • addArtifactoryResolutionRepositoryAction

      public static void addArtifactoryResolutionRepositoryAction(org.gradle.api.artifacts.repositories.MavenArtifactRepository mavenArtifactRepository, String contextUrl, org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration.ResolverHandler resolver)
      Adds an Artifactory resolution repository to a given MavenArtifactRepository. This method configures the repository's name and URL based on the provided context URL and resolver information. If credentials (username and password) are provided in the resolver, they are set for the repository.
      Parameters:
      mavenArtifactRepository - The MavenArtifactRepository to configure.
      contextUrl - The base URL for the Artifactory instance.
      resolver - The resolver handler containing the repository key and optional credentials.
    • getResolverHandler

      public static org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration.ResolverHandler getResolverHandler(org.jfrog.build.api.util.Log log)
      Extract the resolver information from the build-info.properties file generated by the JFrog CLI or by the Jenkins Artifactory plugin.
      Parameters:
      log - - The logger.
      Returns:
      resolver handler.