Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-1500

ProjectFactoryImpl.findProject() should iterate over directories first then over build systems

    Details

    • Steps to Reproduce:
      Hide

      Run Maven build, or when running tests from Eclipse, put pom.xml in temporary directory.

      Show
      Run Maven build, or when running tests from Eclipse, put pom.xml in temporary directory.

      Description

      https://github.com/forge/core/blob/2.0/projects/impl/src/main/java/org/jboss/forge/addon/projects/impl/ProjectFactoryImpl.java#L102

      In case we have a project structure:
      a/pom.xml
      a/b/build.gradle

      Starting from a/b/, if registry.getServices(BuildSystem.class) returns MavenBuildSystem as first, then it will pick up a/pom.xml.

      My solution is inverting loops:
      for (each build system) { for (each directory)

      { ... } } ---> for (each dir) { for (each build system) { ... }

      }

      This causes problems in Gradle addon Maven build as temporary projects are run inside target/ directory, which has always pom.xml above.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                adamwww Adam Wyłuda
                Reporter:
                adamwww Adam Wyłuda
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: