Class AssemblyMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.karaf.tooling.utils.MojoSupport
-
- org.apache.karaf.tooling.AssemblyMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="assembly", defaultPhase=PACKAGE, requiresDependencyResolution=RUNTIME, threadSafe=true) public class AssemblyMojo extends MojoSupportCreates a customized Karaf distribution by installing features and setting up configuration files.The plugin gets features from feature.xml files and KAR archives declared as dependencies or as files configured with the [startup|boot|installed]Respositories parameters. It picks up other files, such as config files, from ${project.build.directory}/classes. Thus, a file in src/main/resources/etc will be copied by the resource plugin to ${project.build.directory}/classes/etc, and then added to the assembly by this goal.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,String>configSpecify a list of additional properties that should be added to${karaf.etc}/config.propertiesprotected intdefaultStartLevelDefault start level for bundles in features that don't specify it.protected FilefeaturesProcessingOptional location for custom features processing XML configuration (etc/org.apache.karaf.features.cfg)protected StringframeworkSpecify which framework to use (one of framework, framework-logback, static-framework, static-framework-logback, custom).protected booleanignoreDependencyFlagIgnore the dependency attribute (dependency="[true|false]") on bundles, effectively forcing their installation.protected booleanincludeBuildOutputDirectoryInclude project build output directory in the assembly.protected booleaninstallAllFeaturesByDefaultFor given stage (startup, boot, install) if there are no stage-specific features and profiles, all features from stage-specific repositories will be used.protected StringjavaseSpecify the version of Java SE to be assumed for osgi.ee.protected org.apache.karaf.profile.assembly.Builder.KarafVersionkarafVersionKaraf version changes the way some configuration files are prepared (to adjust to given Karaf version requirements).protected List<String>librariesAdditional libraries to add into assembled distribution.protected List<String>pidsToExtractGlob specifying which configuration PIDs in the selected boot features should be extracted to${karaf.etc}directory.protected StringpropertyFileEditsSpecify an XML file that instructs this goal to apply edits to one or more standard Karaf property files.protected org.eclipse.aether.repository.WorkspaceReaderreactorprotected FilesourceDirectoryBase directory used to overwrite resources in generated assembly after the build (resource directory).protected Map<String,String>systemSpecify a list of additional properties that should be added to${karaf.etc}/system.propertiesprotected Map<String,String>translatedUrlsSpecify a set of translated urls to use instead of downloading the artifacts from their original locations.protected booleanuseReferenceUrlsUsereference:file:gr/oup/Id/artifactId/version/artifactId-version-classifier.typestyle urls inetc/startup.properties.protected FileworkDirectoryBase directory used to copy the resources during the build (working directory).-
Fields inherited from class org.apache.karaf.tooling.utils.MojoSupport
artifactMetadataSource, artifactResolver, container, factory, localRepo, mavenSession, project, projectBuilder, projectHelper, remoteRepos
-
-
Constructor Summary
Constructors Constructor Description AssemblyMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute()Main processing method.voidexecute()-
Methods inherited from class org.apache.karaf.tooling.utils.MojoSupport
copy, createManagedVersionMap, getLocalRepoUrl, getProject, getProjectHelper, getWorkDirectory, resourceToArtifact, setMavenSession, translateFromMaven
-
-
-
-
Field Detail
-
sourceDirectory
@Parameter(defaultValue="${project.basedir}/src/main/resources/assembly") protected File sourceDirectoryBase directory used to overwrite resources in generated assembly after the build (resource directory).
-
workDirectory
@Parameter(defaultValue="${project.build.directory}/assembly") protected File workDirectoryBase directory used to copy the resources during the build (working directory).
-
featuresProcessing
@Parameter protected File featuresProcessing
Optional location for custom features processing XML configuration (etc/org.apache.karaf.features.cfg)
-
installAllFeaturesByDefault
@Parameter(defaultValue="true") protected boolean installAllFeaturesByDefault
For given stage (startup, boot, install) if there are no stage-specific features and profiles, all features from stage-specific repositories will be used.
-
defaultStartLevel
@Parameter protected int defaultStartLevel
Default start level for bundles in features that don't specify it.
-
ignoreDependencyFlag
@Parameter(defaultValue="false") protected boolean ignoreDependencyFlag
Ignore the dependency attribute (dependency="[true|false]") on bundles, effectively forcing their installation.
-
libraries
@Parameter protected List<String> libraries
Additional libraries to add into assembled distribution. Libraries are specified using
name[;url:=<url>][;type:=<type>][;export:=true|false][;delegate:=true|false]syntax. If there's nourlheader directive,nameis used as URI. Otherwisenameis used as target file name to use.typemay be:- endorsed - library will be added to
${karaf.home}/lib/endorsed - extension - library will be added to
${karaf.home}/lib/ext - boot - library will be added to
${karaf.home}/lib/boot - by default, library is put directly into
${karaf.home}/lib- these libraries will be used in default classloader for OSGi framework which will loadFrameworkFactoryimplementation.
exportflag determines whether packages fromExport-Packagemanifest header of the library will be added toorg.osgi.framework.system.packages.extraproperty in${karaf.etc}/config.properties.delegateflag determines whether packages fromExport-Pavkagemanifest header of the library will be added toorg.osgi.framework.bootdelegationproperty in${karaf.etc}/config.properties. - endorsed - library will be added to
-
useReferenceUrls
@Parameter(defaultValue="false") protected boolean useReferenceUrls
Usereference:file:gr/oup/Id/artifactId/version/artifactId-version-classifier.typestyle urls inetc/startup.properties.
-
includeBuildOutputDirectory
@Parameter(defaultValue="true") protected boolean includeBuildOutputDirectory
Include project build output directory in the assembly. This allows (filtered or unfiltered) Maven resources directories to be used to provide additional resources in the assembly.
-
karafVersion
@Parameter protected org.apache.karaf.profile.assembly.Builder.KarafVersion karafVersion
Karaf version changes the way some configuration files are prepared (to adjust to given Karaf version requirements).
-
javase
@Parameter(defaultValue="1.8") protected String javase
Specify the version of Java SE to be assumed for osgi.ee. The value will be used inetc/config.propertiesfile, injava.specification.versionplaceholder used in several properties:org.osgi.framework.system.packagesorg.osgi.framework.system.capabilities
Valid values are: 1.6, 1.7, 1.8, 9
-
framework
@Parameter protected String framework
Specify which framework to use (one of framework, framework-logback, static-framework, static-framework-logback, custom).
-
propertyFileEdits
@Parameter(defaultValue="${project.basedir}/src/main/karaf/assembly-property-edits.xml") protected String propertyFileEditsSpecify an XML file that instructs this goal to apply edits to one or more standard Karaf property files. The contents of this file are documented in detail on this page. This allows you to customize these files without making copies in your resources directories. Here's a simple example:<property-edits xmlns="http://karaf.apache.org/tools/property-edits/1.0.0"> <edits> <edit> <file>config.properties</file> <operation>put</operation> <key>karaf.framework</key> <value>equinox</value> </edit> <edit> <file>config.properties</file> <operation>extend</operation> <key>org.osgi.framework.system.capabilities</key> <value>my-magic-capability</value> </edit> <edit> <file>config.properties</file> <operation prepend='true'>extend</operation> <key>some-other-list</key> <value>my-value-goes-first</value> </edit> </edits> </property-edits>
-
pidsToExtract
@Parameter protected List<String> pidsToExtract
Glob specifying which configuration PIDs in the selected boot features should be extracted to${karaf.etc}directory. By default all PIDs are extracted.
-
translatedUrls
@Parameter protected Map<String,String> translatedUrls
Specify a set of translated urls to use instead of downloading the artifacts from their original locations. The given set will be extended with already built artifacts from the maven project.
-
config
@Parameter protected Map<String,String> config
Specify a list of additional properties that should be added to${karaf.etc}/config.properties
-
system
@Parameter protected Map<String,String> system
Specify a list of additional properties that should be added to${karaf.etc}/system.properties
-
reactor
@Component(role=org.eclipse.aether.repository.WorkspaceReader.class, hint="reactor") protected org.eclipse.aether.repository.WorkspaceReader reactor
-
-