Package org.xwiki.tool.extension.util
Class ExtensionMojoHelper
- java.lang.Object
-
- org.xwiki.tool.extension.util.ExtensionMojoHelper
-
- All Implemented Interfaces:
AutoCloseable
@Component(roles=ExtensionMojoHelper.class) @Singleton public class ExtensionMojoHelper extends Object implements AutoCloseable
-
-
Constructor Summary
Constructors Constructor Description ExtensionMojoHelper()
Public for technical reason,create(MavenProject, File)
should be used instead.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Set<org.apache.maven.artifact.Artifact>
collectMavenArtifacts(List<ExtensionArtifact> input)
static ExtensionMojoHelper
create(org.apache.maven.project.MavenProject project, File permanentDirectory)
org.xwiki.extension.job.plan.ExtensionPlan
createInstallPlan(org.xwiki.extension.maven.ArtifactModel model)
void
disableComponents(List<ComponentRepresentation> componentList)
Allow to unregister the components given in the list.org.xwiki.component.manager.ComponentManager
getComponentManager()
org.xwiki.extension.Extension
getExtension(org.apache.maven.artifact.Artifact artifact)
org.xwiki.tool.extension.internal.ExtensionMojoCoreExtensionRepository
getExtensionMojoCoreExtensionRepository()
org.xwiki.extension.repository.InstalledExtensionRepository
getInstalledExtensionRepository()
org.xwiki.extension.repository.LocalExtensionRepository
getLocalExtensionRepository()
org.xwiki.tool.extension.internal.MavenBuildConfigurationSource
getMavenBuildConfigurationSource()
org.apache.maven.project.MavenProject
getMavenProject(org.apache.maven.artifact.Artifact artifact)
File
getPermanentDirectory()
void
initalize(org.apache.maven.execution.MavenSession session, org.apache.maven.artifact.repository.ArtifactRepository localRepository, org.codehaus.plexus.PlexusContainer plexusContainer)
org.xwiki.job.Job
install(Collection<ExtensionArtifact> artifacts, String namespace, Map<String,Object> properties)
org.xwiki.job.Job
install(Collection<ExtensionArtifact> artifacts, org.xwiki.extension.job.InstallRequest installRequest, String namespace, Map<String,Object> properties)
org.xwiki.job.Job
install(org.apache.maven.artifact.Artifact artifact, String namespace, Map<String,Object> properties)
org.xwiki.job.Job
install(org.xwiki.extension.job.InstallRequest installRequest, String namespace, Map<String,Object> properties)
void
override(org.xwiki.extension.MutableExtension extension)
org.xwiki.extension.InstalledExtension
registerInstalledExtension(org.apache.maven.artifact.Artifact artifact, String namespace, boolean dependency, Map<String,Object> properties)
org.xwiki.extension.job.plan.ExtensionPlan
resolveDependencies(org.apache.maven.project.MavenProject project)
List<org.xwiki.extension.job.plan.ExtensionPlan>
resolveDependencies(org.apache.maven.project.MavenProject project, boolean isolate)
void
serializeExtension(File path, org.apache.maven.artifact.Artifact artifact)
void
serializeExtension(File path, org.apache.maven.artifact.Artifact artifact, org.apache.maven.model.Model model)
void
serializeExtension(File path, org.xwiki.extension.maven.ArtifactModel artifactModel)
void
serializeExtension(org.apache.maven.artifact.Artifact artifact, File directory)
void
serializeExtensions(Collection<org.apache.maven.artifact.Artifact> artifacts, File directory, String type)
void
setExtensionOverrides(List<ExtensionOverride> extensionOverrides)
org.xwiki.extension.LocalExtension
storeExtension(org.apache.maven.artifact.Artifact artifact)
org.xwiki.extension.LocalExtension
storeExtension(org.xwiki.extension.Extension extension)
void
storeExtensionDependencies()
void
storeExtensionDependencies(boolean isolate)
org.xwiki.extension.maven.ArtifactModel
toArtifactModel(org.apache.maven.artifact.Artifact artifact, org.apache.maven.model.Model model)
org.xwiki.extension.Extension
toExtension(org.xwiki.extension.maven.ArtifactModel model)
-
-
-
Constructor Detail
-
ExtensionMojoHelper
public ExtensionMojoHelper()
Public for technical reason,create(MavenProject, File)
should be used instead.
-
-
Method Detail
-
create
public static ExtensionMojoHelper create(org.apache.maven.project.MavenProject project, File permanentDirectory) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
disableComponents
public void disableComponents(List<ComponentRepresentation> componentList) throws org.apache.maven.plugin.MojoExecutionException
Allow to unregister the components given in the list.- Parameters:
componentList
- the list of components to unregister.- Throws:
org.apache.maven.plugin.MojoExecutionException
- in case of error when deserializing the component types.- Since:
- 12.2
-
initalize
public void initalize(org.apache.maven.execution.MavenSession session, org.apache.maven.artifact.repository.ArtifactRepository localRepository, org.codehaus.plexus.PlexusContainer plexusContainer) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
setExtensionOverrides
public void setExtensionOverrides(List<ExtensionOverride> extensionOverrides)
-
getComponentManager
public org.xwiki.component.manager.ComponentManager getComponentManager()
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
getPermanentDirectory
public File getPermanentDirectory()
-
getLocalExtensionRepository
public org.xwiki.extension.repository.LocalExtensionRepository getLocalExtensionRepository() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getInstalledExtensionRepository
public org.xwiki.extension.repository.InstalledExtensionRepository getInstalledExtensionRepository() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getExtensionMojoCoreExtensionRepository
public org.xwiki.tool.extension.internal.ExtensionMojoCoreExtensionRepository getExtensionMojoCoreExtensionRepository()
-
getMavenProject
public org.apache.maven.project.MavenProject getMavenProject(org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getExtension
public org.xwiki.extension.Extension getExtension(org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
toExtension
public org.xwiki.extension.Extension toExtension(org.xwiki.extension.maven.ArtifactModel model)
-
storeExtension
public org.xwiki.extension.LocalExtension storeExtension(org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
storeExtension
public org.xwiki.extension.LocalExtension storeExtension(org.xwiki.extension.Extension extension) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
storeExtensionDependencies
public void storeExtensionDependencies() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
storeExtensionDependencies
public void storeExtensionDependencies(boolean isolate) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
createInstallPlan
public org.xwiki.extension.job.plan.ExtensionPlan createInstallPlan(org.xwiki.extension.maven.ArtifactModel model) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
resolveDependencies
public List<org.xwiki.extension.job.plan.ExtensionPlan> resolveDependencies(org.apache.maven.project.MavenProject project, boolean isolate) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
resolveDependencies
public org.xwiki.extension.job.plan.ExtensionPlan resolveDependencies(org.apache.maven.project.MavenProject project) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
registerInstalledExtension
public org.xwiki.extension.InstalledExtension registerInstalledExtension(org.apache.maven.artifact.Artifact artifact, String namespace, boolean dependency, Map<String,Object> properties) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
install
public org.xwiki.job.Job install(Collection<ExtensionArtifact> artifacts, String namespace, Map<String,Object> properties) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
install
public org.xwiki.job.Job install(Collection<ExtensionArtifact> artifacts, org.xwiki.extension.job.InstallRequest installRequest, String namespace, Map<String,Object> properties) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
install
public org.xwiki.job.Job install(org.apache.maven.artifact.Artifact artifact, String namespace, Map<String,Object> properties) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
install
public org.xwiki.job.Job install(org.xwiki.extension.job.InstallRequest installRequest, String namespace, Map<String,Object> properties) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
serializeExtension
public void serializeExtension(File path, org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException, IOException, ParserConfigurationException, TransformerException
- Throws:
org.apache.maven.plugin.MojoExecutionException
IOException
ParserConfigurationException
TransformerException
-
serializeExtension
public void serializeExtension(File path, org.apache.maven.artifact.Artifact artifact, org.apache.maven.model.Model model) throws IOException, ParserConfigurationException, TransformerException
-
toArtifactModel
public org.xwiki.extension.maven.ArtifactModel toArtifactModel(org.apache.maven.artifact.Artifact artifact, org.apache.maven.model.Model model)
-
serializeExtension
public void serializeExtension(File path, org.xwiki.extension.maven.ArtifactModel artifactModel) throws IOException, ParserConfigurationException, TransformerException
-
override
public void override(org.xwiki.extension.MutableExtension extension)
-
serializeExtension
public void serializeExtension(org.apache.maven.artifact.Artifact artifact, File directory) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
serializeExtensions
public void serializeExtensions(Collection<org.apache.maven.artifact.Artifact> artifacts, File directory, String type) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getMavenBuildConfigurationSource
public org.xwiki.tool.extension.internal.MavenBuildConfigurationSource getMavenBuildConfigurationSource()
-
collectMavenArtifacts
public Set<org.apache.maven.artifact.Artifact> collectMavenArtifacts(List<ExtensionArtifact> input) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-