public ArchetypeConfiguration createArchetypeConfiguration(ArchetypeDefinition archetypeDefinition, Properties properties) { ArchetypeConfiguration configuration = new ArchetypeConfiguration(); log.debug("Creating ArchetypeConfiguration from ArchetypeDefinition and Properties"); configuration.setGroupId(archetypeDefinition.getGroupId()); configuration.setArtifactId(archetypeDefinition.getArtifactId()); configuration.setVersion(archetypeDefinition.getVersion()); Iterator propertiesIterator = properties.keySet().iterator(); while (propertiesIterator.hasNext()) { String property = (String) propertiesIterator.next(); if (!Constants.ARCHETYPE_GROUP_ID.equals(property) && !Constants.ARCHETYPE_ARTIFACT_ID.equals(property) && !Constants.ARCHETYPE_VERSION.equals(property)) { configuration.addRequiredProperty(property); log.debug("Adding requiredProperty " + property); configuration.setProperty(property, properties.getProperty(property)); log.debug("Adding property " + property + "=" + properties.getProperty(property)); } } return configuration; }
public void updateArchetypeConfiguration(ArchetypeConfiguration archetypeConfiguration, ArchetypeDefinition archetypeDefinition) { archetypeConfiguration.setGroupId(archetypeDefinition.getGroupId()); archetypeConfiguration.setArtifactId(archetypeDefinition.getArtifactId()); archetypeConfiguration.setVersion(archetypeDefinition.getVersion()); }
log.debug("Creating ArchetypeConfiguration from ArchetypeDefinition, MavenProject and Properties"); configuration.setGroupId(properties.getProperty(Constants.ARCHETYPE_GROUP_ID)); configuration.setArtifactId(properties.getProperty(Constants.ARCHETYPE_ARTIFACT_ID)); configuration.setVersion(properties.getProperty(Constants.ARCHETYPE_VERSION));
log.debug("Creating ArchetypeConfiguration from legacy descriptor and Properties"); configuration.setGroupId(properties.getProperty(Constants.ARCHETYPE_GROUP_ID, null)); configuration.setArtifactId(properties.getProperty(Constants.ARCHETYPE_ARTIFACT_ID, null)); configuration.setVersion(properties.getProperty(Constants.ARCHETYPE_VERSION, null));
log.debug("Creating ArchetypeConfiguration from fileset descriptor and Properties"); configuration.setGroupId(properties.getProperty(Constants.ARCHETYPE_GROUP_ID, null)); configuration.setArtifactId(properties.getProperty(Constants.ARCHETYPE_ARTIFACT_ID, null)); configuration.setVersion(properties.getProperty(Constants.ARCHETYPE_VERSION, null));