Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change GroovyDoc artifact type to javadoc, so it can be handled correctly #164

Merged
merged 1 commit into from
Aug 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>1.9.2-SNAPSHOT</version>
<version>1.10.0-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
18 changes: 13 additions & 5 deletions src/main/java/org/codehaus/gmavenplus/mojo/GroovyDocJarMojo.java
Original file line number Diff line number Diff line change
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.10.0
*/
@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
// 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);
Expand Down
Original file line number Diff line number Diff line change
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.10.0
*/
@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
// 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);
Expand Down