Skip to content

Commit 73a4d62

Browse files
committed
log test classpath instead of compile classpath for test GroovyDoc
1 parent e82fb1f commit 73a4d62

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/main/java/org/codehaus/gmavenplus/mojo/AbstractGroovyDocMojo.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,7 @@ protected synchronized void doGroovyDocGeneration(final FileSet[] sourceDirector
200200
classWrangler.logGroovyVersion(mojoExecution.getMojoDescriptor().getGoal());
201201
logPluginClasspath();
202202

203-
if (groovyVersionSupportsAction()) {
204-
try {
205-
getLog().debug("Project compile classpath:\n" + project.getCompileClasspathElements());
206-
} catch (DependencyResolutionRequiredException e) {
207-
getLog().warn("Unable to log project compile classpath", e);
208-
}
209-
} else {
203+
if (!groovyVersionSupportsAction()) {
210204
getLog().error("Your Groovy version (" + classWrangler.getGroovyVersionString() + ") doesn't support GroovyDoc. The minimum version of Groovy required is " + minGroovyVersion + ". Skipping GroovyDoc generation.");
211205
return;
212206
}

src/main/java/org/codehaus/gmavenplus/mojo/GroovyDocMojo.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ public class GroovyDocMojo extends AbstractGroovyDocMojo {
4444
@Override
4545
public void execute() throws MojoExecutionException, MojoFailureException {
4646
try {
47+
try {
48+
getLog().debug("Project compile classpath:\n" + project.getCompileClasspathElements());
49+
} catch (DependencyResolutionRequiredException e) {
50+
getLog().warn("Unable to log project compile classpath", e);
51+
}
4752
doGroovyDocGeneration(getSourceRoots(groovyDocJavaSources), project.getCompileClasspathElements(), groovyDocOutputDirectory);
4853
} catch (ClassNotFoundException e) {
4954
throw new MojoExecutionException("Unable to get a Groovy class from classpath. Do you have Groovy as a compile dependency in your project?", e);

src/main/java/org/codehaus/gmavenplus/mojo/GroovyDocTestsMojo.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ public class GroovyDocTestsMojo extends AbstractGroovyDocMojo {
5050
@Override
5151
public void execute() throws MojoExecutionException, MojoFailureException {
5252
try {
53+
try {
54+
getLog().debug("Project test classpath:\n" + project.getCompileClasspathElements());
55+
} catch (DependencyResolutionRequiredException e) {
56+
getLog().warn("Unable to log project tset classpath", e);
57+
}
5358
doGroovyDocGeneration(getTestSourceRoots(groovyDocJavaSources), project.getTestClasspathElements(), testGroovyDocOutputDirectory);
5459
} catch (ClassNotFoundException e) {
5560
throw new MojoExecutionException("Unable to get a Groovy class from classpath. Do you have Groovy as a compile dependency in your project?", e);

0 commit comments

Comments
 (0)