Daniel Kulp created FELIX-4411:
----------------------------------

             Summary: "null" Bundle-Activator causes exception if assertions 
turned on
                 Key: FELIX-4411
                 URL: https://issues.apache.org/jira/browse/FELIX-4411
             Project: Felix
          Issue Type: Bug
          Components: Maven Bundle Plugin
    Affects Versions: maven-bundle-plugin-2.4.0
            Reporter: Daniel Kulp


In our top level pom, we have the maven-bundle-plugin with an instruction like:

{code:xml}
<Bundle-Activator>${cxf.bundle.activator}</Bundle-Activator>
{code}
and a property of:
{code:xml}
<cxf.bundle.activator />
{code}

which works fine.  Bundles that have an activator just add a property in their 
pom and it's picked up, bundles without one don't define a property and it all 
seems to work.

HOWEVER, if run with MAVEN_OPTS="-ea", the bundle plugin throws an exception.   
The problem is technically in bnd.     In aQute.bnd.osgi.Analyzer.analyze(), it 
calls:

{code:java}
                        String s = getProperty(BUNDLE_ACTIVATOR);
                        if (s != null) {
activator = getTypeRefFromFQN(s);
                                referTo(activator);
                                trace("activator %s %s", s, activator);
                        }
{code}
however, the return from the getProperty(..) call is an empty string, not null.

It may be good if the bundle-plugin would filter out the empty strings or nulls 
in cases like this where we know it wouldn't be valid.  That said, a fix in bnd 
would be good as well.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to