Class CPUandMemoryMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="set-cpumem-properties",
          defaultPhase=INITIALIZE)
    public class CPUandMemoryMojo
    extends org.apache.maven.plugin.AbstractMojo
    Sets Maven project properties with values for system.cores, system.free.memory, and system.total.memory; memory values are set with unit of measurement appended (e.g., 200m, 3g, 5000k).

    To manually run the plugin: `mvn info.freelibrary:freelib-utils:[VERSION]:set-cpumem-properties` (supplying whatever version is appropriate). Usually, though, the plugin would just be configured to run as a part of the Maven lifecycle.

    • Field Detail

      • SYSTEM_FREE_MEMORY

        public static final String SYSTEM_FREE_MEMORY
        A constant label for system's free memory.
        See Also:
        Constant Field Values
      • SYSTEM_TOTAL_MEMORY

        public static final String SYSTEM_TOTAL_MEMORY
        A constant label for system's total memory.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CPUandMemoryMojo

        public CPUandMemoryMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException