Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ParameterDescriptionMandatoryExample
id

The Id of the feature being generated.

No<id>org.wso2.carbon.core.feature</id>
copyright

The copyright text that should be attached to the feature.xml file.

No<copyright>COPYRIGHT</copyright>
licenceUrl

The license URL that should be given in the feature.xml file.

No<licenseUrl>LICENSE_URL</licenseUrl>
licenceThe license that should be attached to the feature.xml file.No<license>LICENSE</license>
manifest

This points to the location of the manifest file. The content in this file is considered if the manifest is present when generating the feature.xml file. This manifest file is copied and its content will be updated as the feature.xml file.

No<manifest>LOCATION_OF_THE_MANIFEST_FILE</manifest>
propertyFile

This points to the location of the properties file. Properties of the property file (if exists) are merged with the properties passed to the Maven goal through the <properties> parameter explained below.

No

<propertyFile>PATH_FOR_THE_PROPERTY_FILE</propertyFile>


properties

A collection of key-value pairs passed to the Maven goal, which should be written to the feature.properties output file. 

Yes
Code Block
languagexml
<properties>
	<property>
		<name>name1</name
		<value>value1</value>
	</property>
	<property>
		<name>name2</name
		<value>value2</value>
	</property>
</properties>
adviceFile

Content to be written to the p2.inf output file are fed into the p2-feature-gen maven goal using this adviceFile property.

Yes
Code Block
languagexml
<adviceFile>
	<properties>
	<propertyDef>org.wso2.carbon.p2.category.type:console</properDef>
<properties>	
</advice>
bundles

Specifies the OSGI bundles that should be included in the feature being created. These bundles should be given as maven coordinates. The P2 plugin supports 3 variations as shown below:

Code Block
languagexml
<bundles>
 	<bundleDef>{groupId}:{artifactId}:{version}</bundleDef>
 	<bundleDef>{groupId}:{artifactId}:{version}:	{compatibility}</bundleDef>
 	<bundleDef>{groupId}:{artifactId}:{compatibility}:{version}</bundleDef>
</bundles>

If the 1st bundle format is used, the default value for compatibility, which is “equivalent” is used.

The following values are permitted for compatibility;

  • perfect

  • equivalent

  • compatible

  • greaterOrEqual

  • patch
No

 -

 

 

 includeFeatures

Carbon features that need to be included in the feature being built are specified using the includeFeatures property. These included features are copied to the final output ZIP file. Included features can be given in 4 different ways as shown below.

Code Block
languagexml
<includedFeatures>
 <featureDef>{groupId}:{artifactId}</featureDef>        
 <featureDef>{groupId}:{artifactId}:{version}</featureDef>
 <featureDef>{groupId}:{artifactId}:optional</featureDef>
 <featureDef>{groupId}:{artifactId}:{version}:optional</featureDef>
</includedFeature>

If the term “optional” is given as a featureDef, that feature is marked as optional.

No

 -

  importFeatures

The dependant features for the feature being built are included here. These import features are included in the feature.xml file, but are not copied to the final ZIP file. Import features can be given in 5 different ways as shown below.

Code Block
languagexml
<importFeatures>                              
<featureDef>{featureId}</featureDef>         
<featureDef>{featureId}:{compatibility}</featureDef> 
<featureDef>{featureId}:{compatibility}:{version}</featureDef>
<featureDef>{featureId}:{version}</featureDef> 
<featureDef>{featureId}:{version}:{compatible}</featureDef> 
</importFeatures>

By default, the compatibility is set to "equivalent". If compatibility is set to “optional” then this import feature is marked as “optional” and the compatibility is set to “equivalent”.

The following values are permitted for compatibility;

  • perfect

  • equivalent

  • compatible

  • greaterOrEqual

  • patch
No

 

 -

Anchor
P2-repo-gen
P2-repo-gen
Configuring the P2-repo-gen Maven goal

...

ParameterDescriptionMandatoryExample
name

The name of the newly created artifact repository. If you do not specify this, the artifact ID of the project is taken by default.

Yes<name>LOCATION_OF_THE_MANIFEST_FILE</name>
metadataRepository

The URL of the location where the metadata repository should be created.

 <metadataRepository>file:/home/p2-repo</metadataRepository>
artifactRepository

The URL of the location where the artifact repository should be created.

Important: For carbon, both artifacts and metadata reside in the same repository. Therefore, the value for both metadataRepository and artifactRepository should be the same.

 Yes

<artifactRepository>file:/home/p2-repo</artifactRepository>

featureArtifacts

The set of features that need to be included in the repository are passed to the p2-repo-gen maven goal through this parameter. Features can be provided in 2 different ways as shown below.

Code Block
<featureArtifacts>
   <featureArtifactDef>{groupId}:{artifactId}</featureArtifactDef>
   <featureArtifactDef>{groupId}:{artifactId}:{version}</featureArtifactDef>
<features>

If the version is not given, the plugin tries to extract the version from the project’s dependency list. The maven goal will search for the given artifact in the local .m2 repository. If it is not found there, the goal will search in the configured remote repositories. Not finding the artifact may cause the maven goal to terminate with a BUILD FAILURE.

Important: For the plugin to work properly, the artifact representing each feature is required to be specified as a maven dependency.

 Yes

 -

 

bundleArtifacts

The set of bundles that need to be included in the repository are passed to the p2-repo-gen maven goal through this parameter. Bundle artifacts can be provided in two ways as shown below.

Code Block
<bundleArtifacts>
       <bundleArtifactDef>{groupId}:{artifactId}</bundleArtifactDef>
       <bundleArtifactDef>{groupId}:{artifactId}:{version}</bundleArtifactDef>
 <bundleArtifacts>

If the version is not given, the maven goal will search for the given artifact in the local .m2 repository to resolve the version. If it is not found there, the goal will search in the the configured remote repositories. Not finding the artifact may cause the maven goal to terminate with a BUILD FAILURE. So for the plugin to work properly, the artifact representing each bundle needs to be specified as a maven dependency.

 Yes

 -

 

 archiveSpecifies whether the generated artifact should be archived or not. This is a boolean value. Thus, permitted values are either true or false. The default value is false. No <archive>false</archive>

...

ParameterDescriptionMandatoryExample
metadataRepositoryThe URL of the location where the metadata repository should be created. Yes<metadataRepository>file:/home/p2-repo</metadataRepository>
artifactRepository

The URL of the location where the artifact repository to be created.

Important: For carbon, both artifacts and metadata reside in the same repository. Therefore, the value for both metadataRepository and artifactRepository should be the same. 

 
Yes<artifactRepository>file:/home/p2-repo</artifactRepository>
targetPath

Points to the components folder of the Carbon product in which the profile is being created.

Yes<targetPath>file:${basedir}/target/wso2carbon-core-${carbon.kernel.version}/repository/components</targetPath>
profile

Name of the profile to be created.

Yes<profile>worker</profile>
productConfigurationLocation of the .product file.Yes<productConfigurationFile>${basedir}/carbon.product</productConfigurationFile>

...

ParameterDescriptionMandatoryExample
destination

Points to the <CARBON_HOME>/repository/components/ directory.

Yes

<destination>/home/Carbon/wso2carbon-4.4.0/repository/components</destination>

profile

The profile which needs to be updated with the new set of features in the destination.

Yes<profile>default</profile>
metadataRepositoryThe URL of the location where the metadata repository should be created. Yes<metadataRepository>file:/home/p2-repo</metadataRepository>
artifactRepository

The URL of the location where the artifact repository to be created.

Important: For carbon, both artifacts and metadata resides in the same repository. Therefore, the value for both metadataRepository and artifactRepository should be the same. 

 
Yes<artifactRepository>file:/home/p2-repo</artifactRepository>
features

The features to be installed in the destination profile. Features that you add here should already exist in the P2 repository to which the <repositoryURL> parameter of the plugin points.

 

Yes
Code Block
languagexml
<features>
<feature>
   <id>org.wso2.carbon.registry.contentsearch.feature.group</id>
   <version>4.4.0</version>
</feature>
<feature>
   <id>org.wso2.ciphertool.feature.group</id>
   <version>4.4.0</version>
</feature>
</features>
Info

Add the ID of the feature being installed for the <ID> property, and add the version of the feature being installed as the value of the <version> property.

deleteOldProfileFilesSpecifies whether to delete old *.profile folders located in the <CARBON_HOME>/repository/components/p2/org.eclipse.equinox.p2.engine/profileRegistry/ directory. The default value is set to true.No<deleteOldProfileFiles>true</deleteOldProfileFiles>