diff --git a/pom.xml b/pom.xml index 6c02e0d00..414598b40 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.codehaus.gmavenplus gmavenplus-plugin maven-plugin - 1.9.2-SNAPSHOT + 1.10.0-SNAPSHOT UTF-8 diff --git a/src/main/java/org/codehaus/gmavenplus/mojo/GroovyDocJarMojo.java b/src/main/java/org/codehaus/gmavenplus/mojo/GroovyDocJarMojo.java index 4dc0db113..006c402a4 100644 --- a/src/main/java/org/codehaus/gmavenplus/mojo/GroovyDocJarMojo.java +++ b/src/main/java/org/codehaus/gmavenplus/mojo/GroovyDocJarMojo.java @@ -96,9 +96,17 @@ public class GroovyDocJarMojo extends GroovyDocMojo { /** * The classifier for the GroovyDoc jar. */ - @Parameter(defaultValue = "groovydoc", required = true) + @Parameter(defaultValue = "groovydoc") private String classifier; + /** + * The artifact type for the GroovyDoc jar. + * + * @since 1.10.0 + */ + @Parameter(defaultValue = "javadoc") + private String artifactType; + /** * Whether to invoke the groovydoc goal before creating jar. */ @@ -111,17 +119,17 @@ public class GroovyDocJarMojo extends GroovyDocMojo { @Override public void execute() throws MojoExecutionException { if (invokeGroovyDoc) { - // generate the GroovyDoc + // invoke the GroovyDoc mojo super.execute(); } try { File outputFile = generateArchive(groovyDocOutputDirectory, finalName + "-" + classifier + ".jar"); - if (!attach) { - getLog().info("NOT adding GroovyDoc to attached artifacts list."); + if (attach) { + projectHelper.attachArtifact(project, artifactType, classifier, outputFile); } else { - projectHelper.attachArtifact(project, "groovydoc", classifier, outputFile); + getLog().info("Not adding GroovyDoc jar to attached artifacts list."); } } catch (ArchiverException e) { throw new MojoExecutionException("ArchiverException: Error while creating archive", e); diff --git a/src/main/java/org/codehaus/gmavenplus/mojo/GroovyDocTestsJarMojo.java b/src/main/java/org/codehaus/gmavenplus/mojo/GroovyDocTestsJarMojo.java index ea4ddc829..d35d8eb62 100644 --- a/src/main/java/org/codehaus/gmavenplus/mojo/GroovyDocTestsJarMojo.java +++ b/src/main/java/org/codehaus/gmavenplus/mojo/GroovyDocTestsJarMojo.java @@ -96,9 +96,17 @@ public class GroovyDocTestsJarMojo extends GroovyDocTestsMojo { /** * The classifier for the test GroovyDoc jar. */ - @Parameter(defaultValue = "test-groovydoc", required = true) + @Parameter(defaultValue = "test-groovydoc") private String testClassifier; + /** + * The artifact type for the test GroovyDoc jar. + * + * @since 1.10.0 + */ + @Parameter(defaultValue = "javadoc") + private String testArtifactType; + /** * Whether to invoke the groovydocTests goal before creating jar. */ @@ -111,17 +119,17 @@ public class GroovyDocTestsJarMojo extends GroovyDocTestsMojo { @Override public void execute() throws MojoExecutionException { if (invokeGroovyDoc) { - // generate the test GroovyDoc + // invoke the test GroovyDoc mojo super.execute(); } try { File outputFile = generateArchive(testGroovyDocOutputDirectory, finalName + "-" + testClassifier + ".jar"); - if (!attach) { - getLog().info("NOT adding GroovyDoc to attached artifacts list."); + if (attach) { + projectHelper.attachArtifact(project, testArtifactType, testClassifier, outputFile); } else { - projectHelper.attachArtifact(project, "groovydoc", testClassifier, outputFile); + getLog().info("Not adding test GroovyDoc jar to attached artifacts list."); } } catch (ArchiverException e) { throw new MojoExecutionException("ArchiverException: Error while creating archive", e);