private void setProperty( ArchetypeConfiguration configuration, Properties properties, String key ) { String property = properties.getProperty( key ); if ( property != null ) { configuration.setProperty( key, property ); } }
configuration.setProperty( key, value ); getLogger().debug( "Setting property " + key + "=" + value ); configuration.setProperty( key, defaultValue ); getLogger().debug( "Setting property " + key + "=" + defaultValue ); if ( postGenerationGoals != null ) configuration.setProperty( Constants.ARCHETYPE_POST_GENERATION_GOALS, postGenerationGoals );
private void setProperty( ArchetypeConfiguration configuration, Properties properties, String key ) { String property = properties.getProperty( key ); if ( property != null ) { configuration.setProperty( key, property ); } }
configuration.setProperty( key, value ); getLogger().debug( "Setting property " + key + "=" + value ); configuration.setProperty( key, defaultValue ); getLogger().debug( "Setting property " + key + "=" + defaultValue ); if ( postGenerationGoals != null ) configuration.setProperty( Constants.ARCHETYPE_POST_GENERATION_GOALS, postGenerationGoals );
private void restoreCommandLineProperties( ArchetypeConfiguration archetypeConfiguration, Properties executionProperties ) { getLogger().debug( "Restoring command line properties" ); for ( String property : archetypeConfiguration.getRequiredProperties() ) { if ( executionProperties.containsKey( property ) ) { archetypeConfiguration.setProperty( property, executionProperties.getProperty( property ) ); getLogger().debug( "Restored " + property + "=" + archetypeConfiguration.getProperty( property ) ); } } }
private void restoreCommandLineProperties( ArchetypeConfiguration archetypeConfiguration, Properties executionProperties ) { getLogger().debug( "Restoring command line properties" ); for ( String property : archetypeConfiguration.getRequiredProperties() ) { if ( executionProperties.containsKey( property ) ) { archetypeConfiguration.setProperty( property, executionProperties.getProperty( property ) ); getLogger().debug( "Restored " + property + "=" + archetypeConfiguration.getProperty( property ) ); } } }
private void addOldRequiredProperty( ArchetypeConfiguration configuration, Properties properties, String key, String defaultValue, boolean initPropertyWithDefault ) { getLogger().debug( "Adding requiredProperty " + key ); configuration.addRequiredProperty( key ); String property = properties.getProperty( key ); if ( property != null ) { configuration.setProperty( key, property ); configuration.setDefaultProperty( key, property ); } else if ( defaultValue != null ) { if ( initPropertyWithDefault ) { configuration.setProperty( key, defaultValue ); } configuration.setDefaultProperty( key, defaultValue ); } getLogger().debug( "Setting property " + key + "=" + configuration.getProperty( key ) ); }
private void addRequiredProperty( ArchetypeConfiguration configuration, Properties properties, String key, String defaultValue ) { getLogger().debug( "Adding requiredProperty " + key ); configuration.addRequiredProperty( key ); if ( defaultValue != null ) { configuration.setDefaultProperty( key, defaultValue ); } if ( properties.getProperty( key ) != null ) { configuration.setProperty( key, properties.getProperty( key ) ); getLogger().debug( "Setting property " + key + "=" + configuration.getProperty( Constants.GROUP_ID ) ); } }
private void addRequiredProperty( ArchetypeConfiguration configuration, Properties properties, String key, String defaultValue ) { getLogger().debug( "Adding requiredProperty " + key ); configuration.addRequiredProperty( key ); if ( defaultValue != null ) { configuration.setDefaultProperty( key, defaultValue ); } if ( properties.getProperty( key ) != null ) { configuration.setProperty( key, properties.getProperty( key ) ); getLogger().debug( "Setting property " + key + "=" + configuration.getProperty( Constants.GROUP_ID ) ); } }
private void addOldRequiredProperty( ArchetypeConfiguration configuration, Properties properties, String key, String defaultValue, boolean initPropertyWithDefault ) { getLogger().debug( "Adding requiredProperty " + key ); configuration.addRequiredProperty( key ); String property = properties.getProperty( key ); if ( property != null ) { configuration.setProperty( key, property ); configuration.setDefaultProperty( key, property ); } else if ( defaultValue != null ) { if ( initPropertyWithDefault ) { configuration.setProperty( key, defaultValue ); } configuration.setDefaultProperty( key, defaultValue ); } getLogger().debug( "Setting property " + key + "=" + configuration.getProperty( key ) ); }
public ArchetypeConfiguration createArchetypeConfiguration( MavenProject project, ArchetypeDefinition archetypeDefinition, Properties properties ) { getLogger().debug( "Creating ArchetypeConfiguration from ArchetypeDefinition, MavenProject and Properties" ); ArchetypeConfiguration configuration = createArchetypeConfiguration( properties ); for ( Iterator<?> requiredProperties = properties.keySet().iterator(); requiredProperties.hasNext(); ) { String requiredProperty = (String) requiredProperties.next(); if ( !requiredProperty.contains( "." ) ) { getLogger().debug( "Adding requiredProperty " + requiredProperty ); configuration.addRequiredProperty( requiredProperty ); configuration.setProperty( requiredProperty, properties.getProperty( requiredProperty ) ); getLogger().debug( "Setting property " + requiredProperty + "=" + configuration.getProperty( requiredProperty ) ); } } addRequiredProperty( configuration, properties, Constants.GROUP_ID, project.getGroupId() ); addRequiredProperty( configuration, properties, Constants.ARTIFACT_ID, project.getArtifactId() ); addRequiredProperty( configuration, properties, Constants.VERSION, project.getVersion() ); addRequiredProperty( configuration, properties, Constants.PACKAGE, null ); setProperty( configuration, properties, Constants.ARCHETYPE_GROUP_ID ); setProperty( configuration, properties, Constants.ARCHETYPE_ARTIFACT_ID ); setProperty( configuration, properties, Constants.ARCHETYPE_VERSION ); setProperty( configuration, properties, Constants.ARCHETYPE_URL ); setProperty( configuration, properties, Constants.ARCHETYPE_DESCRIPTION ); return configuration; }
public ArchetypeConfiguration createArchetypeConfiguration( MavenProject project, ArchetypeDefinition archetypeDefinition, Properties properties ) { getLogger().debug( "Creating ArchetypeConfiguration from ArchetypeDefinition, MavenProject and Properties" ); ArchetypeConfiguration configuration = createArchetypeConfiguration( properties ); for ( Iterator<?> requiredProperties = properties.keySet().iterator(); requiredProperties.hasNext(); ) { String requiredProperty = (String) requiredProperties.next(); if ( !requiredProperty.contains( "." ) ) { getLogger().debug( "Adding requiredProperty " + requiredProperty ); configuration.addRequiredProperty( requiredProperty ); configuration.setProperty( requiredProperty, properties.getProperty( requiredProperty ) ); getLogger().debug( "Setting property " + requiredProperty + "=" + configuration.getProperty( requiredProperty ) ); } } addRequiredProperty( configuration, properties, Constants.GROUP_ID, project.getGroupId() ); addRequiredProperty( configuration, properties, Constants.ARTIFACT_ID, project.getArtifactId() ); addRequiredProperty( configuration, properties, Constants.VERSION, project.getVersion() ); addRequiredProperty( configuration, properties, Constants.PACKAGE, null ); setProperty( configuration, properties, Constants.ARCHETYPE_GROUP_ID ); setProperty( configuration, properties, Constants.ARCHETYPE_ARTIFACT_ID ); setProperty( configuration, properties, Constants.ARCHETYPE_VERSION ); setProperty( configuration, properties, Constants.ARCHETYPE_URL ); setProperty( configuration, properties, Constants.ARCHETYPE_DESCRIPTION ); return configuration; }
archetypeConfiguration.setProperty( requiredProperty, value ); archetypeConfiguration.getPropertyValidationRegex( requiredProperty ) ); archetypeConfiguration.setProperty( requiredProperty, value ); "Using property: " + requiredProperty + " = " + archetypeConfiguration.getProperty( requiredProperty ) ); archetypeConfiguration.setProperty( requiredProperty, archetypeConfiguration.getProperty( requiredProperty ) ); archetypeConfiguration.setProperty( requiredProperty, value ); context.put( requiredProperty, value );
archetypeConfiguration.setProperty( requiredProperty, value ); archetypeConfiguration.getPropertyValidationRegex( requiredProperty ) ); archetypeConfiguration.setProperty( requiredProperty, value ); "Using property: " + requiredProperty + " = " + archetypeConfiguration.getProperty( requiredProperty ) ); archetypeConfiguration.setProperty( requiredProperty, archetypeConfiguration.getProperty( requiredProperty ) ); archetypeConfiguration.setProperty( requiredProperty, value ); context.put( requiredProperty, value );
archetypeConfiguration.setProperty( Constants.GROUP_ID, archetypeCreationQueryer.getGroupId( archetypeConfiguration.getDefaultValue( Constants.GROUP_ID ) ) ); archetypeConfiguration.setProperty( Constants.ARTIFACT_ID, archetypeCreationQueryer.getArtifactId( archetypeConfiguration.getDefaultValue( Constants.ARTIFACT_ID ) ) ); archetypeConfiguration.setProperty( Constants.VERSION, archetypeCreationQueryer.getVersion( archetypeConfiguration.getDefaultValue( Constants.VERSION ) ) ); archetypeConfiguration.setProperty( Constants.PACKAGE, archetypeCreationQueryer.getPackage( StringUtils.isEmpty( resolvedPackage ) ? archetypeConfiguration.getDefaultValue( Constants.PACKAGE ) archetypeConfiguration.getDefaultValue( propertyKey ) ); archetypeConfiguration.setDefaultProperty( propertyKey, replacementValue ); archetypeConfiguration.setProperty( propertyKey, replacementValue );
archetypeConfiguration.setProperty( Constants.GROUP_ID, archetypeCreationQueryer.getGroupId( archetypeConfiguration.getDefaultValue( Constants.GROUP_ID ) ) ); archetypeConfiguration.setProperty( Constants.ARTIFACT_ID, archetypeCreationQueryer.getArtifactId( archetypeConfiguration.getDefaultValue( Constants.ARTIFACT_ID ) ) ); archetypeConfiguration.setProperty( Constants.VERSION, archetypeCreationQueryer.getVersion( archetypeConfiguration.getDefaultValue( Constants.VERSION ) ) ); archetypeConfiguration.setProperty( Constants.PACKAGE, archetypeCreationQueryer.getPackage( StringUtils.isEmpty( resolvedPackage ) ? archetypeConfiguration.getDefaultValue( Constants.PACKAGE ) archetypeConfiguration.getDefaultValue( propertyKey ) ); archetypeConfiguration.setDefaultProperty( propertyKey, replacementValue ); archetypeConfiguration.setProperty( propertyKey, replacementValue );