Hi,
I am using karaf 3.0.0 to develop osgi application. Recently I encounted a
problem.
1)compute bundle provide simple compute methods. such as add. The bundle export
interface packages, and did not export interface impl package.
2)simple war bundle is a web project. It depends on compute bundle.
I used maven and obr to manage the deployment. I faced a problem like this:
when I changed one impl class,
public long add(int a, int b) {
// TODO Auto-generated method stub
return a + b;
}
I changed this method to
public long add(int a, int b) {
// TODO Auto-generated method stub
return a + 2*b;
}
after execute mvn install, the compute bundle is updated in maven repository.
And I execute "update ${computebundleId}", the modified bundle didn't take
effect.
simple war bundle pom configuration like this
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.4.0</version>
<extensions>true</extensions>
<configuration>
<supportedProjectTypes>
<supportedProjectType>jar</supportedProjectType>
<supportedProjectType>bundle</supportedProjectType>
<supportedProjectType>war</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Import-Package>
org.springframework.web.context,
org.springframework.osgi.web.context.support,
com.sun.jersey.spi.spring.container.servlet,
*;
resolution:=optional
</Import-Package>
<Export-Package>com.hoo.unad.sample.*,!*</Export-Package>
<Bundle-Classpath>
WEB-INF/classes
</Bundle-Classpath>
<Web-ContextPath>sample</Web-ContextPath>
<Embed-Dependency>*; artifactId=!org.osgi.compendium;
scope=compile; type=!pom;
inline=true</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<_removeheaders>
Include-Resource,
Private-Package,
Embed-Dependency,
Embed-Transitive,
Ignore-Package
</_removeheaders>
<Include-Resource>src/main/resources</Include-Resource>
</instructions>
</configuration>
<executions>
<execution>
<id>generate-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
<execution>
<id>index</id>
<goals>
<goal>index</goal>
</goals>
<phase>verify</phase>
<configuration>
<obrRepository>/home/sun/Repository/repository.xml</obrRepository>
<urlTemplate>maven</urlTemplate>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
please give a help, Thanks very much.