0
OSGI
번들을 생성하고 싶다. 나는 간단한 클래스를 createad : 아파치에서 OSGI 번들을 시작할 수 없다 ServiceMix
public class Activator implements BundleActivator {
public void start(BundleContext bundleContext) throws Exception {
System.out.println("::::START MAIL BUNDLE::::");
}
public void stop(BundleContext bundleContext) throws Exception {
System.out.println("::::STOP MAIL BUNDLE::::");
}
}
내
pom.xml
: 나는
Service Mix
을 사용
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>6.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<inherited>true</inherited>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<executions>
<execution>
<id>osgi-bundle</id>
<goals>
<goal>bundle</goal>
</goals>
<phase>package</phase>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Import-Package>
*;resolution:=optional
</Import-Package>
</instructions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
. 대상 폴더에 org.osgi.core-6.0.0.jar
과 jar를 추가합니다. 내 번들이 활성화되어 있지만 karaf
콘솔에 번들 시작/중지시 내 메시지가 표시되지 않습니다. 내가 도대체 뭘 잘못하고있는 겁니까?