@Mojo(name="deploy-file",
requiresProject=false)
public class BundleDeployFileMojo
extends org.apache.maven.plugin.AbstractMojo
obr
property.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.
|
Constructor and Description |
---|
BundleDeployFileMojo() |
Modifier and Type | Method and Description |
---|---|
protected File |
changeVersion(File file,
String oldVersion,
String newVersion)
Change the version in jar
|
void |
execute()
Execute this Mojo
|
protected File |
fixBundleVersion(File jarFile)
Optionally fixes up the version of the bundle given in the jar File.
|
protected String |
getBundleSymbolicName(File jarFile)
Returns the symbolic name of the given bundle.
|
protected String |
getJarFileName()
Returns the path and name of the jar file containing the bundle to be
uploaded.
|
@Parameter(property="sling.failOnError", defaultValue="true", required=true) protected boolean failOnError
protected String getJarFileName() throws org.apache.maven.plugin.MojoExecutionException
null
name but
throws a MojoExecutionException
if the name is not known.null
.org.apache.maven.plugin.MojoExecutionException
- If the name of the file is not known
because it might not have been configured.protected File fixBundleVersion(File jarFile)
jarFile
may just be
returned.jarFile
- The file whose bundle version should be fixedjarFile
if the version was not fixed.public void execute() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected File changeVersion(File file, String oldVersion, String newVersion) throws org.apache.maven.plugin.MojoExecutionException
newVersion
- file
- org.apache.maven.plugin.MojoExecutionException
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.Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.