Search in sources :

Example 1 with ArchetypeAlreadyExistsException

use of org.kie.workbench.common.screens.archetype.mgmt.shared.exceptions.ArchetypeAlreadyExistsException in project kie-wb-common by kiegroup.

the class ArchetypeServiceImpl method addInternalTemplate.

private void addInternalTemplate(final Path workingDirectoryPath, final GAV templateGav) {
    try {
        appendTemplateSuffix(templateGav);
        checkArchetypeAlreadyAdded(templateGav);
        final File workingDirectory = new File(workingDirectoryPath.toString());
        checkModuleValid(workingDirectoryPath.resolve(templateGav.getArtifactId()));
        finishAddArchetype(templateGav, workingDirectory, true);
    } catch (ArchetypeAlreadyExistsException e) {
    // It is ok, nothing to do here
    } catch (Exception e) {
        LOGGER.error(String.format("Failed to add internal template %s", templateGav.toString()), e);
    }
}
Also used : ArchetypeAlreadyExistsException(org.kie.workbench.common.screens.archetype.mgmt.shared.exceptions.ArchetypeAlreadyExistsException) File(java.io.File) MavenEmbedderException(org.appformer.maven.integration.embedder.MavenEmbedderException) GitAPIException(org.eclipse.jgit.api.errors.GitAPIException) ArchetypeAlreadyExistsException(org.kie.workbench.common.screens.archetype.mgmt.shared.exceptions.ArchetypeAlreadyExistsException) InvalidArchetypeException(org.kie.workbench.common.screens.archetype.mgmt.shared.exceptions.InvalidArchetypeException) MavenExecutionException(org.kie.workbench.common.screens.archetype.mgmt.shared.exceptions.MavenExecutionException) IOException(java.io.IOException)

Aggregations

File (java.io.File)1 IOException (java.io.IOException)1 MavenEmbedderException (org.appformer.maven.integration.embedder.MavenEmbedderException)1 GitAPIException (org.eclipse.jgit.api.errors.GitAPIException)1 ArchetypeAlreadyExistsException (org.kie.workbench.common.screens.archetype.mgmt.shared.exceptions.ArchetypeAlreadyExistsException)1 InvalidArchetypeException (org.kie.workbench.common.screens.archetype.mgmt.shared.exceptions.InvalidArchetypeException)1 MavenExecutionException (org.kie.workbench.common.screens.archetype.mgmt.shared.exceptions.MavenExecutionException)1