resource-list:list-resources
Full name:
com.github.robtimus:resource-list-maven-plugin:1.0:list-resources
Description:
Creates a list of resources in the current project.
Attributes:
- Requires a Maven project to be executed.
- The goal is thread-safe and supports parallel builds.
- Binds by default to the lifecycle phase:
process-resources
.
Required Parameters
Name | Type | Since | Description |
---|---|---|---|
<resourceBaseDir> |
File |
1.0 |
The resource base directory. Default value is: ${project.build.outputDirectory} . |
<resourceListFile> |
File |
1.0 |
The file to store the resource list in. Default value is: ${project.build.outputDirectory}/META-INF/${project.artifactId}.resources . |
Optional Parameters
Name | Type | Since | Description |
---|---|---|---|
<addDefaultExcludes> |
boolean |
1.0 |
Whether to add some default exclude patterns. Set this parameter to false to not add the following exclude patterns:
Default value is: true . |
<excludes> |
String[] |
1.0 |
The patterns that define which resources to exclude. |
<includes> |
String[] |
1.0 |
The patterns that define which resources to include. |
<resourceListClass> |
ResourceListClass |
1.0 |
If given a class will be generated that can be used to access the resource list. This class will have two static methods:
This class will also have three non-static methods:
The following nested properties can be set:
It's an error to specify the resource list class in combination with a resource list file that is not located in the project build's output directory (usually |
Parameter Details
<addDefaultExcludes>
Whether to add some default exclude patterns. Set this parameter to
false
to not add the following exclude patterns:
META-INF/MANIFEST.MF
META-INF/LICENSE.*
META-INF/services/**
META-INF/maven/**
META-INF/m2e/**
- Type:
boolean
- Since:
1.0
- Required:
No
- Default:
true
<excludes>
The patterns that define which resources to exclude.
- Type:
java.lang.String[]
- Since:
1.0
- Required:
No
<includes>
The patterns that define which resources to include.
- Type:
java.lang.String[]
- Since:
1.0
- Required:
No
<resourceBaseDir>
The resource base directory.
- Type:
java.io.File
- Since:
1.0
- Required:
Yes
- Default:
${project.build.outputDirectory}
<resourceListClass>
If given a class will be generated that can be used to access the resource list. This class will have two static methods:
absolute()
will return an instance of the class that returns absolute paths to the resources. These paths can be used with methods like `Class.getResource`.relative()
will return an instance of the class that returns paths to the resources relative to the root folder. These paths can be used with methods like `ClassLoader.getResource`.
This class will also have three non-static methods:
Stream<String> stream()
will return a stream over the resources. This stream should be closed after use.List<String> list()
will return a list containing the resources.void forEach(Consumer<? super String> action)
will run an action for each resource.
The following nested properties can be set:
className
(required): the fully qualified class name of the accessor class.publicVisibility
:true
if classes and methods should have public visibility, orfalse
(default) if they should be package private.outputDirectory
: the output directory where the resource list accessor class will be written to, without the package structure. This directory will be added as a project source root. Defaults to${project.build.outputDirectory}/generated-sources/resource-lists
.
It's an error to specify the resource list class in combination with a resource list file that is not located in the project build's output directory (usually target/classes
).
- Type:
com.github.robtimus.maven.plugins.resourcelist.ResourceListClass
- Since:
1.0
- Required:
No
<resourceListFile>
The file to store the resource list in.
- Type:
java.io.File
- Since:
1.0
- Required:
Yes
- Default:
${project.build.outputDirectory}/META-INF/${project.artifactId}.resources