plugins/org.wso2.developerstudio.eclipse.docker.distribution/src/org/wso2/developerstudio/eclipse/docker/distribution/action/DockerBuildActionUtil.java
/**
     * Static method for export CApp to the given destination location.
     * Create CApp using the dependent artifacts
     * 
     * @param carbonAppsFolderLocation export destination location
     * @param dependencyProjectNames pom defined composite projects
     * @return boolean value of isCarbonAppsExportSuccessfully
     */
Static method for export CApp to the given destination location.
Create CApp using the dependent artifacts

@param carbonAppsFolderLocation export destination location
@param dependencyProjectNames pom defined composite projects
@return boolean value of isCarbonAppsExportSuccessfully
Static method for export CApp to the given destination location . Create CApp using the dependent artifacts @param carbonAppsFolderLocation export destination location @param dependencyProjectNames pom defined composite projects @return boolean value of isCarbonAppsExportSuccessfully
public static boolean exportCarbonAppsToTargetFolder(String carbonAppsFolderLocation,
            List<String> dependencyProjectNames) {
        boolean isCarbonAppsExportSuccessfully = false;
        IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
        IProject[] projects = workspaceRoot.getProjects();
        Map<String, IProject> carbonApplicationList = new HashMap<String, IProject>();
        try {
            for (IProject project : projects) {
                IFile pomFileRes = project.getFile(POM_XML);
                if (project.isOpen() && pomFileRes.exists() && project.hasNature(CAPP_NATURE)) {
                    String cappName = pomFileRes.getProject().getName();
                    carbonApplicationList.put(cappName, project);
                }
            }
            List<IProject> dependentProjects = new ArrayList<>();
            for (Map.Entry<String, IProject> entry : carbonApplicationList.entrySet()) {
                if (dependencyProjectNames.contains(entry.getKey())) {
                    dependentProjects.add(entry.getValue());
                }
            }
            for (IProject project : dependentProjects) {
                exportCarToM2Folder(project, carbonAppsFolderLocation);
            }
            isCarbonAppsExportSuccessfully = true;
        } catch (CoreException e) {
            log.error("Error occurred while checking the nature of the project", e);
        } catch (IOException | XmlPullParserException e) {
            log.error("Error occurred while exporting the CarbonApp to the target folder", e);
        }
        return isCarbonAppsExportSuccessfully;
    }
public static boolean exportCarbonAppsToTargetFolder ( String carbonAppsFolderLocation , List < String > dependencyProjectNames ) { boolean isCarbonAppsExportSuccessfully = false ; IWorkspaceRoot workspaceRoot = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) ; IProject [ ] projects = workspaceRoot . getProjects ( ) ; Map < String , IProject > carbonApplicationList = new HashMap < String , IProject > ( ) ; try { for ( IProject project : projects ) { IFile pomFileRes = project . getFile ( POM_XML ) ; if ( project . isOpen ( ) && pomFileRes . exists ( ) && project . hasNature ( CAPP_NATURE ) ) { String cappName = pomFileRes . getProject ( ) . getName ( ) ; carbonApplicationList . put ( cappName , project ) ; } } List < IProject > dependentProjects = new ArrayList < > ( ) ; for ( Map . Entry < String , IProject > entry : carbonApplicationList . entrySet ( ) ) { if ( dependencyProjectNames . contains ( entry . getKey ( ) ) ) { dependentProjects . add ( entry . getValue ( ) ) ; } } for ( IProject project : dependentProjects ) { exportCarToM2Folder ( project , carbonAppsFolderLocation ) ; } isCarbonAppsExportSuccessfully = true ; } catch ( CoreException e ) { log . error ( "Error occurred while checking the nature of the project" , e ) ; } catch ( IOException | XmlPullParserException e ) { log . error ( "Error occurred while exporting the CarbonApp to the target folder" , e ) ; } return isCarbonAppsExportSuccessfully ; }
Static method for export CApp to the given destination location.
Static method for export CApp to the given destination location .
// Fetch all carbon applications in the workspace. // Filter dependency carbon applications. // Export all the carbon applications to the target folder