Creating-your-own-wso2-carbon-components 웹 세미나에서는 탄소 구성 요소 및 해당 구성 요소의 기능을 설명합니다. 그것은 많은 기초와 모범 사례를 다루고 있습니다.
작성한 작성한 기능을 호스트하려면 해당 기능에서 p2 저장소를 생성해야합니다. p2-repo 개념은 WSO2 제품이 사용하는 밑줄 Eclipse equinox 프로젝트에서 비롯됩니다.
WSO2는 p2-repo 생성에 도움이되는 carbon-p2-plugin이라는 자체 메이븐 플러그인을 작성했습니다. 방법은 다음과 같습니다. 새 maven 프로젝트 (패키지 : pom)를 만든 다음 carbon-p2-plugin 플러그인 구성에서 게시 할 기능을 설정하기 만하면됩니다. 다음은 사용할 수있는 샘플 pom.xml입니다. 이 파일은 p2-repo generation pom.xml of carbon 4.1.0에서 복사했으며 간단하게했습니다.
이 pom 파일을 테스트 한 결과 저에게 효과적이었습니다. 샘플 기능 정의에는 두 가지가 있습니다. featureArtifactDef를 자신의 지형지 물 정의로 바꿉니다. 형식은 $ groupId : $ artifactId : $ version입니다.
maven을 통해 빌드하면 maven은 target/p2-repo 디렉토리를 만듭니다. 여기에는 artifacts.jar 및 content.jar를 포함한 전체 p2-repo가 들어있는 p2 저장소가 들어 있습니다. 이 폴더를 사용하여 기능을 설치하거나 어딘가에 호스트 할 수 있습니다. 호스팅에 대한 특별한 요구 사항은 없습니다.
<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">
<parent>
<groupId>org.wso2.carbon</groupId>
<artifactId>carbon-features</artifactId>
<version>4.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>mysample-feature-repository</artifactId>
<version>4.1.0</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Feature Repository</name>
<build>
<plugins>
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>carbon-p2-plugin</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<id>2-p2-repo-generation</id>
<phase>package</phase>
<goals>
<goal>p2-repo-gen</goal>
</goals>
<configuration>
<p2AgentLocation>${basedir}/target/p2-agent</p2AgentLocation>
<metadataRepository>file:${basedir}/target/p2-repo</metadataRepository>
<artifactRepository>file:${basedir}/target/p2-repo</artifactRepository>
<publishArtifacts>true</publishArtifacts>
<publishArtifactRepository>true</publishArtifactRepository>
<featureArtifacts>
<!-- change the featureArtifactDef to match your needs -->
<featureArtifactDef>
org.wso2.carbon:org.wso2.carbon.service.mgt.feature:4.1.0
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon:org.wso2.carbon.registry.core.feature:4.1.0
</featureArtifactDef>
</featureArtifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>