@Mojo(name="fsunmount",
requiresProject=true)
public class FsUnMountMojo
extends org.apache.maven.plugin.AbstractMojo
AbstractFsMountMojo.bundleFileName
the configuration for its initial content is created.
Otherwise it tries to detect a FileVault content package layout starting at AbstractFsMountMojo.fileVaultJcrRootFile
or the project's resource directories and potentially creates a configuration for each path in the package's filter.xml
.Modifier and Type | Field and Description |
---|---|
protected boolean |
failOnError
Determines whether or not to fail the build if
the HTTP POST or PUT returns an non-OK response code.
|
protected org.apache.maven.project.MavenProject |
project
The Maven project.
|
protected org.eclipse.aether.RepositorySystemSession |
repoSession |
protected List<org.eclipse.aether.repository.RemoteRepository> |
repositories |
protected org.eclipse.aether.RepositorySystem |
repoSystem |
protected URI |
slingConsoleUrl
The WebConsole URL of the running Sling instance.
|
protected URI |
slingUrl
The URL of the running Sling instance.
|
protected String |
slingUrlSuffix
An optional url suffix which will be appended to the
sling.url
for use as the real target url. |
Constructor and Description |
---|
FsUnMountMojo() |
Modifier and Type | Method and Description |
---|---|
static URI |
addTrailingSlash(URI targetURL) |
protected void |
configureFileVaultXml(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient,
URI targetUrl,
File jcrRootFile,
File filterXmlFile) |
protected void |
configureSlingInitialContent(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient,
URI targetUrl,
File bundleFile) |
protected void |
ensureBundlesInstalled(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient,
URI targetUrl) |
void |
execute() |
protected String |
getBundleSymbolicName(File jarFile)
Returns the symbolic name of the given bundle.
|
protected URI |
getConsoleTargetURL() |
protected org.apache.hc.client5.http.impl.classic.CloseableHttpClient |
getHttpClient() |
protected org.apache.hc.client5.http.config.RequestConfig.Builder |
getRequestConfigBuilder() |
protected URI |
getTargetURL() |
protected File |
resolveArtifact(org.eclipse.aether.artifact.Artifact artifact) |
@Parameter(defaultValue="${project}", readonly=true) protected org.apache.maven.project.MavenProject project
@Parameter(property="sling.url", defaultValue="http://localhost:8080/system/console", required=true) protected URI slingUrl
The default is only useful for WebConsole deployment.
For WebDAV deployment it is recommended to include the Sling Simple WebDAV servlet root, for instance http://localhost:8080/dav/default/libs/sling/install. Omitting the dav/default
segment can lead to conflicts with other servlets.
@Parameter(property="sling.console.url") protected URI slingConsoleUrl
@Parameter(property="sling.urlSuffix") protected String slingUrlSuffix
sling.url
for use as the real target url. This allows to configure different target URLs
in each POM, while using the same common sling.url
in a parent
POM (eg. sling.url=http://localhost:8080
and
sling.urlSuffix=/project/specific/path
). This is typically used
in conjunction with WebDAV or SlingPostServlet deployment methods.@Parameter(property="sling.failOnError", defaultValue="true") protected boolean failOnError
@Component protected org.eclipse.aether.RepositorySystem repoSystem
@Parameter(defaultValue="${repositorySystemSession}", readonly=true, required=true) protected org.eclipse.aether.RepositorySystemSession repoSession
@Parameter(defaultValue="${project.remoteProjectRepositories}", readonly=true, required=true) protected List<org.eclipse.aether.repository.RemoteRepository> repositories
protected void configureSlingInitialContent(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient, URI targetUrl, File bundleFile) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected void configureFileVaultXml(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient, URI targetUrl, File jcrRootFile, File filterXmlFile) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected void ensureBundlesInstalled(org.apache.hc.client5.http.impl.classic.CloseableHttpClient httpClient, URI targetUrl) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
protected String getBundleSymbolicName(File jarFile)
jarFile
does not contain a manifest with a
Bundle-SymbolicName
header null
is
returned. Otherwise the value of the Bundle-SymbolicName
header is returned.
This method may also be used to check whether the file is a bundle at all
as it is assumed, that only if the file contains an OSGi bundle will the
Bundle-SymbolicName
manifest header be set.
jarFile
- The file providing the bundle whose symbolic name is
requested.Bundle-SymbolicName
manifest header or
null
if no manifest exists in the file or the
header is not contained in the manifest. However, if
null
is returned, the file may be assumed to not
contain an OSGi bundle.protected URI getTargetURL()
sling.url
and sling.urlSuffix
. Always ends with "/".protected URI getConsoleTargetURL()
sling.console.url
and sling.urlSuffix
. Always ends with "/".protected org.apache.hc.client5.http.impl.classic.CloseableHttpClient getHttpClient()
protected org.apache.hc.client5.http.config.RequestConfig.Builder getRequestConfigBuilder()
protected File resolveArtifact(org.eclipse.aether.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
Copyright © 2007–2022 The Apache Software Foundation. All rights reserved.