Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-509

Add support for explicit source directory include/exclude via plugin configuration

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: maven-scr-plugin-1.0.1, maven-scr-plugin-1.0.2, maven-scr-plugin-1.0.3
    • Fix Version/s: maven-scr-plugin-1.0.4
    • Component/s: SCR Tooling
    • Labels:
      None

      Description

      As discussed on the Felix Users mailing list regarding a problem with a third-party component (non relevant but QDox in that specific case), there was a clear indication that having the ability to control which directories are processed by the Maven SCR Plugin would be helpful.

      This feature would allow things like:

      <configuration>
      <exclude>target/generated-sources</exclude>
      </configuration>

      Current Implementation:

      The JavaClassDescriptorManager constructor gets all source directories from MavenProject.getCompileSourceRoots(). The exclusion should be coded here consulting the plugin configuration block.

      Since the plugin is currently "include all exclude explicit" there may be no purpose in actually having an include directive, unless it would support sub-tree checking, which would complicate things quite a bit (as in exclude target/foo but include target/foo/bar).

        Activity

        Hide
        cziegeler Carsten Ziegeler added a comment -

        The first patch was totally wrong, I applied a new patch that supports pattern matching and requires excludes to be defined relative to the source directory.
        In your case, relative to target/generated-sources!
        Patterns now work, like

        <configuration>
        <excludes>org/apache/felix/generated/**</excludes>
        </configuration>

        Show
        cziegeler Carsten Ziegeler added a comment - The first patch was totally wrong, I applied a new patch that supports pattern matching and requires excludes to be defined relative to the source directory. In your case, relative to target/generated-sources! Patterns now work, like <configuration> <excludes>org/apache/felix/generated/**</excludes> </configuration>
        Hide
        cziegeler Carsten Ziegeler added a comment -

        I just committed a patch for this, you can now exclude dirs (or files) by specifying a comma separated list of excludes:

        <configuration>
        <excludes>target/generated-sources,src/main/java/org/apache/felix/MyClass</excludes>
        </configuration>

        You can define prefixes to be excluded (patterns using * or **) are not supported.

        Show
        cziegeler Carsten Ziegeler added a comment - I just committed a patch for this, you can now exclude dirs (or files) by specifying a comma separated list of excludes: <configuration> <excludes>target/generated-sources,src/main/java/org/apache/felix/MyClass</excludes> </configuration> You can define prefixes to be excluded (patterns using * or **) are not supported.

          People

          • Assignee:
            cziegeler Carsten Ziegeler
            Reporter:
            rodrigo.madera Rodrigo Madera
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development