Class PluginUtils
java.lang.Object
org.jfrog.gradle.plugin.artifactory.utils.PluginUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddArtifactoryResolutionRepositoryAction(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 voidassertGradleVersionSupported(org.gradle.api.invocation.Gradle gradle) Throws an exception if the Gradle version is below 6.8.1.static org.jfrog.build.api.builder.ModuleTypegetModuleType(String moduleType) Get theModuleTypeobject from the user input or GRADLE.static org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration.ResolverHandlergetResolverHandler(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.
-
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
Get theModuleTypeobject 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.
-