private void processPom(Context context, File pom, String moduleOffset) throws Exception { log.debug("Processing pom " + pom); processTemplate(pom, context, Constants.ARCHETYPE_RESOURCES + getOffsetSeparator(moduleOffset) + Constants.ARCHETYPE_POM, getEncoding(null), true); }
private void processPom( Context context, File pom, String moduleOffset ) throws OutputFileExists, ArchetypeGenerationFailure { getLogger().debug( "Processing pom " + pom ); processTemplate( pom, context, Constants.ARCHETYPE_RESOURCES + getOffsetSeparator( moduleOffset ) + Constants.ARCHETYPE_POM, getEncoding( null ), true ); }
private void processPomWithMerge(Context context, File pom, String moduleOffset) throws Exception { log.debug("Processing pom " + pom + " with merge"); File temporaryPom=getTemporaryFile(pom); processTemplate(temporaryPom, context, Constants.ARCHETYPE_RESOURCES + getOffsetSeparator(moduleOffset) + Constants.ARCHETYPE_POM, getEncoding(null), true); pomManager.mergePoms(pom, temporaryPom); // getTemporaryFile sets deleteOnExit. Lets try to delete and then make sure deleteOnExit is // still set. Windows has issues deleting files with certain JDKs. try { FileUtils.forceDelete(temporaryPom); } catch (IOException e) { temporaryPom.deleteOnExit(); } }
private void processPomWithMerge( Context context, File pom, String moduleOffset ) throws OutputFileExists, IOException, XmlPullParserException, ArchetypeGenerationFailure { getLogger().debug( "Processing pom " + pom + " with merge" ); File temporaryPom = getTemporaryFile( pom ); processTemplate( temporaryPom, context, Constants.ARCHETYPE_RESOURCES + getOffsetSeparator( moduleOffset ) + Constants.ARCHETYPE_POM, getEncoding( null ), true ); pomManager.mergePoms( pom, temporaryPom ); // getTemporaryFile sets deleteOnExit. Lets try to delete and then make sure deleteOnExit is // still set. Windows has issues deleting files with certain JDKs. try { FileUtils.forceDelete( temporaryPom ); } catch ( IOException e ) { temporaryPom.deleteOnExit(); } }
private void processPomWithParent(Context context, File pom, String moduleOffset, File basedirPom, String moduleId) throws Exception, IOException, InvalidPackaging, ArchetypeGenerationFailure { log.debug("Processing pom " + pom + " with parent " + basedirPom); processTemplate(pom, context, Constants.ARCHETYPE_RESOURCES + getOffsetSeparator(moduleOffset) + Constants.ARCHETYPE_POM, getEncoding(null), true); log.debug("Adding module " + moduleId); pomManager.addModule(basedirPom, moduleId); pomManager.addParent(pom, basedirPom); }
private void processPomWithParent( Context context, File pom, String moduleOffset, File basedirPom, String moduleId ) throws OutputFileExists, XmlPullParserException, DocumentException, IOException, InvalidPackaging, ArchetypeGenerationFailure { getLogger().debug( "Processing pom " + pom + " with parent " + basedirPom ); processTemplate( pom, context, Constants.ARCHETYPE_RESOURCES + getOffsetSeparator( moduleOffset ) + Constants.ARCHETYPE_POM, getEncoding( null ), true ); getLogger().debug( "Adding module " + moduleId ); pomManager.addModule( basedirPom, moduleId ); pomManager.addParent( pom, basedirPom ); }
private void processTemplates(String packageName, File outputDirectoryFile, Context context, AbstractArchetypeDescriptor archetypeDescriptor, List<String> archetypeResources, ZipFile archetypeZipFile, String moduleOffset, boolean failIfExists) throws Exception { for (FileSet fileSet : archetypeDescriptor.getFileSets()) { List<String> fileSetResources=archetypeFilesResolver.filterFiles(moduleOffset, fileSet, archetypeResources); // This creates an empty directory, even if there is no file to process // Fix for ARCHETYPE-57 getOutputFile(moduleOffset, fileSet.getDirectory(), outputDirectoryFile, fileSet.isPackaged(), packageName, moduleOffset, context).mkdirs(); if (fileSet.isFiltered()) { log.debug("Processing fileset " + fileSet + "\n\n\n\n" + fileSetResources + "\n\n" + archetypeResources + "\n\n"); processFileSet(fileSet.getDirectory(), fileSetResources, fileSet.isPackaged(), packageName, context, outputDirectoryFile, moduleOffset, getEncoding(fileSet.getEncoding()), failIfExists); log.debug("Processed " + fileSetResources.size() + " files"); } else { log.debug("Copying fileset " + fileSet); copyFiles(fileSet.getDirectory(), fileSetResources, fileSet.isPackaged(), packageName, outputDirectoryFile, archetypeZipFile, moduleOffset, failIfExists, context); log.debug("Copied " + fileSetResources.size() + " files"); } } }
context, outputDirectoryFile, moduleOffset, getEncoding( fileSet.getEncoding() ), failIfExists );