Thursday, April 28, 2011

Including resources in OSGi bundle

you can has:

                        <Include-Resource>
                            {maven-resources}, {maven-dependencies},
                            templates=src/resources/templates
                        </Include-Resource>


inside  maven-bundle-plugin

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.0.1</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                         ...
                        <Include-Resource>
                            {maven-resources}, {maven-dependencies},
                            templates=src/resources/templates
                        </Include-Resource>
                          ...
                    </instructions>
                </configuration>
            </plugin>


You need {maven-resources} and {maven-dependencies} or mvn packages fails.

And it is dst-pat-in-the-jar=src  (templates=src/resources/templates)

3 comments:

  1. Thank you very much for this :=)

    ReplyDelete
  2. Thansk for the "Include-Resource" example. Official doc doesn't provide a simple example like yours =)

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete