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

Parser throws error when DynamicImport-Package contains attributes

    Details

      Description

      If I try to specify a matching attribute in DynamicImport-Package as shown below, I get a build error.
      <plugin>
      <groupId>org.apache.felix</groupId>
      <artifactId>maven-bundle-plugin</artifactId>
      <version>RELEASE</version>
      <extensions>true</extensions>
      <configuration>
      <instructions>
      <Private-Package>bar</Private-Package>
      <Bundle-Activator>bar.MyActivator</Bundle-Activator>
      <DynamicImport-Package>* ; password=foo</DynamicImport-Package>
      </instructions>
      </configuration>
      </plugin>

      The error is given below:
      [INFO] [bundle:bundle]
      [ERROR] Error building bundle sahoo.dynamic-import-attr:dynamic-importer:bundle:1.0-SNAPSHOT : Invalid value for DynamicImport-Package, * ; password=foo does not match ((\p

      {Alnum}|_)+(\.(\p{Alnum}

      |_)+)*(\.*)?)|*
      [ERROR] Error(s) found in bundle configuration
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Error(s) found in bundle configuration
      [INFO] ------------------------------------------------------------------------
      [DEBUG] Trace
      org.apache.maven.lifecycle.LifecycleExecutionException: Error(s) found in bundle configuration
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Error(s) found in bundle configuration
      at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:341)
      at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:227)
      at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:218)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
      ... 16 more
      Caused by: org.apache.maven.plugin.MojoFailureException: Error(s) found in bundle configuration
      at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:296)
      ... 20 more

        Activity

        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.
        Hide
        mcculls Stuart McCulloch added a comment -

        Fixed in trunk with the update to Bnd 0.0.295 - however, note that I'm still testing this against various projects to check for any build breaks.

        Show
        mcculls Stuart McCulloch added a comment - Fixed in trunk with the update to Bnd 0.0.295 - however, note that I'm still testing this against various projects to check for any build breaks.
        Hide
        sahoo Sahoo added a comment -

        No, DynamicImport-Package was intentionally used. I don't see anything wrong with the specification. As a work around, I used maven-jar-plugin to add the necessary header in my manifest.

        Show
        sahoo Sahoo added a comment - No, DynamicImport-Package was intentionally used. I don't see anything wrong with the specification. As a work around, I used maven-jar-plugin to add the necessary header in my manifest.
        Hide
        pkriens Peter Kriens added a comment -

        I am getting afraid there is no end to the places where I have to clean up maven version. I therefore have added a macro $

        {maven_version;1.0-SNAPSHOT}

        that will convert the maven version string to an OSGi version string. You can use macros and properties inside macros.

        Anyway, I am having a hard time understanding why Dynamic Import is used here? Should that not be just Import-Package?

        Show
        pkriens Peter Kriens added a comment - I am getting afraid there is no end to the places where I have to clean up maven version. I therefore have added a macro $ {maven_version;1.0-SNAPSHOT} that will convert the maven version string to an OSGi version string. You can use macros and properties inside macros. Anyway, I am having a hard time understanding why Dynamic Import is used here? Should that not be just Import-Package?
        Hide
        mcculls Stuart McCulloch added a comment -

        This will require a fix to the Bnd library - could you let Peter know about this issue (I'm getting ready for my trip)

        Show
        mcculls Stuart McCulloch added a comment - This will require a fix to the Bnd library - could you let Peter know about this issue (I'm getting ready for my trip)

          People

          • Assignee:
            mcculls Stuart McCulloch
            Reporter:
            sahoo Sahoo
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development