if ( contextPropertyValue != null && contextPropertyValue.trim().length() > 0 ) if ( getLogger().isDebugEnabled() ) getLogger().debug( "Replacing property '" + propertyToken + "' in file path '" + filePath + "' with value '" + contextPropertyValue + "'." ); getLogger().warn( "Property '" + propertyToken + "' was not specified, so the token in '" + filePath + "' is not being replaced." ); if ( getLogger().isDebugEnabled() ) getLogger().debug( "Final interpolated file path: '" + interpolatedResult + "'" );
private void processFilesetProject( final AbstractArchetypeDescriptor archetypeDescriptor, final String moduleId, final List<String> archetypeResources, final File pom, final ZipFile archetypeZipFile, String moduleOffset, final Context context, final String packageName, final File outputDirectoryFile, final File basedirPom ) throws DocumentException, XmlPullParserException, ArchetypeGenerationFailure, InvalidPackaging, IOException, FileNotFoundException, OutputFileExists { getLogger().debug( "Processing fileset project moduleId " + moduleId ); getLogger().debug( "Processing fileset project pom " + pom ); getLogger().debug( "Processing fileset project moduleOffset " + moduleOffset ); getLogger().debug( "Processing fileset project outputDirectoryFile " + outputDirectoryFile ); getLogger().debug( "Processing fileset project basedirPom " + basedirPom ); if ( basedirPom.exists() ) { processPomWithParent( context, pom, moduleOffset, basedirPom, moduleId ); } else { processPom( context, pom, moduleOffset ); } processArchetypeTemplates( archetypeDescriptor, archetypeResources, archetypeZipFile, moduleOffset, context, packageName, outputDirectoryFile ); }
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 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 ); }
if ( iterator.hasNext() ) getLogger().debug( "Processing filesets" + "\n " + archetypeResources ); getLogger().debug( " Processing fileset " + fileSet + " -> " + fileSetResources.size() + ":\n " + fileSetResources ); failIfExists ); getLogger().debug( " Processed " + processed + " files." ); getLogger().debug( " Copying fileset " + fileSet + " -> " + fileSetResources.size() + ":\n " + fileSetResources ); outputDirectoryFile, archetypeZipFile, moduleOffset, failIfExists, context ); getLogger().debug( " Copied " + copied + " files." ); getLogger().debug( "Processed " + count + " filesets" );
context.put( Constants.PACKAGE_IN_PATH_FORMAT, packageInPathFormat ); if ( getLogger().isInfoEnabled() ) getLogger().info( "----------------------------------------------------------------------------" ); getLogger().info( "Using following parameters for creating project from Archetype: " + request.getArchetypeArtifactId() + ":" + request.getArchetypeVersion() ); getLogger().info( "----------------------------------------------------------------------------" ); getLogger().info( "Parameter: " + Constants.GROUP_ID + ", Value: " + request.getGroupId() ); getLogger().info( "Parameter: " + Constants.ARTIFACT_ID + ", Value: " + request.getArtifactId() ); getLogger().info( "Parameter: " + Constants.VERSION + ", Value: " + request.getVersion() ); getLogger().info( "Parameter: " + Constants.PACKAGE + ", Value: " + request.getPackage() ); getLogger().info( "Parameter: " + Constants.PACKAGE_IN_PATH_FORMAT + ", Value: " + packageInPathFormat ); if ( getLogger().isInfoEnabled() ) getLogger().info( "Parameter: " + key + ", Value: " + value );
getLogger().debug( "Processing module " + artifactId ); getLogger().debug( "Processing module rootArtifactId " + rootArtifactId ); getLogger().debug( "Processing module pom " + pom ); getLogger().debug( "Processing module moduleOffset " + moduleOffset ); getLogger().debug( "Processing module outputDirectoryFile " + outputDirectoryFile ); getLogger().debug( artifactId + " has modules (" + archetypeDescriptor.getModules() + ")" ); getLogger().debug( "Processed " + artifactId );
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(); } }
getLogger().debug( "Processing partial archetype " + archetypeDescriptor.getName() ); if ( outputDirectoryFile.exists() ) getLogger().info( "Modules ignored in partial mode" ); getLogger().debug( "Processing complete archetype " + archetypeDescriptor.getName() ); if ( outputDirectoryFile.exists() && pom.exists() ) getLogger().warn( "The directory " + outputDirectoryFile.getPath() + " already exists." ); if ( postGenerationScript != null ) getLogger().info( "Executing " + Constants.ARCHETYPE_POST_GENERATION_SCRIPT + " post-generation script" ); if ( getLogger().isInfoEnabled() ) getLogger().info( "Project created from Archetype in dir: " + outputDirectoryFile.getAbsolutePath() );