public void generateArchetypesFromGithubOrganisation ( String githubOrg , File outputDir , List < String > dirs ) throws IOException { GitHub github = GitHub . connectAnonymously ( ) ; GHOrganization organization = github . getOrganization ( githubOrg ) ; Objects . notNull ( organization , "No github organisation found for: " + githubOrg ) ; Map < String , GHRepository > repositories = organization . getRepositories ( ) ; Set < Map . Entry < String , GHRepository > > entries = repositories . entrySet ( ) ; File cloneParentDir = new File ( outputDir , "../git-clones" ) ; if ( cloneParentDir . exists ( ) ) { Files . recursiveDelete ( cloneParentDir ) ; } for ( Map . Entry < String , GHRepository > entry : entries ) { String repoName = entry . getKey ( ) ; GHRepository repo = entry . getValue ( ) ; String url = repo . getGitTransportUrl ( ) ; generateArchetypeFromGitRepo ( outputDir , dirs , cloneParentDir , repoName , url , null ) ; } }
Iterates through all projects in the given github organisation and generates an archetype for it