On 06/03/2008, Mike Smoot <[EMAIL PROTECTED]> wrote:
>
> Hi Everyone,
>
> Is it possible to tell the wrap goal of the maven-bundle-plugin to make
> all
> import packages optional by default?


Not currently - both the wrap and bundleall goals use the default export and
import instructions.
You can raise a feature request for this on the Felix JIRA, and feel free to
provide a patch for it :)

The alternative is to use the Embed-Dependency feature to wrap the
artifact(s) for example:

====================================================================

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd"; xmlns="
http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";>

  <modelVersion>4.0.0</modelVersion>
  <groupId>examples</groupId>
  <artifactId>asm</artifactId>
  <version>3.1-001-SNAPSHOT</version>

  <name>asm 3.1 [osgi]</name>

  <packaging>bundle</packaging>

  <dependencies>
    <dependency>
      <groupId>asm</groupId>
      <artifactId>asm</artifactId>
      <version>3.1</version>
      <optional>true</optional>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>1.4.0</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Embed-Dependency>*;scope=compile;inline=true</Embed-Dependency>
            <Import-Package>*;resolution:=optional</Import-Package>
            <_exportcontents>*</_exportcontents>
            <Private-Package>!*</Private-Package>
          </instructions>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>

====================================================================

HTH

thanks,
> Mike
>
>
> --
> ____________________________________________________________
> Michael Smoot, Ph.D.               Bioengineering Department
> tel: 858-822-4756         University of California San Diego
>



-- 
Cheers, Stuart

Reply via email to