public static Verifier deployAndGetVerifier(Gav gav, String repositoryUrl, File fileToDeploy, File settings,
String... extraOptions)
throws VerificationException, IOException
{
Verifier verifier = createVerifier(gav, repositoryUrl, fileToDeploy, settings, extraOptions);
// verifier.executeGoal( "deploy:deploy-file" );
Map<String, String> args = new HashMap<String, String>();
args.put("url", repositoryUrl);
args.put("file", fileToDeploy.getAbsolutePath());
args.put("groupId", gav.getGroupId());
args.put("artifactId", gav.getArtifactId());
args.put("version", gav.getVersion());
args.put("packaging", gav.getExtension());
if (gav.getClassifier() != null) {
args.put("classifier", gav.getClassifier());
}
Properties props = new Properties();
props.putAll(args);
verifier.setSystemProperties(props);
verifier.executeGoal("org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy-file", args);
return verifier;
}