Search in sources :

Example 1 with MavenPluginBundle

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;
}
Also used : MavenPluginLocation(org.bimserver.plugins.MavenPluginLocation) MavenPluginBundle(org.bimserver.plugins.MavenPluginBundle) UserException(org.bimserver.shared.exceptions.UserException) BimserverLockConflictException(org.bimserver.database.BimserverLockConflictException) UserException(org.bimserver.shared.exceptions.UserException) ServerException(org.bimserver.shared.exceptions.ServerException) BimserverDatabaseException(org.bimserver.BimserverDatabaseException)

Aggregations

BimserverDatabaseException (org.bimserver.BimserverDatabaseException)1 BimserverLockConflictException (org.bimserver.database.BimserverLockConflictException)1 MavenPluginBundle (org.bimserver.plugins.MavenPluginBundle)1 MavenPluginLocation (org.bimserver.plugins.MavenPluginLocation)1 ServerException (org.bimserver.shared.exceptions.ServerException)1 UserException (org.bimserver.shared.exceptions.UserException)1