那麼,只是不要使用bundlor呢?像文件中說,「Bundlor的主要功能是掃描現有的JAR文件,並確定其運行時依賴。」
例如,與Maven束-插件(在這個例子中,我有一個.war文件,但是這不應該的問題)
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
<!-- add the generated manifest to the war -->
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
<failOnMissingWebXml>true</failOnMissingWebXml>
<packagingExcludes>WEB-INF/web.xml</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
<configuration>
<supportedProjectTypes>
<supportedProjectType>jar</supportedProjectType>
<supportedProjectType>bundle</supportedProjectType>
<supportedProjectType>war</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-ClassPath>.,WEB-INF/classes,{maven-dependencies}</Bundle-ClassPath>
<Bundle-ManifestVersion>2</Bundle-ManifestVersion>
<Embed-Directory>WEB-INF/lib</Embed-Directory>
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Import-Package>
javax.annotation,
javax.servlet;version="[2.5,3.0]",
javax.servlet.http;version="[2.5,3.0]",
org.osgi.service.http,
org.osgi.service.packageadmin,
org.osgi.framework;version="[1.5,2.0)",
org.jboss.logging;version="[3.0,4.0)"
</Import-Package>
<Private-Package>fi.eis.applications</Private-Package>
<Web-ContextPath>/spring-app</Web-ContextPath>
</instructions>
</configuration>
</plugin>
我可能已經離開了Maven的捆綁,插件也不確定的,只是放在WEB-INF的清單文件。
來源
2012-12-28 07:16:46
eis
是的,你是對的,我實際上不需要bundlor,感到困惑,忘記了我只需要用我的MENIFEST.MF創建一個jar,所以只需要maven jar插件就足夠了。謝謝。 –