api / org.gradle.api / GradleException

GradleException

open class GradleException : RuntimeException

GradleException is the base class of all exceptions thrown by Gradle.

Constructors

<init>

GradleException()
GradleException(message: String)
GradleException(message: String, cause: Throwable)

Inheritors

ArtifactTransformException

open class ArtifactTransformException : GradleException

An exception to report a problem during transformation execution.

BuildCacheException

open class BuildCacheException : GradleException

BuildCacheException is the base class of all exceptions thrown by a BuildCacheService.

BuildCancelledException

open class BuildCancelledException : GradleException

A BuildCancelledException is thrown when a build is interrupted due to cancellation request.

CircularReferenceException

open class CircularReferenceException : GradleException

A CircularReferenceException is thrown if circular references exists between tasks, the project evaluation order or the project dependsOn order.

ConfigurationCycleException

open class ConfigurationCycleException : GradleException

Thrown when a cycle is encountered while configuring a model element.

DuplicateFileCopyingException

open class DuplicateFileCopyingException : GradleException

Thrown when more than one file with the same relative path name is to be copied and the DuplicatesStrategy is set to DuplicatesStrategy.FAIL

GradleScriptException

open class GradleScriptException : GradleException

A GradleScriptException is thrown when an exception occurs in the compilation or execution of a script.

IllegalDependencyNotation

open class IllegalDependencyNotation : GradleException

This exceptions is thrown, if a dependency is declared with a illegal notation.

ImmutableViolationException

open class ImmutableViolationException : GradleException

The exception thrown when any of this container's mutation methods are called.

This applies to the standard java.util.Collection methods such as add(), remove() and clear().

InvalidActionClosureException

open class InvalidActionClosureException : GradleException

Thrown when a Closure is given as an Action implementation, but has the wrong signature.

InvalidModelException

open class InvalidModelException : GradleException

Thrown when a component model is declared in an invalid way.

InvalidModelRuleDeclarationException

open class InvalidModelRuleDeclarationException : GradleException

Thrown when a model rule, or source of model rules, is declared in an invalid way.

InvalidModelRuleException

open class InvalidModelRuleException : GradleException

Thrown when there is a problem with the usage of a model rule.

This exception is different to InvalidModelRuleDeclarationException in that it signifies a problem with using a model rule in a particular context, whereas InvalidModelRuleDeclarationException signifies a problem with the declaration of the model rule itself (which therefore means that the rule could not be used in any context).

This exception should always have cause, that provides information about the actual problem.

InvalidPluginException

open class InvalidPluginException : GradleException

Thrown when a plugin is found to be invalid when it is loaded.

InvalidUserCodeException

open class InvalidUserCodeException : GradleException

A InvalidUserCodeException is thrown when user-provided code cannot be executed.

InvalidUserDataException

open class InvalidUserDataException : GradleException

A InvalidUserDataException is thrown, if a user is providing illegal data for the build.

ManifestException

open class ManifestException : GradleException

Is thrown in the case an operation is applied against a org.gradle.api.java.archives.Manifest that violates the Manifest specification.

ModelInstantiationException

open class ModelInstantiationException : GradleException

Thrown when a model element cannot be instantiated for some reason.

ModelRuleBindingException

open class ModelRuleBindingException : GradleException

Thrown when there is a problem binding the model element references of a model rule.

Should always be thrown as the cause of a org.gradle.model.InvalidModelRuleException.

PluginInstantiationException

open class PluginInstantiationException : GradleException

A PluginInstantiationException is thrown when a plugin cannot be instantiated.

ProjectConfigurationException

open class ProjectConfigurationException : GradleException

Indicates a problem that occurs during project configuration (evaluation) phase.

PublishException

open class PublishException : GradleException

A PublishException is thrown when a dependency configuration cannot be published for some reason.

ReadOnlyModelViewException

open class ReadOnlyModelViewException : GradleException

Thrown when an attempt is made to change the value of a model element that is not writable at the time.

ResourceException

open class ResourceException : GradleException

Generic resource exception that all other resource-related exceptions inherit from.

SourceTransformationException

open class SourceTransformationException : GradleException

Thrown when a source code transformation fails.

StopActionException

open class StopActionException : GradleException

A StopActionException is be thrown by a task org.gradle.api.Action or task action closure to stop its own execution and to start execution of the task's next action. An action can usually be stopped by just calling return inside the action closure. But if the action works with helper methods that can lead to redundant code. For example:

 List existentSourceDirs = HelperUtil.getExistentSourceDirs() if (!existentSourceDirs) {return} 

If the getExistentSourceDirs() throws a StopActionException instead, the tasks does not need the if statement.

Note that throwing this exception does not fail the execution of the task or the build.

TaskExecutionException

open class TaskExecutionException : GradleException

A TaskExecutionException is thrown when a task fails to execute successfully.

TaskInstantiationException

open class TaskInstantiationException : GradleException

A TaskInstantiationException is thrown when a task cannot be instantiated for some reason.

TestExecutionException

open class TestExecutionException : GradleException

A TestExecutionException is thrown when no tests can be found that match the specified test filters.

UnknownDomainObjectException

open class UnknownDomainObjectException : GradleException

A UnknownDomainObjectException is the super class of all exceptions thrown when a given domain object cannot be located.

UnknownModelException

open class UnknownModelException : GradleException

Thrown when an unknown tooling model is requested.

VariantTransformConfigurationException

open class VariantTransformConfigurationException : GradleException

An exception to report a problem during transformation execution.

WriteOnlyModelViewException

open class WriteOnlyModelViewException : GradleException

Thrown when an attempt is made to read the value of a model element that is not readable at the time.