/** * Note we pass in the {@link io.hawt.aether.AetherFacade} to ensure that the mvn: URL handler is initialised first before we * start to lazily create the git repository * * @param importUrls the list of app zips URLs to be imported to the library on startup. Supports mvn:group/artifact/version/type/classifier formats in addition to http:, file: etc. */ @Produces @Singleton public GitFacade createGit(@ConfigProperty(name = "IMPORT_APP_URLS") String importUrls, AetherFacade aether) throws Exception { GitFacade git = new GitFacade(); System.out.println("Importing urls: " + importUrls); git.setInitialImportURLs(importUrls); git.setCloneRemoteRepoOnStartup(false); File configDir = new File("library"); if (configDir.exists()) { Files.recursiveDelete(configDir); } configDir.mkdirs(); git.setConfigDirectory(configDir); git.init(); System.out.println("Created library at at: " + configDir.getAbsolutePath()); return git; }
private static void initaliseGitStuff() throws Exception { GitFacade gitFacade = new GitFacade(); gitFacade.setCloneRemoteRepoOnStartup(false); gitFacade.setPullOnStartup(false); gitFacade.setConfigDirName("hawtio-config"); String importUrls = System.getenv("JUBE_IMPORT_URLS"); if (importUrls != null) { gitFacade.setInitialImportURLs(importUrls); } gitFacade.init(); }