Maven
  1. Maven
  2. MNG-2675

add getModules() method which return a MavenProject List instead of module name String list

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0.4
    • Fix Version/s: None
    • Component/s: POM
    • Labels:
      None
    • Environment:
      Maven 2.0.4, Windows 2000
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      Hi,

      i try to develop a dashboard report plugin.

      But i have a problem with a multi-project pom which i used to test my plugin.

      I have a master project with modules which have some modules or project.

      Until now, i get the modules list with project.getModules() method and i compare each module name with the project name that i get with project.getCollectedProjects() method.

      And for each MavenProject object i retreive, i repeat the last algorithm (getModules() .....)

      all module names are the same as ArtifactId and my plugin work well.

      But with this new project, the module names and ArtifactId are different.

      and i can't retreive MavenProjects which are direct module of my pom.

      can you add a method to MavenProject object which return the list of modules as MavenProject object instead of String object ?

        Issue Links

          Activity

          Hide
          Jörg Hohwiller added a comment -

          I'd rather suggest to return a List<Module> where Module still has

          public String getPath()

          but also

          public MavenProject getProject()

          Now there should be a way to do getProject() even if the module is NOT part of the reactor.
          This should be done via lazy evaluation. Therefore an additional method should be added
          to either test if the MavenProject is NOT yet available (boolean isProjectAvailable()) or a
          method that ensures to load it (boolean loadProject()) while getProject() will return null
          before loadProject() was executed in case the MavenProject is not yet available.
          I personally prefer the first suggestion.

          Show
          Jörg Hohwiller added a comment - I'd rather suggest to return a List<Module> where Module still has public String getPath() but also public MavenProject getProject() Now there should be a way to do getProject() even if the module is NOT part of the reactor. This should be done via lazy evaluation. Therefore an additional method should be added to either test if the MavenProject is NOT yet available (boolean isProjectAvailable()) or a method that ensures to load it (boolean loadProject()) while getProject() will return null before loadProject() was executed in case the MavenProject is not yet available. I personally prefer the first suggestion.
          Hide
          Jason van Zyl added a comment -

          I would name this method getModulesAsMavenProjects() to be more clear. This should not be a problem so I put it in the backlog.

          Show
          Jason van Zyl added a comment - I would name this method getModulesAsMavenProjects() to be more clear. This should not be a problem so I put it in the backlog.

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              David Vicente
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: