Documentation

maven_artifact - Downloads an Artifact from a Maven Repository

New in version 2.0.

Synopsis

Downloads an artifact from a maven repository given the maven coordinates provided to the module. Can retrieve snapshots or release versions of the artifact and will resolve the latest available version if one is not available.

Requirements (on host that executes module)

  • python >= 2.6
  • lxml

Options

parameter required default choices comments
artifact_id
yes
    The maven artifactId coordinate
    classifier
    no
      The maven classifier coordinate
      dest
      yes
        The path where the artifact should be written to
        extension
        no jar
          The maven type/extension coordinate
          group_id
          yes
            The Maven groupId coordinate
            password
            no
              The password to authenticate with to the Maven Repository
              repository_url
              no http://repo1.maven.org/maven2
                The URL of the Maven Repository to download from
                state
                yes present
                • present
                • absent
                The desired state of the artifact
                username
                no
                  The username to authenticate as to the Maven Repository
                  validate_certs
                  (added in 1.9.3)
                  no yes
                  • yes
                  • no
                  If no, SSL certificates will not be validated. This should only be set to no when no other option exists.
                  version
                  no latest
                    The maven version coordinate

                    Examples

                    # Download the latest version of the JUnit framework artifact from Maven Central
                    - maven_artifact: group_id=junit artifact_id=junit dest=/tmp/junit-latest.jar
                    
                    # Download JUnit 4.11 from Maven Central
                    - maven_artifact: group_id=junit artifact_id=junit version=4.11 dest=/tmp/junit-4.11.jar
                    
                    # Download an artifact from a private repository requiring authentication
                    - maven_artifact: group_id=com.company artifact_id=library-name repository_url=https://repo.company.com/maven username=user password=pass dest=/tmp/library-name-latest.jar
                    
                    # Download a WAR File to the Tomcat webapps directory to be deployed
                    - maven_artifact: group_id=com.company artifact_id=web-app extension=war repository_url=https://repo.company.com/maven dest=/var/lib/tomcat7/webapps/web-app.war
                    

                    This is an Extras Module

                    For more information on what this means please read Extras Modules

                    For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.