Maven Plugin Tools
  1. Maven Plugin Tools
  2. MPLUGIN-109

Misleading warning when creating a Maven plugin defining a custom packaging

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.4.1
    • Fix Version/s: 2.5
    • Component/s: Plugin Plugin
    • Labels:
      None
    • Number of attachments :
      2

      Description

      When creating a custom packaging using the 2.4.1 version of the maven-plugin-plugin, I'm getting the following warning message:

      [INFO] Building foobar-maven-plugin
      [INFO] task-segment: [install]
      [INFO] ------------------------------------------------------------------------
      [INFO] [plugin:descriptor]
      [INFO] Using 2 extractors.
      [INFO] Applying extractor for language: java
      [INFO] Extractor for language: java found 0 mojo descriptors.
      [INFO] Applying extractor for language: bsh
      [INFO] Extractor for language: bsh found 0 mojo descriptors.
      [WARNING]
      [WARNING]
      [WARNING] *******************************************************
      [WARNING] Deprecation Alert:
      [WARNING] No mojo descriptors were found in this project which has a packaging type of maven-plugin.
      [WARNING] In future versions of the plugin tools, this will fail the build.
      [WARNING] If this project is an archetype, change the packaging type from maven-plugin to maven-archetype.
      [WARNING] ********************************************************

      Indeed, my project contains no Mojos, only a plexus components.xml file. Now if you try to enforce a rule that says that a maven-plugin must contain at least one Mojo (see MPLUGIN-106), that's fine, but which packaging am I supposed to use to create a plugin that defines a new packaging (here, the foobar packaging)

        Issue Links

          Activity

          Hide
          John Casey added a comment -

          You should define the project with the component descriptor as packaging == 'jar' then add it to your application project build using the extensions section of project/build in the POM, instead of defining it as a plugin with extensions == true.

          If you do this, then it doesn't matter that the maven-plugin-plugin wouldn't find any mojos in your plugin, because your lifecycle definition isn't in a maven-plugin artifact at all; it's in a jar artifact.

          Show
          John Casey added a comment - You should define the project with the component descriptor as packaging == 'jar' then add it to your application project build using the extensions section of project/build in the POM, instead of defining it as a plugin with extensions == true. If you do this, then it doesn't matter that the maven-plugin-plugin wouldn't find any mojos in your plugin, because your lifecycle definition isn't in a maven-plugin artifact at all; it's in a jar artifact.
          Hide
          Brett Porter added a comment -

          This is no longer the case - you can configure <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound> to avoid the error. This is preferable to using the jar packaging type, as when that is used as a plugin it warns about a missing plugin descriptor on every build.

          Show
          Brett Porter added a comment - This is no longer the case - you can configure <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound> to avoid the error. This is preferable to using the jar packaging type, as when that is used as a plugin it warns about a missing plugin descriptor on every build.

            People

            • Assignee:
              John Casey
              Reporter:
              Ludovic Claude
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: