public abstract class AbstractFabric8Mojo extends AbstractNamespacedMojo
| Modifier and Type | Field and Description |
|---|---|
protected File |
appConfigDir
The folder used for defining project specific files
|
protected boolean |
combineDependencies
Whether we should combine kubernetes JSON dependencies on the classpath into the generated JSON
|
protected File |
environmentVariableToAnnotationsFile
Specifies a file which maps environment variables or system properties to annotations which are then recorded on the
ReplicationController of the generated or applied JSON
|
protected File |
envPropertiesFile
The properties file used to specify environment variables which allows ${FOO_BAR} expressions to be used
without any Maven property expansion
|
static String[] |
ICON_EXTENSIONS |
protected String |
iconRef
Provides the resource name of the icon to use; found using the current classpath (including the ones shipped inside the maven plugin).
|
protected File |
kubernetesSourceJson
The source kubernetes JSON file
|
protected boolean |
pureKubernetes
Should we exclude OpenShift templates and any extensions like OAuthConfigs in the generated or combined JSON?
|
protected File |
zipFile
Name of the created app zip file
|
failOnError, recreate, routeDomain| Constructor and Description |
|---|
AbstractFabric8Mojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addEnvironmentAnnotations(File json) |
protected void |
addEnvironmentAnnotations(io.fabric8.kubernetes.api.model.HasMetadata resource) |
protected void |
addEnvironmentAnnotations(Iterable<io.fabric8.kubernetes.api.model.HasMetadata> items) |
protected static void |
addPropertiesFileToMap(File file,
Map<String,String> answer) |
protected static void |
addPropertiesFileToMap(URL url,
Map<String,String> answer) |
protected void |
copyAppConfigFiles(File appBuildDir,
File appConfigDir)
Copies any local configuration files into the app directory
|
protected File |
copyIconToFolder(File appBuildDir) |
protected void |
copyReadMe(File appBuildDir) |
protected static File |
copyReadMe(File src,
File appBuildDir) |
protected static File |
copyReadMe(File src,
File appBuildDir,
String outputFileName) |
protected void |
copySummaryText(File appBuildDir) |
protected URLClassLoader |
createClassLoader(List<String> classpathElements,
String... paths) |
protected static Iterable<Throwable> |
createExceptionIterable(Throwable exception)
Creates an Iterable to walk the exception from the bottom up
(the last caused by going upwards to the root exception).
|
protected static URLClassLoader |
createURLClassLoader(Collection<URL> jars) |
protected String |
findDocumentationUrl() |
protected org.apache.maven.model.DistributionManagement |
findProjectDistributionManagement() |
protected URLClassLoader |
getCompileClassLoader() |
String |
getDockerImage() |
JsonSchema |
getEnvironmentVariableJsonSchema() |
Map<String,String> |
getEnvironmentVariableProperties()
Returns all the environment variable properties defined in the pom.xml which are prefixed with "fabric8.env."
|
protected String |
getGitCommitId(String envVarName,
File basedir) |
protected org.eclipse.jgit.lib.Repository |
getGitRepository(File basedir,
String envVarName) |
File |
getKubernetesCombineJson() |
File |
getKubernetesJson() |
org.apache.maven.project.MavenProject |
getProject() |
protected Properties |
getProjectAndFabric8Properties(org.apache.maven.project.MavenProject project) |
Integer |
getReplicas() |
protected URLClassLoader |
getTestClassLoader() |
File |
getZipFile() |
protected boolean |
hasConfigDir() |
boolean |
isIgnoreProject() |
protected boolean |
isInCDBuild()
Returns true if the current build is being run inside a CI / CD build in which case
lets warn if we cannot detect things like the GIT commit or Jenkins build server URL
|
protected boolean |
isPom(org.apache.maven.project.MavenProject reactorProject)
Returns true if this project is a pom packaging project
|
protected boolean |
isPomProject() |
protected static Object |
loadJsonFile(File file) |
protected InputStream |
loadPluginResource(String iconRef) |
protected void |
overrideTemplateParameters(io.fabric8.openshift.api.model.Template template)
Before applying the given template lets allow template parameters to be overridden via the maven
properties - or optionally - via the command line if in interactive mode.
|
protected void |
printSummary(Object kubeResource) |
protected static String |
replaceProperties(String text,
Properties properties)
Replaces all text of the form
{foo}$ with the value in the properties object |
protected boolean |
shouldGenerateForThisProject() |
protected boolean |
toBeExclude(String fileName) |
protected String |
tryDefaultAnnotationEnvVar(String envVarName)
Tries to default some environment variables if they are not already defined.
|
static String |
unquoteTemplateExpression(String value)
If supported we should escape
${FOO} for template expressions |
protected void |
warnIfInCDBuild(String message) |
protected void |
warnIfInCDBuild(String message,
Throwable exception) |
createController, findProjectConfig, getKubernetes, getNamespace, getNamespaceForEnvironment, getRootProject, getRootProjectFolder, getRouteDomain, isFailOnError, isRecreate, setFailOnError, setNamespace, setRecreate, setRouteDomaingetLog, getPluginContext, setLog, setPluginContextpublic static String[] ICON_EXTENSIONS
@Parameter(property="fabric8.zip.file",
defaultValue="${project.build.directory}/${project.artifactId}-${project.version}-app.zip")
protected File zipFile
@Parameter(property="fabric8.source.dir",
defaultValue="${basedir}/src/main/fabric8")
protected File appConfigDir
@Parameter(property="fabric8.iconRef") protected String iconRef
@Parameter(property="fabric8.json.source",
defaultValue="${basedir}/src/main/fabric8/kubernetes.json")
protected File kubernetesSourceJson
@Parameter(property="fabric8.combineDependencies",
defaultValue="false")
protected boolean combineDependencies
@Parameter(property="fabric8.pureKubernetes",
defaultValue="false")
protected boolean pureKubernetes
@Parameter(property="fabric8.envProperties",
defaultValue="${basedir}/src/main/fabric8/env.properties")
protected File envPropertiesFile
@Parameter(property="fabric8.environmentVariableToAnnotationsFile",
defaultValue="${basedir}/src/main/fabric8/environemntToAnnotations.properties")
protected File environmentVariableToAnnotationsFile
protected static File copyReadMe(File src, File appBuildDir) throws IOException
IOExceptionprotected static File copyReadMe(File src, File appBuildDir, String outputFileName) throws IOException
IOExceptionprotected static Object loadJsonFile(File file) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic org.apache.maven.project.MavenProject getProject()
getProject in class AbstractNamespacedMojoprotected static URLClassLoader createURLClassLoader(Collection<URL> jars)
public File getKubernetesJson()
public File getKubernetesCombineJson()
public Integer getReplicas()
public boolean isIgnoreProject()
public File getZipFile()
protected boolean isPom(org.apache.maven.project.MavenProject reactorProject)
protected InputStream loadPluginResource(String iconRef) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected URLClassLoader getCompileClassLoader() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected URLClassLoader getTestClassLoader() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected URLClassLoader createClassLoader(List<String> classpathElements, String... paths) throws MalformedURLException
MalformedURLExceptionprotected boolean hasConfigDir()
protected boolean isPomProject()
protected void addEnvironmentAnnotations(File json) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void addEnvironmentAnnotations(Iterable<io.fabric8.kubernetes.api.model.HasMetadata> items) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected void addEnvironmentAnnotations(io.fabric8.kubernetes.api.model.HasMetadata resource)
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected String findDocumentationUrl()
protected static String replaceProperties(String text, Properties properties)
{foo}$ with the value in the properties objectprotected org.apache.maven.model.DistributionManagement findProjectDistributionManagement()
protected String tryDefaultAnnotationEnvVar(String envVarName)
protected void warnIfInCDBuild(String message)
protected boolean isInCDBuild()
protected static Iterable<Throwable> createExceptionIterable(Throwable exception)
exception - the exceptionIterableprotected org.eclipse.jgit.lib.Repository getGitRepository(File basedir, String envVarName)
protected boolean shouldGenerateForThisProject()
public Map<String,String> getEnvironmentVariableProperties() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected static void addPropertiesFileToMap(File file, Map<String,String> answer) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected static void addPropertiesFileToMap(URL url, Map<String,String> answer) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic static String unquoteTemplateExpression(String value)
${FOO} for template expressionspublic JsonSchema getEnvironmentVariableJsonSchema() throws IOException, org.apache.maven.plugin.MojoExecutionException
IOExceptionorg.apache.maven.plugin.MojoExecutionExceptionprotected File copyIconToFolder(File appBuildDir) throws org.apache.maven.plugin.MojoExecutionException, IOException
org.apache.maven.plugin.MojoExecutionExceptionIOExceptionprotected void copyAppConfigFiles(File appBuildDir, File appConfigDir) throws IOException
IOExceptionprotected boolean toBeExclude(String fileName)
protected void copyReadMe(File appBuildDir) throws IOException
IOExceptionprotected void copySummaryText(File appBuildDir) throws IOException
IOExceptionprotected void printSummary(Object kubeResource) throws IOException
IOExceptionpublic String getDockerImage()
protected void overrideTemplateParameters(io.fabric8.openshift.api.model.Template template)
protected Properties getProjectAndFabric8Properties(org.apache.maven.project.MavenProject project)
Copyright © 2011–2016 Red Hat. All rights reserved.