我正在尝试使用maven-bundle-plugin创建一个包.该项目的pom.xml是:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.adobe.support.examples</groupId>
<artifactId>com.adobe.support.examples.osgi.service</artifactId>
<version>1.0.8</version>
<packaging>bundle</packaging>
<name>OSGi Service Example</name>
<url>http://blogs.adobe.com/kmossman</url>
<description>Adobe Developer Support OSGi Service Example</description>
<!--
Credit: This example is based on Moritz Havelock's http://in-the-sling.blogspot.com/
I suggest you use the most current versions of the plugin's.
Search the Central Repository for the most current versions http://search.maven.org/
Use the search strings below and update the appropriate versions
// Felix
g:"org.apache.felix" a:"org.apache.felix.framework"
g:"org.apache.felix" a:"maven-bundle-plugin"
g:"org.apache.felix" a:"maven-scr-plugin"
g:"org.apache.felix" a:"org.osgi.core"
// Maven
g:"org.apache.maven.plugins" a:"maven-compiler-plugin"
// Sling
g:"org.apache.sling" a:"maven-sling-plugin" …Run Code Online (Sandbox Code Playgroud) 谁能告诉我OSGI 中组件工厂和服务工厂之间的区别。我在谷歌搜索了很多,但找不到服务工厂和组件工厂之间区别的明确解释。
我正在尝试删除与模式匹配的行,并使用sed命令将整个行替换为另一行。文件内容:Sample.txt
Testfile=xxxx
Testfile3=uuuu
Testfile4=oooo
Testfile5=iiii
Testfile2=ikeii
Run Code Online (Sandbox Code Playgroud)
我正在使用sed命令删除包含Testfile3 = *的行,并替换为Testfile3 = linechanged
sed -i 's/Testfile3=\*/Testfile3=linechanged/' Sample.txt.
Run Code Online (Sandbox Code Playgroud)
但是它只是将可替换的字符串附加在行中,如下所示
Testfile3=linechanged=uuuu.
Run Code Online (Sandbox Code Playgroud)
我期望输出是
Testfile3=linechanged.
Run Code Online (Sandbox Code Playgroud)
我做错了什么?
我想在超类中初始化一些变量.
在OSGI中,有一个方法
activate()在服务/组件启动时调用.但是在activate方法之前调用构造函数.
哪一个(activate()方法或构造函数)在OSGI中初始化变量是有效的.
osgi ×3
java ×2
aem ×1
apache-felix ×1
apache-karaf ×1
bash ×1
linux ×1
maven-2 ×1
osgi-bundle ×1
sed ×1