Class PropertiesMojo

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

    @Mojo(name="properties",
          requiresDependencyResolution=TEST,
          defaultPhase=INITIALIZE,
          threadSafe=true)
    public class PropertiesMojo
    extends org.apache.maven.plugin.AbstractMojo
    Goal that sets a property pointing to the artifact file for each project dependency. For each dependency (direct and transitive) a project property will be set which follows the groupId:artifactId:type:[classifier] form and contains the path to the resolved artifact.
    Since:
    2.2
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.maven.project.MavenProject project
      The current Maven project
      private boolean skip
      Skip plugin execution completely.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Constructor Summary

      Constructors 
      Constructor Description
      PropertiesMojo()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()
      Main entry into mojo.
      boolean isSkip()  
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • project

        @Parameter(defaultValue="${project}",
                   readonly=true,
                   required=true)
        private org.apache.maven.project.MavenProject project
        The current Maven project
      • skip

        @Parameter(property="mdep.skip",
                   defaultValue="false")
        private boolean skip
        Skip plugin execution completely.
        Since:
        2.7
    • Constructor Detail

      • PropertiesMojo

        public PropertiesMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        Main entry into mojo. Gets the list of dependencies and iterates through setting a property for each artifact.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - with a message if an error occurs.
      • isSkip

        public boolean isSkip()
        Returns:
        skip