felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stuart McCulloch (JIRA)" <j...@apache.org>
Subject [jira] Closed: (FELIX-2015) Pattern matching not working correctly for Embed-Dependency
Date Tue, 02 Feb 2010 11:40:18 GMT

     [ https://issues.apache.org/jira/browse/FELIX-2015?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Stuart McCulloch closed FELIX-2015.

    Resolution: Not A Problem

This is actually working as designed.

For reasons of consistency we use the same Bnd Tool clause matching code for Embed-Dependency
that's used for other Bnd instructions. This code compares patterns using standard Java regex
matching rules, with a couple of exceptions to simplify the common case (such as dealing with
dotted packages and ids):

The exceptions take the form of a pre-processing step before applying the Java regex matcher:

  1)  dots (.) are escaped (\.)
  2)  asterisks (*) become wildcards (.*)
  3)  question marks (?) become optional characters (.?)

So the Bnd instruction pattern ??? is actually the Java regexp pattern .?.?.? which matches
zero to three characters, and the
instruction pattern ???? is the regexp pattern .?.?.?.? which matches zero to four characters.
Both these patterns match "jcr".

If you want to specify exactly three characters then you can use the following pattern:


which matches three non-whitespace characters - note you can't simply use dots (.) because
they're automatically escaped.

See also http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html

> Pattern matching not working correctly for Embed-Dependency
> -----------------------------------------------------------
>                 Key: FELIX-2015
>                 URL: https://issues.apache.org/jira/browse/FELIX-2015
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.0.1
>            Reporter: Michael Dürig
> Both 
> <Embed-Dependency>???</Embed-Dependency>
> and 
> <Embed-Dependency>????</Embed-Dependency>
> result in jcr-2.0.jar being included in the bundle. 
> I assume that the pattern is matched against the artifactId, so for the second case jcr-2.0.jar
should not go into the bundle. 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message