Skip to content

Commit

Permalink
Change GroovyDoc artifact type to javadoc (closes #151)
Browse files Browse the repository at this point in the history
  • Loading branch information
keeganwitt committed Aug 3, 2020
1 parent 2555e97 commit 21c0804
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
18 changes: 13 additions & 5 deletions src/main/java/org/codehaus/gmavenplus/mojo/GroovyDocJarMojo.java
Expand Up @@ -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.9.2
*/
@Parameter(defaultValue = "javadoc")
private String artifactType;

/**
* Whether to invoke the <code>groovydoc</code> goal before creating jar.
*/
Expand All @@ -111,17 +119,17 @@ public class GroovyDocJarMojo extends GroovyDocMojo {
@Override
public void execute() throws MojoExecutionException {
if (invokeGroovyDoc) {
// generate the GroovyDoc
// generate 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);
Expand Down
Expand Up @@ -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.9.2
*/
@Parameter(defaultValue = "javadoc")
private String testArtifactType;

/**
* Whether to invoke the <code>groovydocTests</code> goal before creating jar.
*/
Expand All @@ -111,17 +119,17 @@ public class GroovyDocTestsJarMojo extends GroovyDocTestsMojo {
@Override
public void execute() throws MojoExecutionException {
if (invokeGroovyDoc) {
// generate the test GroovyDoc
// generate 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);
Expand Down

0 comments on commit 21c0804

Please sign in to comment.