Class MirrorMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.eclipse.tycho.plugins.p2.extras.MirrorMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="mirror") public class MirrorMojo extends org.apache.maven.plugin.AbstractMojoMaven plugin front-end for org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication. Intended as a replacement for the p2.mirror ant task.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanappendWhether to append to an existing destination repository.private booleancompressWhether to compress the destination repository metadata files (artifacts.xml, content.xml).private booleancurrentModuleAsSourceWhether the current build p2 output should be added as source.private java.io.FiledestinationThe destination directory to mirror to.private java.util.Map<java.lang.String,java.lang.String>filterFilter properties.private booleanfollowOnlyFilteredRequirementsFollow only requirements which match the filter specified.private booleanfollowStrictOnlySet to true if only strict dependencies should be followed.private booleanignoreErrorsIf set to true, mirroring continues to run in the event of an error during the mirroring process and will just log an info message.private booleanincludeFeaturesWhether or not to include features.private booleanincludeNonGreedyWhether or not to follow non-greedy requirements.private booleanincludeOptionalWhether or not to follow optional requirements.private booleanincludePackedWhether or not to include pack200 artifacts.private java.util.List<Iu>ius(Optional) Which IUs to mirror.private booleankeepNonXzIndexFilesIfxzCompressistrue, whether jar or xml index files should be kept in addition to XZ-compressed index files.private booleanlatestVersionOnlySet totrueto filter the resulting set of IUs to only include the latest version of each Installable Unit only.private booleanmirrorMetadataOnlyWhether to mirror metadata only (no artifacts).private java.lang.StringnameThe target repository name.private EquinoxServiceFactoryp2private org.apache.maven.project.MavenProjectprojectprivate java.util.Map<java.lang.String,TychoProject>projectTypesprivate RepositoryReferenceToolrepositoryReferenceToolprivate org.apache.maven.execution.MavenSessionsessionprivate java.util.List<Repository>sourceSource repositori(es) to mirror from.private booleantargetPlatformAsSourceWhether to add the target-platform content as a source.private booleanxzCompressAdd XZ-compressed repository index files.
-
Constructor Summary
Constructors Constructor Description MirrorMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.Collection<IUDescription>createIUDescriptions()private MirrorOptionscreateMirrorOptions()voidexecute()private BuildOutputDirectorygetBuildOutputDirectory()
-
-
-
Field Detail
-
project
@Parameter(property="project", readonly=true) private org.apache.maven.project.MavenProject project
-
session
@Parameter(property="session", readonly=true) private org.apache.maven.execution.MavenSession session
-
p2
@Component private EquinoxServiceFactory p2
-
repositoryReferenceTool
@Component private RepositoryReferenceTool repositoryReferenceTool
-
projectTypes
@Component(role=TychoProject.class) private java.util.Map<java.lang.String,TychoProject> projectTypes
-
source
@Parameter(required=false) private java.util.List<Repository> source
Source repositori(es) to mirror from.- See Also:
and
-
destination
@Parameter(defaultValue="${project.build.directory}/repository") private java.io.File destinationThe destination directory to mirror to.
-
name
@Parameter private java.lang.String name
The target repository name.
-
ius
@Parameter private java.util.List<Iu> ius
(Optional) Which IUs to mirror. If omitted, all IUs available in the source repositories will be mirrored. An IU must specify an id and may specify a version. If version is omitted, the latest available version will be queried. By default, IUs required by the specified IUs will also be mirrored. See alsofollowStrictOnly,followOnlyFilteredRequirements,includeOptional,includeNonGreedy,includeFeatures.
-
followStrictOnly
@Parameter(defaultValue="false") private boolean followStrictOnly
Set to true if only strict dependencies should be followed. A strict dependency is defined by a version range only including exactly one version (e.g. [1.0.0.v2009, 1.0.0.v2009]). In particular, plugins/features included in a feature are normally required via a strict dependency from the feature to the included plugin/feature.
-
includeFeatures
@Parameter(defaultValue="true") private boolean includeFeatures
Whether or not to include features.
-
includePacked
@Parameter(defaultValue="true") private boolean includePacked
Whether or not to include pack200 artifacts.
-
includeOptional
@Parameter(defaultValue="true") private boolean includeOptional
Whether or not to follow optional requirements.
-
includeNonGreedy
@Parameter(defaultValue="true") private boolean includeNonGreedy
Whether or not to follow non-greedy requirements.
-
filter
@Parameter private java.util.Map<java.lang.String,java.lang.String> filter
Filter properties. In particular, a platform filter can be specified by using keysosgi.os, osgi.ws, osgi.arch.
-
followOnlyFilteredRequirements
@Parameter(defaultValue="false") private boolean followOnlyFilteredRequirements
Follow only requirements which match the filter specified.
-
latestVersionOnly
@Parameter(defaultValue="false") private boolean latestVersionOnly
Set totrueto filter the resulting set of IUs to only include the latest version of each Installable Unit only. By default, all versions satisfying dependencies are included.
-
mirrorMetadataOnly
@Parameter(defaultValue="false") private boolean mirrorMetadataOnly
Whether to mirror metadata only (no artifacts).
-
compress
@Parameter(defaultValue="true") private boolean compress
Whether to compress the destination repository metadata files (artifacts.xml, content.xml).
-
append
@Parameter(defaultValue="true") private boolean append
Whether to append to an existing destination repository. Note that appending an IU which already exists in the destination repository will cause the mirror operation to fail.
-
xzCompress
@Parameter(defaultValue="true") private boolean xzCompress
Add XZ-compressed repository index files. XZ offers better compression ratios esp. for highly redundant file content.
- Since:
- 0.25.0
-
keepNonXzIndexFiles
@Parameter(defaultValue="true") private boolean keepNonXzIndexFiles
If
xzCompressistrue, whether jar or xml index files should be kept in addition to XZ-compressed index files. This fallback provides backwards compatibility for pre-Mars p2 clients which cannot read XZ-compressed index files.- Since:
- 0.25.0
-
targetPlatformAsSource
@Parameter(defaultValue="false") private boolean targetPlatformAsSource
Whether to add the target-platform content as a source. Ignored for non-Tycho packaging types.
- Since:
- 1.1.0
-
currentModuleAsSource
@Parameter(defaultValue="true") private boolean currentModuleAsSource
Whether the current build p2 output should be added as source. Ignored for non-Tycho packaging types. Ignored if
targetPlatformAsSource== false;- Since:
- 1.1.0
-
ignoreErrors
@Parameter(defaultValue="false") private boolean ignoreErrors
If set to true, mirroring continues to run in the event of an error during the mirroring process and will just log an info message.
- Since:
- 1.1.0
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
createMirrorOptions
private MirrorOptions createMirrorOptions()
-
createIUDescriptions
private java.util.Collection<IUDescription> createIUDescriptions()
-
getBuildOutputDirectory
private BuildOutputDirectory getBuildOutputDirectory()
-
-