Elffuss BraidHub

kikocis/java-driver public

Fix packages in shaded JAR's OSGI manifest (JAVA-620).
Changeset7eb9c897460081b99861496927c07e71c6d0c97e471ada0d935f527753fa53a7
Authorolim7t <omichallat+github@gmail.com> · 2015-02-20 21:48 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2015-03-02 10:53 -08:00
Parents58ff038658ac

Browse the files at this changeset

2 files changed

modified driver-core/pom.xml +32 −10
@@ -126,21 +126,16 @@
126126 <artifactId>maven-bundle-plugin</artifactId>
127127 <extensions>true</extensions>
128128 <version>2.4.0</version>
129- <executions>
130- <execution>
131- <id>bundle-manifest</id>
132- <phase>process-classes</phase>
133- <goals>
134- <goal>manifest</goal>
135- </goals>
136- </execution>
137- </executions>
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+ -->
138133 <configuration>
139134 <instructions>
140135 <Bundle-SymbolicName>com.datastax.driver.core</Bundle-SymbolicName>
141136 <Bundle-Version>${project.version}</Bundle-Version>
142137 <_include>-osgi.bnd</_include>
143- <Import-Package><![CDATA[com.google.common.*;version="[14.0,19)",*]]></Import-Package>
138+ <Import-Package><![CDATA[com.google.common*;version="[14.0,19)",*]]></Import-Package>
144139 </instructions>
145140 <supportedProjectTypes>
146141 <supportedProjectType>jar</supportedProjectType>
@@ -148,6 +143,23 @@
148143 <supportedProjectType>pom</supportedProjectType>
149144 </supportedProjectTypes>
150145 </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>
151163 </plugin>
152164 <plugin>
153165 <artifactId>maven-shade-plugin</artifactId>
@@ -169,6 +181,16 @@
169181 <shadedPattern>com.datastax.shaded.netty</shadedPattern>
170182 </relocation>
171183 </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>
172194 </configuration>
173195 </execution>
174196 </executions>
modified driver-dse/pom.xml +0 −9
@@ -41,15 +41,6 @@
4141 <artifactId>maven-bundle-plugin</artifactId>
4242 <extensions>true</extensions>
4343 <version>2.4.0</version>
44- <executions>
45- <execution>
46- <id>bundle-manifest</id>
47- <phase>process-classes</phase>
48- <goals>
49- <goal>manifest</goal>
50- </goals>
51- </execution>
52- </executions>
5344 <configuration>
5445 <instructions>
5546 <Bundle-SymbolicName>com.datastax.driver.dse</Bundle-SymbolicName>