Interface GradleEnterpriseApi
-
public interface GradleEnterpriseApi
Allows to interact with the Gradle Enterprise Maven extension.- Since:
- 1.10.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.String
getAccessKey()
Returns the access key for authenticating with the Gradle Enterprise server.boolean
getAllowUntrustedServer()
Whether it is acceptable to communicate with a Gradle Enterprise server with an untrusted SSL certificate.BuildCacheApi
getBuildCache()
The build cache API.BuildScanApi
getBuildScan()
The build scan API.java.lang.String
getServer()
Returns the URL of the Gradle Enterprise server.java.nio.file.Path
getStorageDirectory()
Returns the Gradle Enterprise Maven extension storage directory.boolean
isEnabled()
Whether the Gradle Enterprise Maven extension is enabled.void
setAccessKey(java.lang.String accessKey)
Sets the access key for authenticating with the Gradle Enterprise server.void
setAllowUntrustedServer(boolean allow)
Specifies whether it is acceptable to communicate with a Gradle Enterprise server using an untrusted SSL certificate.void
setEnabled(boolean enabled)
Sets whether to enable the Gradle Enterprise Maven extension.default void
setServer(java.lang.String url)
Sets the URL of the Gradle Enterprise server.void
setServer(java.net.URI url)
Sets the URL of the Gradle Enterprise server.void
setStorageDirectory(java.nio.file.Path path)
Sets the Gradle Enterprise Maven extension storage directory to the specified path.
-
-
-
Method Detail
-
isEnabled
boolean isEnabled()
Whether the Gradle Enterprise Maven extension is enabled.- Returns:
true
if the Gradle Enterprise Maven extension is enabled,false
otherwise- Since:
- 1.10.3
-
setEnabled
void setEnabled(boolean enabled)
Sets whether to enable the Gradle Enterprise Maven extension.Configuration via the
gradle.enterprise.enabled
system property will always take precedence.- Parameters:
enabled
- whether to enable the Gradle Enterprise Maven extension- Since:
- 1.10.3
-
getStorageDirectory
java.nio.file.Path getStorageDirectory()
Returns the Gradle Enterprise Maven extension storage directory.- Returns:
- the Gradle Enterprise Maven extension storage directory.
- Since:
- 1.10.1
- See Also:
- Gradle Enterprise Maven extension documentation.
-
setStorageDirectory
void setStorageDirectory(java.nio.file.Path path)
Sets the Gradle Enterprise Maven extension storage directory to the specified path.Configuration via the
gradle.enterprise.storage.directory
system property will always take precedence.- Parameters:
path
- The new storage directory- Since:
- 1.10.1
- See Also:
- Gradle Enterprise Maven extension documentation.
-
setServer
default void setServer(java.lang.String url)
Sets the URL of the Gradle Enterprise server.Configuration via the
gradle.enterprise.url
system property will always take precedence.- Parameters:
url
- the server URL- Since:
- 1.10.1
-
setServer
void setServer(java.net.URI url)
Sets the URL of the Gradle Enterprise server.Configuration via the
gradle.enterprise.url
system property will always take precedence.- Parameters:
url
- the server URL- Since:
- 1.10.3
-
getServer
java.lang.String getServer()
Returns the URL of the Gradle Enterprise server.- Returns:
- null when no Gradle Enterprise server is configured
- Since:
- 1.10.1
-
setAllowUntrustedServer
void setAllowUntrustedServer(boolean allow)
Specifies whether it is acceptable to communicate with a Gradle Enterprise server using an untrusted SSL certificate.The default (public) Gradle Enterprise server uses SSL certificates that are trusted by default by standard modern Java environments. If you are using a different Gradle Enterprise server, it may use an untrusted certificate. This may be due to the use of an internally provisioned or self-signed certificate.
In such a scenario, you can either configure the build JVM environment to trust the certificate, or call this method with
true
to disable verification of the server's identity. Alternatively, you may disable SSL completely for Gradle Enterprise installation but this is not recommended.Allowing communication with untrusted servers keeps data encrypted during transmission, but makes it easy for a man-in-the-middle to impersonate the intended server and capture data.
This value has no effect if a server is specified using the HTTP protocol (i.e. has SSL disabled).
Configuration via the
gradle.enterprise.allowUntrustedServer
system property will always take precedence.- Parameters:
allow
- whether to allow communication with a HTTPS server with an untrusted certificate- Since:
- 1.10.1
-
getAllowUntrustedServer
boolean getAllowUntrustedServer()
Whether it is acceptable to communicate with a Gradle Enterprise server with an untrusted SSL certificate.- Returns:
true
it is acceptable to communicate with a build scan server with an untrusted SSL certificate- Since:
- 1.10.1
-
setAccessKey
void setAccessKey(java.lang.String accessKey)
Sets the access key for authenticating with the Gradle Enterprise server.An access key configured this way will take precedence over the
GRADLE_ENTERPRISE_ACCESS_KEY
environment variable or access key file entry associated with the server.- Parameters:
accessKey
- a Gradle Enterprise server access key without any hostname prefix- Since:
- 1.11
-
getAccessKey
java.lang.String getAccessKey()
Returns the access key for authenticating with the Gradle Enterprise server.Only the value of the explicitly configured access key (via
setAccessKey(String)
orgradle-enterprise.xml
) is returned but not the value of an access key configured via theGRADLE_ENTERPRISE_ACCESS_KEY
environment variable or access key file entry.- Returns:
- the configured Gradle Enterprise server access key, if available; otherwise,
null
- Since:
- 1.11
-
getBuildScan
BuildScanApi getBuildScan()
The build scan API.- Returns:
- the build scan API
- Since:
- 1.10.1
-
getBuildCache
BuildCacheApi getBuildCache()
The build cache API.- Returns:
- the build cache API
- Since:
- 1.10.1
-
-