Resources Plugin (quokka.plugin.resources:0.3, namespace=resources)

The Resources plugin copies resources for inclusion into artifacts, optionally replacing tokens when copying.

Minor Targets

process-resources Copies resources, optionally filtering using token substitution. Implements quokka.plugin.lifecycle:process-resources
process-test-resources Copies test resources, optionally filtering using token substitution. Implements quokka.plugin.lifecycle:process-test-resources

Template Targets

process A template for copying resources
process-test A template for copying test resources
extract Extracts resources from an artifact

Shared Default Properties

q.resources.ignoredTokens[idea.launcher.port]

process-resources

Copies resources, optionally filtering using token substitution

  • prefix: q.resources.main
  • template-name: process
  • Implements: quokka.plugin.lifecycle:process-resources

Notes:

  • Copying of resources is forced if the value of any token is changed. Tokens may include quokka properties (includes system properties) and any properties defined in filters. Tokens can be ignored by using the ignoredTokensPrefix and defining a map of tokens to ignore with the prefix specified.
  • To use token substitution, use the token name surrounded by '@' characters in your resources. e.g. @myfile@ will get replaced with the value of the myfile token if it is defined.
  • Special token suffixes can be used that normalise, or escape the value of a property. e.g. you could use @myfile--norm@ to substitute a normalised version of a path. Suffixes are:
    • --norm: Normalises a path, fixing path and directory separators for the current platform
    • --esc: Escapes a string for use inside a properties file. e.g. C:\Temp becomes C:\\Temp
    • --norm,esc: Performs both of the above operations.
Available Properties

All properties are optional unless stated otherwise

includeGeneratedResources If true (the default), copies any generated resources as well
output Mandatory. The directory to copy the resources to.
filtered A map of filesets that contain resources that will be processed with filtering (token substitution)
unfiltered A map of filesets that contain resources that will be processed without filtering (token substitution)
unfiltered A map of filesets that contain resources that will be processed without filtering (token substitution)
filters A map of filesets that contain filters. The filters should be property files containing name/value pairs of tokens.
ignoredTokensPrefix The property prefix for tokens to ignore. Defaults to q.resources.
addPropertiesAsTokens If true (the default), quokka properties (includes system properties) are added as tokens for filtering.

Default Properties

filtered[default]set.dir ${q.project.sourceDir}/main/resources/filtered
filters[default]set.dir ${q.project.sourceDir}/main/filters
includeGeneratedResources true
output ${q.lifecycle.resourcesOutput}
unfiltered[default]set.dir ${q.project.sourceDir}/main/resources
unfiltered[default]set.excludes filtered/

process-test-resources

Copies test resources, optionally filtering using token substitution

  • prefix: q.resources.test
  • template-name: process-test
  • Implements: quokka.plugin.lifecycle:process-test-resources

Process test resources supports the same properties as process-resources.

Default Properties

filtered[default]set.dir ${q.project.sourceDir}/test/resources/filtered
filters[default]set.dir ${q.project.sourceDir}/test/filters
filters[main-default]set.dir ${q.project.sourceDir}/main/filters
includeGeneratedResources true
output ${q.lifecycle.testResourcesOutput}
unfiltered[default]set.dir ${q.project.sourceDir}/test/resources
unfiltered[default]set.excludes filtered/

process

A template for copying resources

  • template: true

process-test

A template for copying test resources

  • template: true

extract

Extracts resources from an artifact

  • template: true

Extract copies resources from within another artifact.

Available Properties
artifactPath A quokka file set. Note: the dir sub refers to the root directory to extract from within the artifact.
resources A quokka file set. Note: the dir sub refers to the root directory to extract from within the artifact.

Default Properties

resources.set.dir

Plugin Paths

runtime : Runtime class path

quokka.core.metadata metadata 0.3

quokka.core.plugin-spi plugin-spi 0.3

quokka.core.util util 0.3

quokka.plugin.lifecycle lifecycle 0.3

quokka.core.plugin-spi plugin-spi 0.3

apache.ant ant 1.7.1

quokka.core.bootstrap-util bootstrap-util 0.3

quokka.core.repo-spi repo-spi 0.3

quokka.core.bootstrap-util bootstrap-util 0.3

apache.ant ant 1.7.1