META-INF
META-INF\MANIFEST.MF
META-INF\maven
META-INF\maven\com.mycompany
META-INF\maven\com.mycompany\osgi-bundle-test
META-INF\maven\com.mycompany\osgi-bundle-test\pom.properties
META-INF\maven\com.mycompany\osgi-bundle-test\pom.xml
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.0.1</version>
<extensions>true</extensions>
<configuration>
<manifestLocation>META-INF</manifestLocation>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Export-Package>*</Export-Package>
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<Embed-Directory>target/dependency</Embed-Directory>
<Embed-StripGroup>true</Embed-StripGroup>
<Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
[INFO] --- maven-dependency-plugin:2.8:copy-dependencies (copy-dependencies) @ osgi-bundle-test ---
[INFO] Copying guava-18.0.jar to <local-dir>\target\dependency\guava-18.0.jar
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ osgi-bundle-test ---
[INFO] Building jar: <local-dir>\target\osgi-bundle-test-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ osgi-bundle-test ---
[INFO] Installing <local-dir>\target\osgi-bundle-test-0.0.1-SNAPSHOT.jar to <repo-dir>\com\mycompany\osgi-bundle-test\0.0.1-SNAPSHOT\osgi-bundle-test-0.0.1-SNAPSHOT.jar
[INFO] Installing <local-dir>\pom.xml to <repo-dir>\com\mycompany\osgi-bundle-test\0.0.1-SNAPSHOT\osgi-bundle-test-0.0.1-SNAPSHOT.pom
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Built-By: xxxx
Created-By: Apache Maven 3.3.9
Build-Jdk: 1.8.0_65
请帮忙。
这起作用了:
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>osgi-bundle-test-v2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.0.1</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Export-Package>*</Export-Package>
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<Embed-Directory>target/dependency</Embed-Directory>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
结果包包含target\dependency\guava-18.0.jar
舱单:
Manifest-Version: 1.0
Bnd-LastModified: 1460052892382
Build-Jdk: 1.7.0_79
Built-By: myId
Bundle-ClassPath: .,target/dependency/guava-18.0.jar
Bundle-ManifestVersion: 2
Bundle-Name: osgi-bundle-test-v2
Bundle-SymbolicName: osgi-bundle-test-v2
Bundle-Version: 0.0.1.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Embed-Dependency: *;scope=compile|runtime
Embed-Directory: target/dependency
Embedded-Artifacts: target/dependency/guava-18.0.jar;g="com.google.guava
";a="guava";v="18.0"
Export-Package: com.google.common.annotations;version="18.0.0",com.googl
e.common.base;version="18.0.0";uses:="javax.annotation",com.google.comm
on.base.internal;version="0.0.1.SNAPSHOT",com.google.common.cache;versi
on="18.0.0";uses:="com.google.common.base,com.google.common.collect,com
.google.common.util.concurrent,javax.annotation",com.google.common.coll
ect;version="18.0.0";uses:="com.google.common.base,javax.annotation",co
m.google.common.escape;version="18.0.0";uses:="com.google.common.base,j
avax.annotation",com.google.common.eventbus;version="18.0.0",com.google
.common.hash;version="18.0.0";uses:="com.google.common.base,javax.annot
ation",com.google.common.html;version="18.0.0";uses:="com.google.common
.escape",com.google.common.io;version="18.0.0";uses:="com.google.common
.base,com.google.common.collect,com.google.common.hash,javax.annotation
",com.google.common.math;version="18.0.0",com.google.common.net;version
="18.0.0";uses:="com.google.common.base,com.google.common.collect,com.g
oogle.common.escape,javax.annotation",com.google.common.primitives;vers
ion="18.0.0";uses:="com.google.common.base,javax.annotation",com.google
.common.reflect;version="18.0.0";uses:="com.google.common.collect,javax
.annotation",com.google.common.util.concurrent;version="18.0.0";uses:="
com.google.common.base,com.google.common.collect,javax.annotation",com.
google.common.xml;version="18.0.0";uses:="com.google.common.escape",com
.google.thirdparty.publicsuffix;version="0.0.1.SNAPSHOT";uses:="com.goo
gle.common.collect",target.dependency;version="0.0.1.SNAPSHOT"
Import-Package: com.google.common.base;version="[18.0,19)",com.google.co
mmon.cache;version="[18.0,19)",com.google.common.collect;version="[18.0
,19)",com.google.common.escape;version="[18.0,19)",com.google.common.ha
sh;version="[18.0,19)",com.google.common.io;version="[18.0,19)",com.goo
gle.common.math;version="[18.0,19)",com.google.common.primitives;versio
n="[18.0,19)",com.google.common.reflect;version="[18.0,19)",com.google.
common.util.concurrent;version="[18.0,19)",com.google.thirdparty.public
suffix;version="[0.0,1)",javax.annotation,sun.misc
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.6))"
Tool: Bnd-3.0.0.201509101326
是否有任何surefire或TeamCity选项来配置运行时JRE? 这是我当前的可靠配置:
我正在使用maven-shade-plugin在构建的包阶段重新定位一些包。我还使用maven-bundle-plugin生成一个清单。问题是bundle插件在shade插件之前运行(在过程类阶段),并且在生成的清单的导出中没有包含任何我的shade包。 -- 根据要求,我的POM的阴影和捆绑部分: 从这里取的
但是只有带有编译类的jar包含在zip中。为什么它不包括使用maven-sources-plugin构建的sources jar?
我正在开发一个大的应用程序,我们在代理中使用Mavem bundle插件,使其变小!我在导入一些需要的库以处理PDFbox所需的某种图像(jpeg2000和jbig2)时遇到问题。 这是我的pom(一部分) 我修复了导入包,我不再有警告了! 这是我的nethod,pdfBox使用这些库,我在try/catch块中遇到了一个异常! } 在IntelliJ中调试时,我得到了这个! 组织。阿帕奇。pdf
我想生成一个包含其依赖项的jar文件。下面是我的pom.xml: