当我在我的项目上运行命令“mvn package”时,资源文件像persistence.xml,persistence.xml.dev,persistence.xml.qa etc..from src/main /资源/ META-INF包装在捆绑中。我需要帮助才能使mvn-bundle-plugin查看目标文件夹而不是src文件夹,因为我的目标文件夹只有一个资源文件persistence.xml。我的pom mave-bundle-plugin低于src被用来代替绑定包的目标
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<id>bundle</id>
<phase>package</phase>
<goals>
<goal>bundle</goal>
</goals>
</execution>
</executions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Classpath>.</Bundle-Classpath>
<Meta-Persistence>META-INF/persistence.xml</Meta-Persistence>
<Embed-Dependency>
my-project-api
</Embed-Dependency>
<Export-Package></Export-Package>
<Import-Package>
javax.ws.rs;version="[2.0,3)",
javax.ws.rs.core;version="[2.0,3)",
*</Import-Package>
</instructions>
</configuration>
</plugin>
究竟是什么问题? persistence.xml文件不在打包的jar文件中? – 2014-11-22 07:49:32
@Balaza Zsoldos。问题在于构建插件使用项目src文件夹中的资源打包输出osgi bundle jar,而不是使用项目目标文件夹中的资源。 – auhuman 2014-11-24 00:26:27