killme2008 / xmemcached

High performance, easy to use multithreaded memcached client in java.
http://fnil.net/xmemcached
Apache License 2.0
757 stars 280 forks source link

osgi bundle support #114

Open github-edu opened 4 years ago

github-edu commented 4 years ago

OSGI Bundle Support

xmemcached!/META-INF/MANIFEST.MF

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

github-edu commented 4 years ago
<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>
killme2008 commented 4 years ago

Please create a PR.Thanks.

github-edu commented 4 years ago

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 commented 4 years ago
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 commented 4 years ago

image