Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8345160

Allow marker at start of --module-source-path when using module-pattern-form

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • tools
    • None

      in com.sun.tools.javac.file.Locations.ModuleSourcePathLocationHandler.initFromPattern(String) there's the following code:
       
                          if (markStart == 0 || !isSeparator(seg.charAt(markStart - 1))) {
                              throw new IllegalArgumentException("illegal use of " + MARKER + " in " + seg);
                          }
       
      If we look at multimodule maven projects, you often see an “aggregator” pom in the root of the project, that triggers the compilation of every separate project.
       
      Name1/pom.xml
      Name2/pom.xml
      Name3/pom.xml
      pom.xml (aggregator, refers to other poms above)
       
      the best practice is to use the artifactId as the name of the folder, but maybe this should become the modulename.
       
      To run this with a single compilation, it should be possible to do --module-source-path */src/main/java but that is currently not allowed.

      It seems the pattern was the first approach for the module system, but the specific became the standard, giving the pattern les attention.

      The marker represents a module name, so there doesn't seem a valid reason to block this pattern (especially since tricking with ./*/src/main/java does work)

            Unassigned Unassigned
            rfscholte Robert Scholte
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: