line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
25
|
use strict; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
111
|
|
2
|
4
|
|
|
4
|
|
19
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
232
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Footprintless::Resource::MavenProvider; |
5
|
|
|
|
|
|
|
$Footprintless::Resource::MavenProvider::VERSION = '1.29'; |
6
|
|
|
|
|
|
|
# ABSTRACT: A resource provider for resources retrieved by maven coordinate |
7
|
|
|
|
|
|
|
# PODNAME: Footprintless::Resource::MavenProvider |
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
20
|
use parent qw(Footprintless::Resource::Provider); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
21
|
|
10
|
|
|
|
|
|
|
|
11
|
4
|
|
|
4
|
|
2510
|
use Maven::Agent; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub _download { |
14
|
|
|
|
|
|
|
my ( $self, $resource, %options ) = @_; |
15
|
|
|
|
|
|
|
return $self->{maven_agent}->download( $resource->get_artifact(), %options ); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _init { |
19
|
|
|
|
|
|
|
my ( $self, %options ) = @_; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
$self->{maven_agent} = Maven::Agent->new( agent => $self->{factory}->agent() ); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
return $self; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub resource { |
27
|
|
|
|
|
|
|
my ( $self, $spec ) = @_; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
return $spec if ( UNIVERSAL::isa( $spec, 'Footprintless::Resource::Maven' ) ); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
return Footprintless::Resource::Maven->new( |
32
|
|
|
|
|
|
|
$self->{maven_agent}->resolve_or_die( ref($spec) ? $spec->{coordinate} : $spec ) ); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub supports { |
36
|
|
|
|
|
|
|
my ( $self, $resource ) = @_; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
return 1 if ( UNIVERSAL::isa( $resource, 'Footprintless::Resource::Maven' ) ); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
my $ref = ref($resource); |
41
|
|
|
|
|
|
|
if ($ref) { |
42
|
|
|
|
|
|
|
return 1 if ( $resource->{coordinate} ); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
elsif ( $resource =~ /^(?:[^:]+:){2,4}[^:]+$/ ) { |
45
|
|
|
|
|
|
|
return 1; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
return 0; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |