Skip to content

Commit

Permalink
[eclipse#59] Clean up OSGi metadata
Browse files Browse the repository at this point in the history
- Remove "sun.misc" and "sun.nio.ch" from the list of imported packages.
- Add a Travis CI file
- Use the maven-bundle-plugin in order to create OSGi metadata. It falls back to the default configuration, only overriding this when really necessary.
- Prevent the maven-bundle-plugin from importing 'javax.annotation' in order to prevent a "uses violation".

Signed-off-by: Jens Reimann <jreimann@redhat.com>
  • Loading branch information
ctron authored and kevinherron committed Oct 13, 2016
1 parent 2e18dfd commit ea741a6
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 96 deletions.
8 changes: 6 additions & 2 deletions .gitignore
Expand Up @@ -5,10 +5,14 @@
*.war
*.ear

# Eclipse
.settings/
.project
.classpath

# IntelliJ #
*.iml
.idea/*

# Maven #
**/target/*
target/*
target/
4 changes: 4 additions & 0 deletions .travis.yml
@@ -0,0 +1,4 @@
language: java

jdk:
- oraclejdk8
20 changes: 0 additions & 20 deletions milo-examples/client-examples/pom.xml
Expand Up @@ -28,24 +28,4 @@
<version>1.1.7</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.4.0</version>
<executions>
<execution>
<id>generate-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
10 changes: 10 additions & 0 deletions milo-examples/pom.xml
Expand Up @@ -16,5 +16,15 @@
<module>client-examples</module>
<module>server-examples</module>
</modules>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<!-- configuration inherited from pluginManagement -->
</plugin>
</plugins>
</build>

</project>
21 changes: 1 addition & 20 deletions milo-examples/server-examples/pom.xml
Expand Up @@ -23,24 +23,5 @@
<version>1.1.7</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.4.0</version>
<executions>
<execution>
<id>generate-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>


</project>
28 changes: 1 addition & 27 deletions opc-ua-sdk/pom.xml
Expand Up @@ -88,33 +88,7 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.4.0</version>
<executions>
<execution>
<id>generate-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
<configuration>
<supportedProjectTypes>
<supportedProjectType>jar</supportedProjectType>
<supportedProjectType>bundle</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Export-Package>${project.groupId}.opcua.sdk.*</Export-Package>

<!-- enforce JVM vendor package as optional -->
<Import-Package>
*,sun.misc.*;resolution:=optional,sun.nio.ch;resolution:=optional,sun.security.*;resolution:=optional
</Import-Package>

<!-- override "internal" private package convention -->
<Private-Package>!*</Private-Package>
</instructions>
</configuration>
</execution>
</executions>
<!-- configuration inherited from pluginManagement -->
</plugin>

<plugin>
Expand Down
28 changes: 1 addition & 27 deletions opc-ua-stack/pom.xml
Expand Up @@ -53,33 +53,7 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.4.0</version>
<executions>
<execution>
<id>generate-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
<configuration>
<supportedProjectTypes>
<supportedProjectType>jar</supportedProjectType>
<supportedProjectType>bundle</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Export-Package>${project.groupId}.opcua.stack.*</Export-Package>

<!-- enforce JVM vendor package as optional -->
<Import-Package>
*,sun.misc.*;resolution:=optional,sun.nio.ch;resolution:=optional,sun.security.*;resolution:=optional
</Import-Package>

<!-- override "internal" private package convention -->
<Private-Package>!*</Private-Package>
</instructions>
</configuration>
</execution>
</executions>
<!-- configuration inherited from pluginManagement -->
</plugin>

<plugin>
Expand Down
28 changes: 28 additions & 0 deletions pom.xml
Expand Up @@ -195,6 +195,34 @@
</configuration>
</plugin>

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>generate-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
<configuration>
<supportedProjectTypes>
<supportedProjectType>jar</supportedProjectType>
<supportedProjectType>bundle</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Import-Package>
com.sun.management.*;resolution:=optional,
!javax.annotation.*,
*
</Import-Package>
</instructions>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
Expand Down

0 comments on commit ea741a6

Please sign in to comment.