Interface DevelocityApi
- Since:
- 1.21
-
Method Summary
Modifier and TypeMethodDescriptionReturns the access key for authenticating with the Develocity server.boolean
Whether it is acceptable to communicate with a Develocity server with an untrusted SSL certificate.The build cache API.The build scan API.boolean
Returns whether to enable communication with Develocity server to automatically discover and select a Develocity Edge.Returns the project identifier.Returns the URL of the Develocity server.Returns the Develocity Maven extension storage directory.boolean
Whether the Develocity Maven extension is enabled.void
setAccessKey
(String accessKey) Sets the access key for authenticating with the Develocity server.void
setAllowUntrustedServer
(boolean allow) Specifies whether it is acceptable to communicate with a Develocity server using an untrusted SSL certificate.void
setEdgeDiscovery
(boolean enabled) Specifies whether to enable discovery and automatic selection of a Develocity Edge.void
setEnabled
(boolean enabled) Sets whether to enable the Develocity Maven extension.void
setProjectId
(String projectId) Sets the project identifier.default void
Sets the URL of the Develocity server.void
Sets the URL of the Develocity server.void
setStorageDirectory
(Path path) Sets the Develocity Maven extension storage directory to the specified path.
-
Method Details
-
isEnabled
boolean isEnabled()Whether the Develocity Maven extension is enabled.- Returns:
true
if the Develocity Maven extension is enabled,false
otherwise
-
setEnabled
void setEnabled(boolean enabled) Sets whether to enable the Develocity Maven extension.Configuration via the
develocity.enabled
system property will always take precedence.- Parameters:
enabled
- whether to enable the Develocity Maven extension
-
getProjectId
Returns the project identifier.- Returns:
- the project identifier or
null
-
setProjectId
Sets the project identifier. The value must not be empty or exceed 256 characters.- Parameters:
projectId
- the project identifier ornull
-
getStorageDirectory
Path getStorageDirectory()Returns the Develocity Maven extension storage directory.- Returns:
- the Develocity Maven extension storage directory.
- See Also:
-
setStorageDirectory
Sets the Develocity Maven extension storage directory to the specified path.Configuration via the
develocity.storage.directory
system property will always take precedence.- Parameters:
path
- The new storage directory- See Also:
-
getServer
Returns the URL of the Develocity server.- Returns:
- the Develocity server or
null
-
setServer
Sets the URL of the Develocity server.Configuration via the
develocity.url
system property will always take precedence.- Parameters:
url
- the server URL ornull
-
setServer
Sets the URL of the Develocity server.Configuration via the
develocity.url
system property will always take precedence.- Parameters:
url
- the server URL ornull
-
getAllowUntrustedServer
boolean getAllowUntrustedServer()Whether it is acceptable to communicate with a Develocity server with an untrusted SSL certificate.- Returns:
true
if it is acceptable to communicate with a Develocity server with an untrusted SSL certificate
-
setAllowUntrustedServer
void setAllowUntrustedServer(boolean allow) Specifies whether it is acceptable to communicate with a Develocity server using an untrusted SSL certificate.The default (public) Develocity server uses SSL certificates that are trusted by default by standard modern Java environments. If you are using a different Develocity 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 Develocity 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
develocity.allowUntrustedServer
system property will always take precedence.- Parameters:
allow
- whether to allow communication with an HTTPS server with an untrusted certificate
-
getAccessKey
Returns the access key for authenticating with the Develocity server.Only the value of the explicitly configured access key (via
setAccessKey(String)
ordevelocity.xml
) is returned but not the value of an access key configured via theDEVELOCITY_ACCESS_KEY
environment variable or access key file entry.- Returns:
- the configured Develocity server access key, if available; otherwise,
null
-
setAccessKey
Sets the access key for authenticating with the Develocity server.An access key configured this way will take precedence over the
DEVELOCITY_ACCESS_KEY
environment variable or access key file entry associated with the server.- Parameters:
accessKey
- a Develocity server access key without any hostname prefix
-
getEdgeDiscovery
boolean getEdgeDiscovery()Returns whether to enable communication with Develocity server to automatically discover and select a Develocity Edge.- Returns:
true
if discovery and automatic selection of a Develocity Edge is enabled, orfalse
by default
-
setEdgeDiscovery
void setEdgeDiscovery(boolean enabled) Specifies whether to enable discovery and automatic selection of a Develocity Edge.The Develocity server (specified by
setServer(String)
) will be contacted to discover available Edges. An Edge is selected based on the user's Location settings in Develocity and is used by the Maven extension for remote build caching. In case the user has no Location preference set, the Develocity server will be used as the remote build cache target.- The specified Develocity server version supports Develocity Edge, which was introduced in Develocity 2024.3.
- Access key authentication to Develocity is configured for the build (
setAccessKey(java.lang.String)
).
RemoteBuildCache.getServer()
is always used, overriding the result of Edge discovery.This value defaults to
false
. -
getBuildScan
BuildScanApi getBuildScan()The build scan API.- Returns:
- the build scan API
-
getBuildCache
BuildCacheApi getBuildCache()The build cache API.- Returns:
- the build cache API
-