Class 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.ProjectProperties
    Obtains information about a MavenProject.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PLUGIN_KEY
      Used to identify this plugin when interacting with the maven system.
      static java.lang.String PLUGIN_NAME
      Used for logging during main class inference and analysis of user configuration.
      • Fields inherited from interface com.google.cloud.tools.jib.plugins.common.ProjectProperties

        CACHE_DIRECTORY_NAME
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void configureEventHandlers​(com.google.cloud.tools.jib.api.Containerizer containerizer)  
      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)  
      java.util.List<java.nio.file.Path> getClassFiles()  
      java.nio.file.Path getDefaultCacheDirectory()  
      java.util.List<java.nio.file.Path> getDependencies()  
      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 for MavenProjectProperties.
      java.lang.String getJarPluginName()  
      java.lang.String getMainClassFromJarPlugin()  
      int getMajorJavaVersion()  
      java.lang.String getName()  
      java.lang.String getPluginName()  
      static java.lang.String getProperty​(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.String getToolName()  
      java.lang.String getToolVersion()  
      java.lang.String getVersion()  
      boolean isOffline()  
      boolean isWarProject()
      Gets whether or not the given project is a war project.
      void log​(com.google.cloud.tools.jib.api.LogEvent logEvent)  
      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)  
      void waitForLoggingThread()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 for MavenProjectProperties.
        Parameters:
        jibPluginDescriptor - the jib-maven-plugin plugin descriptor
        project - the MavenProject for the plugin.
        session - the MavenSession for the plugin.
        log - the Maven Log to log messages during Jib execution
        tempDirectoryProvider - temporary directory provider
        injectedExtensions - 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 property
        project - the Maven project
        session - 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:
        createJibContainerBuilder in interface com.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:
        getClassFiles in interface com.google.cloud.tools.jib.plugins.common.ProjectProperties
        Throws:
        java.io.IOException
      • getDependencies

        public java.util.List<java.nio.file.Path> getDependencies()
        Specified by:
        getDependencies in interface com.google.cloud.tools.jib.plugins.common.ProjectProperties
      • waitForLoggingThread

        public void waitForLoggingThread()
        Specified by:
        waitForLoggingThread in interface com.google.cloud.tools.jib.plugins.common.ProjectProperties
      • configureEventHandlers

        public void configureEventHandlers​(com.google.cloud.tools.jib.api.Containerizer containerizer)
        Specified by:
        configureEventHandlers in interface com.google.cloud.tools.jib.plugins.common.ProjectProperties
      • log

        public void log​(com.google.cloud.tools.jib.api.LogEvent logEvent)
        Specified by:
        log in interface com.google.cloud.tools.jib.plugins.common.ProjectProperties
      • getToolName

        public java.lang.String getToolName()
        Specified by:
        getToolName in interface com.google.cloud.tools.jib.plugins.common.ProjectProperties
      • getToolVersion

        public java.lang.String getToolVersion()
        Specified by:
        getToolVersion in interface com.google.cloud.tools.jib.plugins.common.ProjectProperties
      • getPluginName

        public java.lang.String getPluginName()
        Specified by:
        getPluginName in interface com.google.cloud.tools.jib.plugins.common.ProjectProperties
      • getMainClassFromJarPlugin

        @Nullable
        public java.lang.String getMainClassFromJarPlugin()
        Specified by:
        getMainClassFromJarPlugin in interface com.google.cloud.tools.jib.plugins.common.ProjectProperties
      • getDefaultCacheDirectory

        public java.nio.file.Path getDefaultCacheDirectory()
        Specified by:
        getDefaultCacheDirectory in interface com.google.cloud.tools.jib.plugins.common.ProjectProperties
      • getJarPluginName

        public java.lang.String getJarPluginName()
        Specified by:
        getJarPluginName in interface com.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 packaging war and gwt-app.
        Specified by:
        isWarProject in interface com.google.cloud.tools.jib.plugins.common.ProjectProperties
        Returns:
        true if the project is a war project, false if not
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface com.google.cloud.tools.jib.plugins.common.ProjectProperties
      • getVersion

        public java.lang.String getVersion()
        Specified by:
        getVersion in interface com.google.cloud.tools.jib.plugins.common.ProjectProperties
      • getMajorJavaVersion

        public int getMajorJavaVersion()
        Specified by:
        getMajorJavaVersion in interface com.google.cloud.tools.jib.plugins.common.ProjectProperties
      • isOffline

        public boolean isOffline()
        Specified by:
        isOffline in interface com.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:
        runPluginExtensions in interface com.google.cloud.tools.jib.plugins.common.ProjectProperties
        Throws:
        com.google.cloud.tools.jib.plugins.extension.JibPluginExtensionException