xmemcached icon indicating copy to clipboard operation
xmemcached copied to clipboard

osgi bundle support

Open github-edu opened this issue 4 years ago • 5 comments

OSGI Bundle Support

xmemcached!/META-INF/MANIFEST.MF

提个需求,请修改打包配置,使客户端JAR支持OSGI Bundle

github-edu avatar Apr 27 '20 01:04 github-edu

<plugin>
			  <artifactId>maven-jar-plugin</artifactId>
			  <version>2.6</version>
			  <configuration>
			    <archive>  
			      <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
			    </archive> 
			  </configuration>
			</plugin> 
<!--
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>1.5</version>
				<executions>
					<execution>
						<id>sign-artifacts</id>
						<phase>verify</phase>
						<goals>
							<goal>sign</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
-->
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<version>3.5.1</version>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<Export-Package>net.rubyeye.xmemcached,!net.rubyeye.xmemcached.*</Export-Package>
						<Import-Package>javax.management,javax.management.remote,javax.security.auth.callback,javax.security.sasl,org.slf4j</Import-Package>
					</instructions>
				</configuration>
				<executions>
				    <execution>
				      <id>bundle-manifest</id>
				      <phase>process-classes</phase>
				      <goals>    
				        <goal>manifest</goal>
				      </goals>   
				    </execution>
				</executions>		
			</plugin>

github-edu avatar Apr 28 '20 07:04 github-edu

Please create a PR.Thanks.

killme2008 avatar Apr 29 '20 02:04 killme2008

Fat bundle

        <plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<version>3.5.1</version>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<Export-Package>net.rubyeye.xmemcached,!net.rubyeye.xmemcached.*</Export-Package>
						<Import-Package>javax.management,javax.management.remote,javax.security.auth.callback,javax.security.sasl</Import-Package>
					</instructions>
				</configuration>
				<executions>
				    <execution>
				      <id>bundle-manifest</id>
				      <phase>process-classes</phase>
				      <goals>    
				        <goal>manifest</goal>
				      </goals>   
				    </execution>
				</executions>		
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
					<archive>
						<!-- <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile> -->
						<!-- Use maven-bundle-plugin generated file -->
						<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
					</archive>
				</configuration>
				<executions>
					<execution>
						<id>make-assembly</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

github-edu avatar May 07 '20 03:05 github-edu

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven Bundle Plugin
Bnd-LastModified: 1588821369830
Build-Jdk: 1.8.0_202
Built-By: Anymous
Bundle-ManifestVersion: 2
Bundle-Name: xmemcached
Bundle-SymbolicName: com.googlecode.xmemcached.bundle
Bundle-Version: 2.4.6
Export-Package: net.rubyeye.xmemcached;version="2.4.6"
Import-Package: javax.management,javax.management.remote,javax.securit
 y.auth.callback,javax.security.sasl
Originally-Created-By: Apache Maven Bundle Plugin
Tool: Bnd-3.5.0.201709291849

github-edu avatar May 07 '20 06:05 github-edu

image

github-edu avatar May 07 '20 06:05 github-edu