final File artifactFile = File.createTempFile(
"test", "artifact", file);
artifactFile.deleteOnExit();
setVariableValueToObject(mojo, "localRepository",
new StubArtifactRepository(file.getAbsolutePath()) {
@Override
public String pathOf(Artifact artifact) {
//Return tmp file name
return artifactFile.getName();
}