Giter Site home page Giter Site logo

perl-maven's Introduction

NAME

Maven::Agent - A base agent for working with maven

VERSION

version 1.14

SYNOPSIS

use Maven::Agent;

my $agent = Maven::Agent->new();

Or if you need to configure your own LWP

my $lwp = LWP::UserAgent->new();
$lwp->env_proxy();
my $agent = Maven::Agent->new(agent => $lwp);

my $maybe_artifact = $agent->resolve(
    'javax.servlet:servlet-api:2.5');
if ($maybe_artifact) {
    # use it
}

my $artifact = $agent->resolve_or_die(
    'javax.servlet:servlet-api:2.5');

my $servlet_api_jar = $agent->download('javax.servlet:servlet-api:2.5');

$agent->download('javax.servlet:servlet-api:2.5',
    to => '/path/to/some/directory');

DESCRIPTION

The default agents for working with Maven artifacts.

CONSTRUCTORS

new([%options])

Creates a new agent. %options is passed through to "new([%options])" in Maven::Maven.

METHODS

download($artifact, [%options])

Downloads $artifact and returns the path to the downloaded file. The current options are:

  • to

    The path to download the artifact to. If the path is a directory, the download filename will be artifactId.packaging. Defaults to a temporary location. If it is the temporary location, the type of the return value is actually a blessed object that overrides the "" operator so that it behaves like a string path. This allows the temporary file to be cleaned up when the object goes out of scope.

get_maven

Returns the Maven::Maven object.

is_local($artifact)

Returns a truthy value if $artifact is found in the local repository. This method expects $artifact to have already been resolved.

resolve($artifact, [%parts])

Will attempt to resolve $artifact. $artifact can be either an instance of Maven::Artifact or a coordinate string of the form groupId:artifactId[:packaging[:classifier]]:version If resolution was successful, a new Maven::Artifact will be returned with its uri set. Otherwise, undef will be returned. If %parts are supplied, their values will be used to override the corresponding values in $artifact before resolution is attempted.

resolve_or_die($artifact)

Calls resolve, and, if resolution was successful, the new $artifact will be returned, otherwise, croak will be called.

AUTHOR

Lucas Theisen [email protected]

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Lucas Theisen.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

SEE ALSO

Please see those modules/websites for more information related to this module.

perl-maven's People

Contributors

lucastheisen avatar yoshiya8 avatar

Watchers

Mohammad Sajid Anwar avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.