我现在尝试了很多不同的东西,但似乎都没有达到预期效果.
我想与我的库共享一个示例配置(或图像或其他)文件,有人可以使用和派生.我试图默认只是为了这样做我试图将它包含在nuget包中的via *.nuspec和via *.csproj.这些都没有奏效.
对于这*.nuspec部分,我试过这个:
<file src="bin\$configuration$\example.mylib.config" target="lib\net45" />
<file src="bin\$configuration$\example.mylib.config" target="build" />
<file src="bin\$configuration$\example.mylib.config" target="bin" />
Run Code Online (Sandbox Code Playgroud)
我也尝试了这个,但是只将文件复制到其他项目源,这不是我想要的.我希望它只显示在构建的输出中.
<file src="bin\$configuration$\example.mylib.config" target="content" />
Run Code Online (Sandbox Code Playgroud)
对于*.csproj部分,我试图设置build action该文件的content,resource,embedded resource和None.
有办法吗?有没有办法告诉nuget,采取这个文件,并表现得像我提供的DLL需要它的一面,无论你在哪里建立?
我已经在 teamcity 中为我的项目配置了命令行参数,并且对构建日志中的警告感到厌烦:
MSBuild command line parameters contain "/property:" or "/p:". It is recommended to define System Property on Build Parameters instead.
Run Code Online (Sandbox Code Playgroud)
现在我已经尝试从我的项目周围手动输入的属性转移到Build Parameters模板中。但是无论我尝试什么,它都没有告诉我我在那里为配置设置了什么,甚至根本没有使用它。
如何将类似的东西正确映射/p:Configuration=StagingDeploy到构建参数,它应该是什么类型?
我已经开始为apache felix开发一个包,并使用ops4j pax插件.
我创建了项目结构,pax-create-project并且在那里做了正常的pax-create-bundle.然后你得到了用maven构建整个事物的初始项目结构.这里的重要部分是,你的bundle拥有它自己的pom(bundlename/pom.xml)和bnd文件(bundlename/osgi.bnd),但是maven-bundle-plugin已经提供了配置poms/compiled/pom.xml.捆绑元数据在下配置,poms/compiled/pom.xml但标准激活器在上述osgi.bnd文件下配置.bnd文件中的默认值是Bundle-Activator: ${bundle.namespace}.internal.ExampleActivator.
现在我想开始使用注释,org.apache.felix.scr所以我把它包含在捆绑包自己的pom下依赖:
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr</artifactId>
<version>1.6.0</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我创建了我的服务接口:
package namespace;
public interface Sample {
void sayHello();
}
Run Code Online (Sandbox Code Playgroud)
以及来自org.apache.felix.scr以下注释的实现:
package namespace.internal;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate;
import namespace.Sample;
@Component
@Service
public class SampleImpl implements Sample{
@Activate
void start(){
System.out.println("Started SampleImpl.");
}
@Deactivate
void stop(){
System.out.println("Stopped SampleImpl.");
}
@Override
public void sayHello() {
System.out.println("Hello!");
} …Run Code Online (Sandbox Code Playgroud)