19
19
* under the License.
20
20
*/
21
21
22
+ import java .io .File ;
22
23
import org .apache .maven .artifact .Artifact ;
23
24
import org .apache .maven .artifact .metadata .ArtifactMetadata ;
24
25
import org .apache .maven .artifact .repository .ArtifactRepository ;
@@ -31,9 +32,9 @@ public class ArtifactRepositoryStub
31
32
extends StubArtifactRepository
32
33
{
33
34
private boolean blacklisted ;
34
-
35
+
35
36
private ArtifactRepositoryLayout layout ;
36
-
37
+
37
38
private String url ;
38
39
39
40
private final String basedir = System .getProperty ( "basedir" );
@@ -42,7 +43,7 @@ public ArtifactRepositoryStub()
42
43
{
43
44
super ( null );
44
45
}
45
-
46
+
46
47
public ArtifactRepositoryStub ( String dir )
47
48
{
48
49
super ( dir );
@@ -52,54 +53,54 @@ public String pathOf( Artifact artifact )
52
53
{
53
54
return getLayout ().pathOf ( artifact );
54
55
}
55
-
56
+
56
57
public String pathOfRemoteRepositoryMetadata ( ArtifactMetadata artifactMetadata )
57
58
{
58
59
return getLayout ().pathOfRemoteRepositoryMetadata ( artifactMetadata );
59
60
}
60
-
61
+
61
62
public String pathOfLocalRepositoryMetadata ( ArtifactMetadata metadata , ArtifactRepository repository )
62
63
{
63
64
return getLayout ().pathOfLocalRepositoryMetadata ( metadata , repository );
64
65
}
65
-
66
+
66
67
public String getUrl ()
67
68
{
68
69
return url ;
69
70
}
70
-
71
+
71
72
public void setAppendToUrl ( String dir )
72
73
{
73
- this .url = "file://" + basedir + "/target/remote-repo/" + dir ;
74
+ this .url = "file://" + new File ( basedir + "/target/remote-repo/" , dir ). getPath () ;
74
75
}
75
-
76
+
76
77
public String getBasedir ()
77
78
{
78
79
return basedir ;
79
80
}
80
-
81
+
81
82
public String getProtocol ()
82
83
{
83
84
return "file" ;
84
85
}
85
-
86
+
86
87
public String getId ()
87
88
{
88
89
return "deploy-test" ;
89
90
}
90
-
91
+
91
92
public ArtifactRepositoryPolicy getSnapshots ()
92
93
{
93
94
return new ArtifactRepositoryPolicy ( true , ArtifactRepositoryPolicy .UPDATE_POLICY_ALWAYS ,
94
95
ArtifactRepositoryPolicy .CHECKSUM_POLICY_IGNORE );
95
96
}
96
-
97
+
97
98
public ArtifactRepositoryPolicy getReleases ()
98
99
{
99
100
return new ArtifactRepositoryPolicy ( true , ArtifactRepositoryPolicy .UPDATE_POLICY_ALWAYS ,
100
101
ArtifactRepositoryPolicy .CHECKSUM_POLICY_IGNORE );
101
102
}
102
-
103
+
103
104
public ArtifactRepositoryLayout getLayout ()
104
105
{
105
106
if ( layout != null )
@@ -111,7 +112,7 @@ public ArtifactRepositoryLayout getLayout()
111
112
return new DefaultRepositoryLayout ();
112
113
}
113
114
}
114
-
115
+
115
116
public String getKey ()
116
117
{
117
118
return getId ();
@@ -121,7 +122,7 @@ public boolean isUniqueVersion()
121
122
{
122
123
return false ;
123
124
}
124
-
125
+
125
126
public void setBlacklisted ( boolean blackListed )
126
127
{
127
128
this .blacklisted = blackListed ;
0 commit comments