Search in sources :

Example 11 with ProjectLoadException

use of com.developmentontheedge.be5.metadata.exception.ProjectLoadException in project be5 by DevelopmentOnTheEdge.

the class ModuleLoader2 method mergeModules.

public static void mergeModules(Project be5Project, ProcessController logger) throws ProjectLoadException {
    long startTime = System.nanoTime();
    LoadContext loadContext = new LoadContext();
    try {
        ModuleLoader2.mergeAllModules(be5Project, logger, loadContext);
    } catch (ProjectLoadException e) {
        throw new ProjectLoadException("Merge modules", e);
    }
    loadContext.check();
    log.info(ModuleLoader2.logLoadedProject(be5Project, startTime));
}
Also used : ProjectLoadException(com.developmentontheedge.be5.metadata.exception.ProjectLoadException)

Example 12 with ProjectLoadException

use of com.developmentontheedge.be5.metadata.exception.ProjectLoadException in project be5 by DevelopmentOnTheEdge.

the class ModuleLoader2 method findAndLoadProjectWithModules.

public static Project findAndLoadProjectWithModules() throws ProjectLoadException {
    loadAllProjects(true);
    Project project = null;
    for (Map.Entry<String, Project> module : modulesMap.entrySet()) {
        if (module.getValue() != null && !module.getValue().isModuleProject()) {
            if (project != null) {
                throw new RuntimeException("Several projects were found: " + project + ", " + module);
            } else {
                project = module.getValue();
            }
        }
    }
    if (project == null) {
        // todo create new not module project for tests?
        log.info("Project not found, try load main module.");
        project = new ProjectTopologicalSort(modulesMap.values()).getRoot();
    }
    ModuleLoader2.mergeModules(project, new JULLogger(log));
    return project;
}
Also used : Project(com.developmentontheedge.be5.metadata.model.Project) JULLogger(com.developmentontheedge.be5.metadata.util.JULLogger) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

Project (com.developmentontheedge.be5.metadata.model.Project)8 ProjectLoadException (com.developmentontheedge.be5.metadata.exception.ProjectLoadException)6 MojoFailureException (org.apache.maven.plugin.MojoFailureException)4 ColumnDef (com.developmentontheedge.be5.metadata.model.ColumnDef)2 Entity (com.developmentontheedge.be5.metadata.model.Entity)2 Module (com.developmentontheedge.be5.metadata.model.Module)2 TableDef (com.developmentontheedge.be5.metadata.model.TableDef)2 LoadContext (com.developmentontheedge.be5.metadata.serialization.LoadContext)2 IOException (java.io.IOException)2 Path (java.nio.file.Path)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 Test (org.junit.Test)2 FreemarkerSqlException (com.developmentontheedge.be5.metadata.exception.FreemarkerSqlException)1 ProcessInterruptedException (com.developmentontheedge.be5.metadata.exception.ProcessInterruptedException)1 ReadException (com.developmentontheedge.be5.metadata.exception.ReadException)1 BeConnectionProfile (com.developmentontheedge.be5.metadata.model.BeConnectionProfile)1 DataElementUtils (com.developmentontheedge.be5.metadata.model.DataElementUtils)1 DdlElement (com.developmentontheedge.be5.metadata.model.DdlElement)1 EntityType (com.developmentontheedge.be5.metadata.model.EntityType)1