Elffuss BraidHub

kikocis/java-driver public

Merge pull request #281 from datastax/fix_osgi

Fix OSGI and shade JAR configuration.
Changeset2b8e45837cf639c3f18ca597887dd7003c65159a37b09bb0bd932448f366906a
AuthorOlivier Michallat <olim7t@users.noreply.github.com> · 2015-03-02 10:56 -08:00
CommitterOlivier Michallat <olim7t@users.noreply.github.com> · 2015-03-02 10:56 -08:00
Parentsddaa2629e384, 7eb9c8974600

Browse the files at this changeset

4 files changed

modified driver-core/CHANGELOG.rst +1 −0
@@ -8,6 +8,7 @@
88 - [improvement] Add connection heartbeat (JAVA-533)
99 - [improvement] Reduce level of logs on missing rpc_address (JAVA-568)
1010 - [improvement] Expose node token and range information (JAVA-312)
11+- [bug] Fix guava dependency when using OSGI (JAVA-620)
1112
1213 Merged from 2.0.9_fixes branch:
1314
modified driver-core/pom.xml +84 −31
@@ -112,6 +112,90 @@
112112 <filtering>true</filtering>
113113 </resource>
114114 </resources>
115+ <plugins>
116+ <plugin>
117+ <artifactId>maven-compiler-plugin</artifactId>
118+ <configuration>
119+ <compilerArgument>-Xlint:all</compilerArgument>
120+ <showWarnings>true</showWarnings>
121+ <showDeprecation>true</showDeprecation>
122+ </configuration>
123+ </plugin>
124+ <plugin>
125+ <groupId>org.apache.felix</groupId>
126+ <artifactId>maven-bundle-plugin</artifactId>
127+ <extensions>true</extensions>
128+ <version>2.4.0</version>
129+ <!--
130+ Default configuration, used by the `bundle` goal that is implicitly bound to the `package` phase
131+ (because the project uses the `bundle` packaging)
132+ -->
133+ <configuration>
134+ <instructions>
135+ <Bundle-SymbolicName>com.datastax.driver.core</Bundle-SymbolicName>
136+ <Bundle-Version>${project.version}</Bundle-Version>
137+ <_include>-osgi.bnd</_include>
138+ <Import-Package><![CDATA[com.google.common*;version="[14.0,19)",*]]></Import-Package>
139+ </instructions>
140+ <supportedProjectTypes>
141+ <supportedProjectType>jar</supportedProjectType>
142+ <supportedProjectType>bundle</supportedProjectType>
143+ <supportedProjectType>pom</supportedProjectType>
144+ </supportedProjectTypes>
145+ </configuration>
146+ <executions>
147+ <!-- Alternate execution to generate the shaded JAR's manifest -->
148+ <execution>
149+ <id>bundle-manifest-shaded</id>
150+ <phase>prepare-package</phase>
151+ <goals>
152+ <goal>manifest</goal>
153+ </goals>
154+ <configuration>
155+ <manifestLocation>${project.build.directory}/META-INF-shaded</manifestLocation>
156+ <instructions>
157+ <Import-Package><![CDATA[com.google.common.*;version="[14.0,19)",!org.jboss.netty.*,*]]></Import-Package>
158+ <Private-Package>com.datastax.shaded.*</Private-Package>
159+ </instructions>
160+ </configuration>
161+ </execution>
162+ </executions>
163+ </plugin>
164+ <plugin>
165+ <artifactId>maven-shade-plugin</artifactId>
166+ <version>2.3</version>
167+ <executions>
168+ <execution>
169+ <phase>package</phase>
170+ <goals><goal>shade</goal></goals>
171+ <configuration>
172+ <shadedArtifactAttached>true</shadedArtifactAttached>
173+ <artifactSet>
174+ <includes>
175+ <include>io.netty:netty</include>
176+ </includes>
177+ </artifactSet>
178+ <relocations>
179+ <relocation>
180+ <pattern>org.jboss.netty</pattern>
181+ <shadedPattern>com.datastax.shaded.netty</shadedPattern>
182+ </relocation>
183+ </relocations>
184+ <transformers>
185+ <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
186+ <resource>META-INF/MANIFEST.MF</resource>
187+ </transformer>
188+ <!-- Pick up the alternate manifest that was generated by the alternate execution of the bundle plugin -->
189+ <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
190+ <resource>META-INF/MANIFEST.MF</resource>
191+ <file>${project.build.directory}/META-INF-shaded/MANIFEST.MF</file>
192+ </transformer>
193+ </transformers>
194+ </configuration>
195+ </execution>
196+ </executions>
197+ </plugin>
198+ </plugins>
115199 </build>
116200
117201 <profiles>
@@ -141,37 +225,6 @@
141225 <!--<forkMode>never</forkMode>-->
142226 </configuration>
143227 </plugin>
144- <plugin>
145- <artifactId>maven-compiler-plugin</artifactId>
146- <configuration>
147- <compilerArgument>-Xlint:all</compilerArgument>
148- <showWarnings>true</showWarnings>
149- <showDeprecation>true</showDeprecation>
150- </configuration>
151- </plugin>
152- <plugin>
153- <artifactId>maven-shade-plugin</artifactId>
154- <version>2.3</version>
155- <executions>
156- <execution>
157- <phase>package</phase>
158- <goals><goal>shade</goal></goals>
159- <configuration>
160- <artifactSet>
161- <includes>
162- <include>io.netty:netty</include>
163- </includes>
164- </artifactSet>
165- <relocations>
166- <relocation>
167- <pattern>org.jboss.netty</pattern>
168- <shadedPattern>com.datastax.shaded.netty</shadedPattern>
169- </relocation>
170- </relocations>
171- </configuration>
172- </execution>
173- </executions>
174- </plugin>
175228 </plugins>
176229 </build>
177230 </profile>
modified driver-dse/pom.xml +23 −0
@@ -34,6 +34,29 @@
3434 </dependency>
3535 </dependencies>
3636
37+ <build>
38+ <plugins>
39+ <plugin>
40+ <groupId>org.apache.felix</groupId>
41+ <artifactId>maven-bundle-plugin</artifactId>
42+ <extensions>true</extensions>
43+ <version>2.4.0</version>
44+ <configuration>
45+ <instructions>
46+ <Bundle-SymbolicName>com.datastax.driver.dse</Bundle-SymbolicName>
47+ <Bundle-Version>${project.version}</Bundle-Version>
48+ <_include>-osgi.bnd</_include>
49+ </instructions>
50+ <supportedProjectTypes>
51+ <supportedProjectType>jar</supportedProjectType>
52+ <supportedProjectType>bundle</supportedProjectType>
53+ <supportedProjectType>pom</supportedProjectType>
54+ </supportedProjectTypes>
55+ </configuration>
56+ </plugin>
57+ </plugins>
58+ </build>
59+
3760 <licenses>
3861 <license>
3962 <name>Apache 2</name>
modified pom.xml +0 −27
@@ -131,33 +131,6 @@
131131 <tagNameFormat>@{project.version}</tagNameFormat>
132132 </configuration>
133133 </plugin>
134- <plugin>
135- <groupId>org.apache.felix</groupId>
136- <artifactId>maven-bundle-plugin</artifactId>
137- <extensions>true</extensions>
138- <version>2.4.0</version>
139- <executions>
140- <execution>
141- <id>bundle-manifest</id>
142- <phase>process-classes</phase>
143- <goals>
144- <goal>manifest</goal>
145- </goals>
146- </execution>
147- </executions>
148- <configuration>
149- <instructions>
150- <Bundle-SymbolicName>com.datastax.driver.core</Bundle-SymbolicName>
151- <Bundle-Version>${project.version}</Bundle-Version>
152- <_include>-osgi.bnd</_include>
153- </instructions>
154- <supportedProjectTypes>
155- <supportedProjectType>jar</supportedProjectType>
156- <supportedProjectType>bundle</supportedProjectType>
157- <supportedProjectType>pom</supportedProjectType>
158- </supportedProjectTypes>
159- </configuration>
160- </plugin>
161134 </plugins>
162135 </build>
163136