use of org.bimserver.plugins.MavenPluginBundle in project BIMserver by opensourceBIM.
the class InstallPluginBundle method execute.
@Override
public Void execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException, ServerException {
LOGGER.info("Installing plugin " + repository + " " + groupId + "." + artifactId + "." + version);
MavenPluginLocation mavenPluginLocation = bimServer.getMavenPluginRepository().getPluginLocation(repository, groupId, artifactId);
if (version == null) {
String latestVersion = mavenPluginLocation.getLatestVersionString();
LOGGER.info("Using version " + latestVersion + " because no version given");
version = latestVersion;
}
try {
LOGGER.info(mavenPluginLocation.getRepository(version));
} catch (Exception e1) {
e1.printStackTrace();
}
MavenPluginBundle mavenPluginBundle = mavenPluginLocation.getMavenPluginBundle(version);
LOGGER.info(mavenPluginBundle.getVersion());
try {
bimServer.getPluginManager().install(mavenPluginBundle, plugins, false);
} catch (Exception e) {
LOGGER.error("", e);
throw new UserException(e);
}
return null;
}
Aggregations