Package com.google.cloud.tools.jib.maven
Class MavenProjectProperties
- java.lang.Object
-
- com.google.cloud.tools.jib.maven.MavenProjectProperties
-
- All Implemented Interfaces:
com.google.cloud.tools.jib.plugins.common.ProjectProperties
public class MavenProjectProperties extends java.lang.Object implements com.google.cloud.tools.jib.plugins.common.ProjectPropertiesObtains information about aMavenProject.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPLUGIN_KEYUsed to identify this plugin when interacting with the maven system.static java.lang.StringPLUGIN_NAMEUsed for logging during main class inference and analysis of user configuration.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigureEventHandlers(com.google.cloud.tools.jib.api.Containerizer containerizer)com.google.cloud.tools.jib.api.JibContainerBuildercreateJibContainerBuilder(com.google.cloud.tools.jib.api.JavaContainerBuilder javaContainerBuilder, com.google.cloud.tools.jib.plugins.common.ContainerizingMode containerizingMode)java.util.List<java.nio.file.Path>getClassFiles()java.nio.file.PathgetDefaultCacheDirectory()java.util.List<java.nio.file.Path>getDependencies()static MavenProjectPropertiesgetForProject(org.apache.maven.plugin.descriptor.PluginDescriptor jibPluginDescriptor, org.apache.maven.project.MavenProject project, org.apache.maven.execution.MavenSession session, org.apache.maven.plugin.logging.Log log, com.google.cloud.tools.jib.filesystem.TempDirectoryProvider tempDirectoryProvider, java.util.Collection<com.google.cloud.tools.jib.maven.extension.JibMavenPluginExtension<?>> injectedExtensions)Static factory method forMavenProjectProperties.java.lang.StringgetJarPluginName()java.lang.StringgetMainClassFromJarPlugin()intgetMajorJavaVersion()java.lang.StringgetName()java.lang.StringgetPluginName()static java.lang.StringgetProperty(java.lang.String propertyName, org.apache.maven.project.MavenProject project, org.apache.maven.execution.MavenSession session)Gets a system property with the given name.java.lang.StringgetToolName()java.lang.StringgetToolVersion()java.lang.StringgetVersion()booleanisOffline()booleanisWarProject()Gets whether or not the given project is a war project.voidlog(com.google.cloud.tools.jib.api.LogEvent logEvent)com.google.cloud.tools.jib.api.JibContainerBuilderrunPluginExtensions(java.util.List<? extends com.google.cloud.tools.jib.plugins.common.RawConfiguration.ExtensionConfiguration> extensionConfigs, com.google.cloud.tools.jib.api.JibContainerBuilder jibContainerBuilder)voidwaitForLoggingThread()
-
-
-
Field Detail
-
PLUGIN_NAME
public static final java.lang.String PLUGIN_NAME
Used for logging during main class inference and analysis of user configuration.- See Also:
- Constant Field Values
-
PLUGIN_KEY
public static final java.lang.String PLUGIN_KEY
Used to identify this plugin when interacting with the maven system.- See Also:
- Constant Field Values
-
-
Method Detail
-
getForProject
public static MavenProjectProperties getForProject(org.apache.maven.plugin.descriptor.PluginDescriptor jibPluginDescriptor, org.apache.maven.project.MavenProject project, org.apache.maven.execution.MavenSession session, org.apache.maven.plugin.logging.Log log, com.google.cloud.tools.jib.filesystem.TempDirectoryProvider tempDirectoryProvider, java.util.Collection<com.google.cloud.tools.jib.maven.extension.JibMavenPluginExtension<?>> injectedExtensions)
Static factory method forMavenProjectProperties.- Parameters:
jibPluginDescriptor- the jib-maven-plugin plugin descriptorproject- theMavenProjectfor the plugin.session- theMavenSessionfor the plugin.log- the MavenLogto log messages during Jib executiontempDirectoryProvider- temporary directory providerinjectedExtensions- the extensions injected into the Mojo- Returns:
- a MavenProjectProperties from the given project and logger.
-
getProperty
@Nullable public static java.lang.String getProperty(java.lang.String propertyName, @Nullable org.apache.maven.project.MavenProject project, @Nullable org.apache.maven.execution.MavenSession session)Gets a system property with the given name. First checks for a -D commandline argument, then checks for a property defined in the POM, then returns null if neither are defined.- Parameters:
propertyName- the name of the system propertyproject- the Maven projectsession- the Maven session- Returns:
- the value of the system property, or null if not defined
-
createJibContainerBuilder
public com.google.cloud.tools.jib.api.JibContainerBuilder createJibContainerBuilder(com.google.cloud.tools.jib.api.JavaContainerBuilder javaContainerBuilder, com.google.cloud.tools.jib.plugins.common.ContainerizingMode containerizingMode) throws java.io.IOException- Specified by:
createJibContainerBuilderin interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties- Throws:
java.io.IOException
-
getClassFiles
public java.util.List<java.nio.file.Path> getClassFiles() throws java.io.IOException- Specified by:
getClassFilesin interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties- Throws:
java.io.IOException
-
getDependencies
public java.util.List<java.nio.file.Path> getDependencies()
- Specified by:
getDependenciesin interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties
-
waitForLoggingThread
public void waitForLoggingThread()
- Specified by:
waitForLoggingThreadin interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties
-
configureEventHandlers
public void configureEventHandlers(com.google.cloud.tools.jib.api.Containerizer containerizer)
- Specified by:
configureEventHandlersin interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties
-
log
public void log(com.google.cloud.tools.jib.api.LogEvent logEvent)
- Specified by:
login interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties
-
getToolName
public java.lang.String getToolName()
- Specified by:
getToolNamein interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties
-
getToolVersion
public java.lang.String getToolVersion()
- Specified by:
getToolVersionin interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties
-
getPluginName
public java.lang.String getPluginName()
- Specified by:
getPluginNamein interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties
-
getMainClassFromJarPlugin
@Nullable public java.lang.String getMainClassFromJarPlugin()
- Specified by:
getMainClassFromJarPluginin interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties
-
getDefaultCacheDirectory
public java.nio.file.Path getDefaultCacheDirectory()
- Specified by:
getDefaultCacheDirectoryin interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties
-
getJarPluginName
public java.lang.String getJarPluginName()
- Specified by:
getJarPluginNamein interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties
-
isWarProject
public boolean isWarProject()
Gets whether or not the given project is a war project. This is the case for projects with packagingwarandgwt-app.- Specified by:
isWarProjectin interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties- Returns:
trueif the project is a war project,falseif not
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties
-
getVersion
public java.lang.String getVersion()
- Specified by:
getVersionin interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties
-
getMajorJavaVersion
public int getMajorJavaVersion()
- Specified by:
getMajorJavaVersionin interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties
-
isOffline
public boolean isOffline()
- Specified by:
isOfflinein interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties
-
runPluginExtensions
public com.google.cloud.tools.jib.api.JibContainerBuilder runPluginExtensions(java.util.List<? extends com.google.cloud.tools.jib.plugins.common.RawConfiguration.ExtensionConfiguration> extensionConfigs, com.google.cloud.tools.jib.api.JibContainerBuilder jibContainerBuilder) throws com.google.cloud.tools.jib.plugins.extension.JibPluginExtensionException- Specified by:
runPluginExtensionsin interfacecom.google.cloud.tools.jib.plugins.common.ProjectProperties- Throws:
com.google.cloud.tools.jib.plugins.extension.JibPluginExtensionException
-
-