查看http://repo2.maven.org/maven2/org/apache/struts/struts2-core/2.1.6/上的当前 struts 包。
例如,如果您下载 struts2-core-2.1.6.jar,将其解压缩并查看 META-INF/MANIFEST.MF,您会发现它确实包含 OSGI 标头(Import-Package、Export-Package、Bundle- *):
C:\TMP\META-INF>more MANIFEST.MF
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: 1.5.0_10 (Sun Microsystems Inc.)
Built-By: musachyb
Build-Jdk: 1.5.0_10
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
Import-Package: com.opensymphony.xwork2;version="2.1",com.opensymphon
<SNIP>
Bnd-LastModified: 1231185746365
Export-Package: org.apache.struts2.views.xslt;uses:="javax.servlet.ht
Bundle-Version: 2.1.6
<SNIP>
Bundle-Description: Apache Struts 2
Bundle-Name: Struts 2 Core
Bundle-DocURL: http://www.apache.org
Bundle-ManifestVersion: 2
Bundle-Vendor: Apache Software Foundation
Bundle-SymbolicName: org.apache.struts.struts2-core
Tool: Bnd-0.0.255
不知道你如何在 OSGi 应用程序中使用它们——但理论上你至少可以引用它们并做“东西”!:)