jamesward / osgi-version-maven-plugin

1 stars 2 forks source link

Provide additional property dependencies.osgi for OSGified Maven dependencies #2

Open Sandared opened 6 years ago

Sandared commented 6 years ago

Is it sensible if we provide an additional property "dependencies.osgi" that provides a String for the dependencies in the OSGi manifest? This dependencies STring would be calculated from the Maven dependencies (if any). If there are no dependencies, then it would be an empty String that is not taken into consideration by the bnd-maven-plugin.

Otherwise the dependencies would have to be manually typed by the developer for each POM.

The plugin configuration would then look like this:

<plugin>
    <groupId>biz.aQute.bnd</groupId>
    <artifactId>bnd-maven-plugin</artifactId>
    <configuration>
        <bnd>
        <![CDATA[
            Bundle-SymbolicName: ${project.groupId}.${project.artifactId}
            Bundle-Version:  ${version.osgi}
            Bundle-Description: ${project.description}
            -resourceonly:true
            WebJars-Resource:\
                /META-INF/resources/webjars/${project.artifactId}/${project.version},\
                /webjars-requirejs.js
            Provide-Capability: ${project.groupId};${project.artifactId}:List<String>=${version.osgi}
                        Require-Capability: ${dependencies.osgi}
        ]]>
       </bnd>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>bnd-process</goal>
            </goals>
        </execution>
    </executions>
</plugin>
jamesward commented 6 years ago

It actually seems like there should be a plugin that auto-generates the whole osgi config. And config params could bind to pom variables. I'm surprised that doesn't exist.

Sandared commented 6 years ago

Sent a PR.