Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Gradle with verbose class loading?

My build script is encountering an error (below). Is there a way to run Gradle with the same type of output as invoking Java with -verbose:class?

The error in question, should anyone have some input:

Caused by: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':Project:compile'.
    at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.wrapException(ErrorHandlingArtifactDependencyResolver.java:49)
    ... more
Caused by: java.lang.LinkageError: loader constraints violated when linking org/apache/ivy/core/module/descriptor/DependencyDescriptor class
like image 875
tnunamak Avatar asked Mar 22 '13 19:03

tnunamak


2 Answers

You can set the following environment variable, I believe...

GRADLE_OPTS="$GRADLE_OPTS -verbose:class"

and then invoke gradle. Read this link.

Once Gradle is downloaded and unzipped, the environment variable GRADLE_HOME can be set to the directory of the unzipped Gradle installation and the PATH should be set to $GRADLE_HOME/bin or %GRADLE_HOME%\bin. The Gradle installation page tells us that JVM options used by Gradle can be set via either GRADLE_OPTS or JAVA_OPTS. The Grade installation and configuration in the path can be confirmed by running gradle -v at the command line once the environment variable settings are sourced.

like image 53
Amir Afghani Avatar answered Sep 22 '22 23:09

Amir Afghani


Please add to your build.gradle task: jvmArgs '-verbose:class'. For example to run gradle test, I use:

test{
    jvmArgs '-verbose:class'
}
like image 26
aborskiy Avatar answered Sep 19 '22 23:09

aborskiy