XWiki Contrib - Managed Dependencies Maven Plugin
A plugin that allows to inject managed dependencies from a given set of sources. |
Type | JAR |
Category | Other |
Developed by | |
Rating | |
License | GNU Lesser General Public License 2.1 |
Description
A plugin that allows to inject managed dependencies from a given set of sources.
This plugin will collect dependencies from a given set of artifacts, filter these dependencies based on their group ID and include them as managed dependencies of the project.
The plugin comes with sensible defaults to make it usable as part of the development of XWiki Contrib extensions.
Usage
To use the plugin in its default configuration, add the following in the build section of your project parent POM :
<plugins>
<plugin>
<groupId>org.xwiki.contrib</groupId>
<artifactId>managed-dependencies-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<goals>
<goal>inject-managed-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- The configuration of the enforcer plugin will be inherited from parent POMs, but we need to refer
to this plugin here in order to make sure that the inject-managed-dependencies mojo is executed before
the enforcer -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
</plugin>
</plugins>
</build>
By default, this configuration will :
- Resolve the dependencies of the two following artifacts :
- org.xwiki.platform:xwiki-platform-distribution-war-dependencies/${platform.version}
- org.xwiki.platform:xwiki-platform-distribution-flavor-common/${platform.version}
- From the dependencies of these artifacts, add each dependency who have a group ID corresponding to one in the following list to the project managed dependencies :
- org.xwiki.platform
- org.xwiki.rendering
- org.xwiki.commons
Configuration
The plugin provides the following configuration options :
Name | Since | Description | Mandatory | Default value |
---|---|---|---|---|
managedDependencySources | 1.0 | A list of group IDs that should be used to retain artifacts that will be added as managed dependencies. Example usage : <managedDependencySources> <managedDependencySource> <groupId>org.xwiki.platform</groupId> <artifactId>xwiki-platform-distribution-war-dependencies</artifactId> <version>${platform.version}</version> <type>pom</type> </managedDependencySource> <managedDependencySource> <groupId>org.xwiki.platform</groupId> <artifactId>xwiki-platform-distribution-flavor-common</artifactId> <version>${platform.version}</version> <type>pom</type> </managedDependencySource> </managedDependencySources> | No |
|
xwikiPlatformVersion | 1.0 | The version of XWiki platform to use when using the default managed dependency sources | No | ${platform.version} |
useXWikiWARDependencies | 1.0 | Whether the artifact org.xwiki.platform:xwiki-platform-distribution-war-dependencies should be used as a managed dependency source (only used when no managed dependency sources is defined in the configuration) | No | true |
useXWikiStandardFlavorDependencies | 1.0 | Whether the artifact org.xwiki.platform:xwiki-platform-distribution-flavor-common should be used as a managed dependency source (only used when no managed dependency sources is defined in the configuration) | No | true |
dependencyGroupIDFilters | 1.0 | A list of group IDs that should be used to retain artifacts that will be added as managed dependencies. Example usage : <dependencyGroupIDFilters> <dependencyGroupIDFilter>org.xwiki.platform</dependencyGroupIDFilter> <dependencyGroupIDFilter>org.xwiki.rendering</dependencyGroupIDFilter> <dependencyGroupIDFilter>org.xwiki.commons</dependencyGroupIDFilter> </dependencyGroupIDFilters> | No |
|
FAQ
How to check the dependency tree?
Having the managed dependencies setup done by a plugin and not directly in the pom will have an impact over the computation of the dependency tree by the maven dependency plugin. Sometimes you may need to see the dependency tree of your module including all the dependencies managed by this plugin.
For this, you can use the following maven command:
Dependencies
Dependencies for this extension (org.xwiki.contrib:managed-dependencies-maven-plugin 1.0):
- org.apache.maven.shared:maven-artifact-transfer 0.13.1