Uploaded image for project: 'Maven Plugin Tools'
  1. Maven Plugin Tools
  2. MPLUGIN-267

document how to change descriptor phase instead of running it twice with skipErrorNoDescriptorsFound

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.3
    • 3.4
    • Plugin Plugin
    • None

    Description

      actual example says:

        <build>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-plugin-plugin</artifactId>
              <version>3.3</version>
              <configuration>
                <!-- see http://jira.codehaus.org/browse/MNG-5346 -->
                <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
              </configuration>
              <executions>
                <execution>
                  <id>mojo-descriptor</id>
                  <goals>
                    <goal>descriptor</goal>
                  </goals>
                </execution>

      this skipErrorNoDescriptorsFound configuration is not really good, since it does never check if mojo descriptors can be found.

      A recent idea permits to avoid this: simply changing the phase of the actual goal, instead of configuring a second run:

        <build>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-plugin-plugin</artifactId>
              <version>3.3</version>
              <executions>
                <execution>
                  <id>default-descriptor</id>
                  <phase>process-classes</phase>
                </execution>

      the key change is the default-descriptor execution id instead of mojo-descriptor.

      Notice: it works with Maven 3 but not with Maven 2...

      Attachments

        Activity

          People

            hboutemy Herve Boutemy
            hboutemy Herve Boutemy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: