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

Enable excludeDependencies to check groupId, version, etc. rather than only artifactId

    Details

      Description

      At the moment maven-bundle-plugin allow a comma separated list as excludeDependencies, but this list allows the selection of the dependencies to exclude by means of artifacId.
      I'd like to be able to change the behavior of the excludeDependencies in order to accept a list of dependencies URI, so that the dependencies will be excluded only if it matches the whole URI.

      The URI for a dependency is defined as follow:
      <groupId>:<artifactId>:<type>:<version>:<scope>

      The plugin should try to interpret non full qualified URI, in order to match the old behavior and to make the excludeDependecies more user-friendly. For instance, depending on the number of colon:
      0 colon -> <artifactId>
      1 colon -> <groupId>:<artifactId>
      2 colon -> <groupId>:<artifactId>:<version>
      3 colon -> <groupId>:<artifactId>:<type>:<version>

        Issue Links

          Activity

          Hide
          stefano.lenzi Stefano Lenzi added a comment -

          The patch implements the behavior request by my e-mail.

          We should consider to allow a subtag like
          <exclude>
          <groupId></groupId>
          <artifactId></artifactId>
          ....
          </exclude>

          in a more maven way rather than keeping the comma separated list

          Show
          stefano.lenzi Stefano Lenzi added a comment - The patch implements the behavior request by my e-mail. We should consider to allow a subtag like <exclude> <groupId></groupId> <artifactId></artifactId> .... </exclude> in a more maven way rather than keeping the comma separated list
          Hide
          mcculls Stuart McCulloch added a comment -

          targeting next major release (1.6.0) of the maven-bundle-plugin

          Show
          mcculls Stuart McCulloch added a comment - targeting next major release (1.6.0) of the maven-bundle-plugin
          Hide
          mcculls Stuart McCulloch added a comment -

          Rather than invent a new syntax for filtering dependencies I decided to re-use the filter code from embedding dependencies:
          ( this approach also means we retain backwards compatibility, because a simple name is taken to be a filter on the artifactId )

          http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html#ApacheFelixMavenBundlePlugin(BND)-Embeddingdependencies

          this means you can now exclude dependencies based on clauses:

          <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>1.5.0-SNAPSHOT</version>
          <configuration>
          <excludeDependencies>clause,clause,...</excludeDependencies>
          <instructions>
          <!- usual BND stuff -->
          </instructions>
          </configuration>
          </plugin>

          where:

          clause ::= MATCH ( ';' attr '=' MATCH )
          attr ::= 'groupId' | 'artifactId' | 'version' | 'scope' | 'type' | 'classifier'
          MATCH ::= <globbed regular expression>

          for example:

          <excludeDependencies>*;scope=provided</excludeDependencies>

          will exclude all provided scope dependencies from the classpath passed to BND (mimicking the old behaviour)

          Show
          mcculls Stuart McCulloch added a comment - Rather than invent a new syntax for filtering dependencies I decided to re-use the filter code from embedding dependencies: ( this approach also means we retain backwards compatibility, because a simple name is taken to be a filter on the artifactId ) http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html#ApacheFelixMavenBundlePlugin(BND)-Embeddingdependencies this means you can now exclude dependencies based on clauses: <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>1.5.0-SNAPSHOT</version> <configuration> <excludeDependencies>clause,clause,...</excludeDependencies> <instructions> <!- usual BND stuff --> </instructions> </configuration> </plugin> where: clause ::= MATCH ( ';' attr '=' MATCH ) attr ::= 'groupId' | 'artifactId' | 'version' | 'scope' | 'type' | 'classifier' MATCH ::= <globbed regular expression> for example: <excludeDependencies>*;scope=provided</excludeDependencies> will exclude all provided scope dependencies from the classpath passed to BND (mimicking the old behaviour)
          Hide
          mcculls Stuart McCulloch added a comment -

          Closing as maven-bundle-plugin 2.0.0 has been released.

          Show
          mcculls Stuart McCulloch added a comment - Closing as maven-bundle-plugin 2.0.0 has been released.

            People

            • Assignee:
              mcculls Stuart McCulloch
              Reporter:
              stefano.lenzi Stefano Lenzi
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development