Maven Archetype
  1. Maven Archetype
  2. ARCHETYPE-371

Add a command line argument to filter/limit the archetypes returned by mvn archetype:generate

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Component/s: Plugin
    • Labels:
      None
    • Environment:
    • Number of attachments :
      0

      Description

      Currently, running mvn archetype:generate returns 390 archetypes, on my machine.
      By default, th window buffer of my terminal isn't set big enough so I can see the first archetypes in the list.

      So, I think it would be really useful to have a CLI arg allowing us to filter the archetypes containing a string.
      Ex: running

      mvn archetype:generate -Dfilter=webapp

      would return only the archetypes having webapp in their artifactId.

      What do you think?

        Activity

        Hide
        Herve Boutemy added a comment -

        Idea: at the prompt, propose "Choose a number or filter:"
        if data entered is not a number, then assume it's a filter and display newly filtered archetypes
        then you don't really need to know -Dfilter, you can interactively test filters

        I didn't if it is really hard to implement or not...

        Show
        Herve Boutemy added a comment - Idea: at the prompt, propose "Choose a number or filter:" if data entered is not a number, then assume it's a filter and display newly filtered archetypes then you don't really need to know -Dfilter, you can interactively test filters I didn't if it is really hard to implement or not...
        Hide
        Olivier Lamy added a comment -

        nice idea to not having to know this magic -Dfiler= .
        BTW the first goal was more to remove the HUGE list of archetype.
        We can certainly do both .
        Agree on the format ? : groupId:artifactId ?
        Samples :

        • org.apache: -> display all archetypes which contains org.apache in groupId
        • :jee or jee -> display all archetypes which contains jee in artifactId
        • org.apache:jee -> display all archetypes which contains org.apache in groupId AND jee in artifactId

        makes sense ?

        Show
        Olivier Lamy added a comment - nice idea to not having to know this magic -Dfiler= . BTW the first goal was more to remove the HUGE list of archetype. We can certainly do both . Agree on the format ? : groupId:artifactId ? Samples : org.apache: -> display all archetypes which contains org.apache in groupId :jee or jee -> display all archetypes which contains jee in artifactId org.apache:jee -> display all archetypes which contains org.apache in groupId AND jee in artifactId makes sense ?
        Hide
        Herve Boutemy added a comment -

        seems easy and efficient

        Show
        Herve Boutemy added a comment - seems easy and efficient
        Hide
        Olivier Lamy added a comment -

        both supported in r1144639.
        Leave it open until I have review documentation.

        Show
        Olivier Lamy added a comment - both supported in r1144639. Leave it open until I have review documentation.
        Hide
        Olivier Lamy added a comment -

        documentation added.
        I have take care of case where filter doesn't return any values.
        Have Fun

        Show
        Olivier Lamy added a comment - documentation added. I have take care of case where filter doesn't return any values. Have Fun

          People

          • Assignee:
            Olivier Lamy
            Reporter:
            Fred Bricon
          • Votes:
            5 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: