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

groovydoc goal not executed despite being listed in executions #65

Open
reckart opened this issue Aug 12, 2016 · 5 comments
Open

groovydoc goal not executed despite being listed in executions #65

reckart opened this issue Aug 12, 2016 · 5 comments
Assignees

Comments

@reckart
Copy link

reckart commented Aug 12, 2016

I don't understand why the groovydoc and testGroovydoc goals are not executed despite being listed in the execution. If I directly invoke it from the command line, it works. Not that the other goals appear all to be properly executed.

  <profiles>
    <profile>
      <id>groovy</id>
      <activation>
        <file>
          <exists>src/main/groovy</exists>
        </file>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.codehaus.groovy</groupId>
          <artifactId>groovy</artifactId>
        </dependency>
        <dependency>
          <groupId>org.codehaus.groovy</groupId>
          <artifactId>groovy-all</artifactId>
          <version>${groovy.version}</version>
        </dependency>
        <dependency>
          <groupId>org.codehaus.groovy</groupId>
          <artifactId>groovy-templates</artifactId>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.gmavenplus</groupId>
            <artifactId>gmavenplus-plugin</artifactId>
            <version>1.5</version>
            <executions>
              <execution>
                <goals>
                  <goal>addSources</goal>
                  <goal>addTestSources</goal>
                  <goal>generateStubs</goal>
                  <goal>compile</goal>
                  <goal>testGenerateStubs</goal>
                  <goal>testCompile</goal>
                  <goal>groovydoc</goal>
                  <goal>testGroovydoc</goal>
                  <goal>removeStubs</goal>
                  <goal>removeTestStubs</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
@reckart
Copy link
Author

reckart commented Aug 12, 2016

Adding the goals into a separate execution and binding that explicitly to a phase seems to work though:

<build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.gmavenplus</groupId>
            <artifactId>gmavenplus-plugin</artifactId>
            <version>1.5</version>
            <executions>
              <execution>
                <id>build</id>
                <goals>
                  <goal>addSources</goal>
                  <goal>addTestSources</goal>
                  <goal>generateStubs</goal>
                  <goal>compile</goal>
                  <goal>testGenerateStubs</goal>
                  <goal>testCompile</goal>
                  <goal>removeStubs</goal>
                  <goal>removeTestStubs</goal>
                </goals>
              </execution>
              <execution>
                <id>documentation</id>
                <phase>package</phase>
                <goals>
                  <goal>groovydoc</goal>
                  <goal>testGroovydoc</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>

@keeganwitt
Copy link
Member

It's because the Groovydoc goals are not associated with any phase by default. Ideally, someday I'd make the Groovydoc a proper Maven site plugin. But until then, there wasn't any phase in the default build lifecycle that felt appropriate to bind to by default.

@reckart
Copy link
Author

reckart commented Aug 12, 2016

Why not the package phase?

@reckart
Copy link
Author

reckart commented Aug 12, 2016

Well, probably prepare-package would be better or even binding the groovydoc and testGrooydoc to separate phase, e.g. process-classes and process-test-classes.

Eventually, I switched back to the groovydoc maven plugin for the being because that also creates the docs JAR and attaches it to the build. This is required in order to release artifacts to Maven Central.

@keeganwitt
Copy link
Member

Well, the mojo could be called as part of site, or as part of building a Groovydoc jar. And you'd want it bound to different phases, depending on the usage. Right now, I don't build jars of Groovydoc, but maybe I could add a new mojo to do that and bind to package phase the same way groovydoc maven plugin does -- let me give it some thought.

@keeganwitt keeganwitt self-assigned this Aug 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants