NAME

Maven::Maven - The main interface to maven

VERSION

version 1.00

SYNOPSIS

use Maven::Maven;

my $maven = Maven::Maven->new();
my $artifact = $maven->repositories()->resolve(
    'javax.servlet:servlet-api:2.5');

Or more likely

use Maven::Agent;

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

my $global_settings_file = $maven->m2_home('conf', 'settings.xml');
my $user_settings_file = $maven->dot_m2('settings.xml');

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

DESCRIPTION

This class is a container for maven configuration data. When constructed it parses the settings files (both user and global), and generates Maven::Repositories that can be used to resolve Maven::Artifact's.

CONSTRUCTORS

new([%options])

Constructs a new instance. It is uncommon to construct Maven::Maven directly, instead you should use one of the agents (Maven::Agent, Maven::MvnAgent) and then obtain access through their get_maven method. The currently supported options are:

agent

An instance of LWP::UserAgent that will be used to connect to the remote repositories.

M2_HOME

The path to the maven install directory. Defaults to $ENV{HOME}.

user.home

The path to the users home directory. Defaults to $ENV{HOME} || $ENV{USERPROFILE}.

METHODS

dot_m2([@parts])

Returns a path indicated by joining all of @parts to the user maven dot directory.

get_property($key)

Returns the value of the effective settings property indicated by $key.

get_repositories()

Returns the repositories configured in the effective settings.

m2_home([@parts])

Returns a path indicated by joining all of @parts to the maven install directory.

user_home([@parts])

Returns a path indicated by joining all of @parts to the user home directory.

AUTHOR

Lucas Theisen <lucastheisen@pastdev.com>

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.