1919 * under the License.
2020 */
2121
22+ import java .io .File ;
2223import org .apache .maven .artifact .Artifact ;
2324import org .apache .maven .artifact .metadata .ArtifactMetadata ;
2425import org .apache .maven .artifact .repository .ArtifactRepository ;
@@ -31,9 +32,9 @@ public class ArtifactRepositoryStub
3132 extends StubArtifactRepository
3233{
3334 private boolean blacklisted ;
34-
35+
3536 private ArtifactRepositoryLayout layout ;
36-
37+
3738 private String url ;
3839
3940 private final String basedir = System .getProperty ( "basedir" );
@@ -42,7 +43,7 @@ public ArtifactRepositoryStub()
4243 {
4344 super ( null );
4445 }
45-
46+
4647 public ArtifactRepositoryStub ( String dir )
4748 {
4849 super ( dir );
@@ -52,54 +53,54 @@ public String pathOf( Artifact artifact )
5253 {
5354 return getLayout ().pathOf ( artifact );
5455 }
55-
56+
5657 public String pathOfRemoteRepositoryMetadata ( ArtifactMetadata artifactMetadata )
5758 {
5859 return getLayout ().pathOfRemoteRepositoryMetadata ( artifactMetadata );
5960 }
60-
61+
6162 public String pathOfLocalRepositoryMetadata ( ArtifactMetadata metadata , ArtifactRepository repository )
6263 {
6364 return getLayout ().pathOfLocalRepositoryMetadata ( metadata , repository );
6465 }
65-
66+
6667 public String getUrl ()
6768 {
6869 return url ;
6970 }
70-
71+
7172 public void setAppendToUrl ( String dir )
7273 {
73- this .url = "file://" + basedir + "/target/remote-repo/" + dir ;
74+ this .url = "file://" + new File ( basedir + "/target/remote-repo/" , dir ). getPath () ;
7475 }
75-
76+
7677 public String getBasedir ()
7778 {
7879 return basedir ;
7980 }
80-
81+
8182 public String getProtocol ()
8283 {
8384 return "file" ;
8485 }
85-
86+
8687 public String getId ()
8788 {
8889 return "deploy-test" ;
8990 }
90-
91+
9192 public ArtifactRepositoryPolicy getSnapshots ()
9293 {
9394 return new ArtifactRepositoryPolicy ( true , ArtifactRepositoryPolicy .UPDATE_POLICY_ALWAYS ,
9495 ArtifactRepositoryPolicy .CHECKSUM_POLICY_IGNORE );
9596 }
96-
97+
9798 public ArtifactRepositoryPolicy getReleases ()
9899 {
99100 return new ArtifactRepositoryPolicy ( true , ArtifactRepositoryPolicy .UPDATE_POLICY_ALWAYS ,
100101 ArtifactRepositoryPolicy .CHECKSUM_POLICY_IGNORE );
101102 }
102-
103+
103104 public ArtifactRepositoryLayout getLayout ()
104105 {
105106 if ( layout != null )
@@ -111,7 +112,7 @@ public ArtifactRepositoryLayout getLayout()
111112 return new DefaultRepositoryLayout ();
112113 }
113114 }
114-
115+
115116 public String getKey ()
116117 {
117118 return getId ();
@@ -121,7 +122,7 @@ public boolean isUniqueVersion()
121122 {
122123 return false ;
123124 }
124-
125+
125126 public void setBlacklisted ( boolean blackListed )
126127 {
127128 this .blacklisted = blackListed ;
0 commit comments