Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osgi bundle support #114

Open
github-edu opened this issue Apr 27, 2020 · 5 comments
Open

osgi bundle support #114

github-edu opened this issue Apr 27, 2020 · 5 comments

Comments

@github-edu
Copy link

OSGI Bundle Support

xmemcached!/META-INF/MANIFEST.MF

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

@github-edu
Copy link
Author

github-edu commented Apr 28, 2020

<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
Copy link
Owner

Please create a PR.Thanks.

@github-edu
Copy link
Author

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
Copy link
Author

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
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants