* @required
*/
protected String systemRepoDirectory;
public void execute() throws MojoExecutionException, MojoFailureException {
KarArtifactInstaller installer = new KarArtifactInstaller();
installer.setBasePath(workDirectory);
installer.setLocalRepoPath(systemRepoDirectory);
FeaturesService featuresService = new OfflineFeaturesService();
installer.setFeaturesService(featuresService);
installer.init();
Collection<Artifact> dependencies = project.getDependencyArtifacts();
StringBuilder buf = new StringBuilder();
for (Artifact artifact: dependencies) {
if ("kar".equals(artifact.getType()) && "compile".equals(artifact.getScope())) {
File file = artifact.getFile();
try {
installer.install(file);
} catch (Exception e) {
buf.append("Could not install kar: ").append(artifact.toString()).append("\n");
buf.append(e.getMessage()).append("\n\n");
}
}