+ Public API for creating New Project wizards based on the maven-archetype-plugin. +
+This document lists changes made to the Maven Project API.
+ + +@FOOTER@
+ + ++ The Maven Archetype API provides some miscellaneous APIs related to + maven-archetype-plugin. +
++ creating of New Project wizards based on the maven-archetype-plugin. +
++ "Projects/org-netbeans-modules-maven/Archetypes" folder contains fileobjects + that represent archetypes. The archetypes are defined by the following file attributes: +
+groupId | mandatory | |
artifactId | mandatory | |
version | mandatory | |
repository | optional | url of the archetype's repository |
nameBundleKey | optional | key in bundle file that holds localized name |
descriptionBundleKey | optional | key in bundle file that holds localized description |
+ No environment or Java System properties. +
++ XXX no answer for arch-quality +
++ XXX no answer for arch-time +
++ XXX no answer for arch-what +
++ XXX no answer for compat-deprecation +
++ XXX no answer for compat-i18n +
++ XXX no answer for compat-standards +
++ XXX no answer for compat-version +
++ XXX no answer for dep-jre +
++ XXX no answer for dep-jrejdk +
++ XXX no answer for dep-non-nb +
++ XXX no answer for dep-platform +
++ No special requirements here. +
++ XXX no answer for deploy-jar +
++ XXX no answer for deploy-nbm +
++ XXX no answer for deploy-packages +
++ XXX no answer for deploy-shared +
++ XXX no answer for exec-ant-tasks +
++ XXX no answer for exec-classloader +
++ XXX no answer for exec-component +
++ XXX no answer for exec-introspection +
++ XXX no answer for exec-privateaccess +
++ XXX no answer for exec-process +
++ XXX no answer for exec-reflection +
++ XXX no answer for exec-threading +
++ XXX no answer for format-clipboard +
++ XXX no answer for format-dnd +
++ XXX no answer for format-types +
++ XXX no answer for lookup-lookup +
++ XXX no answer for lookup-register +
++ XXX no answer for lookup-remove +
++ XXX no answer for perf-exit +
++ XXX no answer for perf-huge_dialogs +
++ XXX no answer for perf-limit +
++ XXX no answer for perf-mem +
++ XXX no answer for perf-menus +
++ XXX no answer for perf-progress +
++ XXX no answer for perf-scale +
++ XXX no answer for perf-spi +
++ XXX no answer for perf-startup +
++ XXX no answer for perf-wakeup +
++ XXX no answer for resources-file +
++ XXX no answer for resources-layer +
++ XXX no answer for resources-mask +
++ XXX no answer for resources-preferences +
++ XXX no answer for security-grant +
++ XXX no answer for security-policy +
+null
if none available
+ * @since 1.0
+ */
+ public String getDescription() {
+ return delegate.getDescription();
+ }
+
+ /**
+ * Sets the description.
+ *
+ * @param description
+ * @since 1.0
+ */
+ public void setDescription(String description) {
+ delegate.setDescription(description);
+ }
+
+ /**
+ * Sets the repository. Is an optional property.
+ *
+ * @param repository
+ * @since 1.0
+ */
+ public void setRepository(String repository) {
+ delegate.setRepository(repository);
+ }
+
+ /**
+ * Returns the repository. Is an optional property.
+ *
+ * @return the repository or null
if none available
+ * @since 1.0
+ */
+ public String getRepository() {
+ return delegate.getRepository();
+ }
+
+ @Override
+ public int hashCode() {
+ return getGroupId().trim().hashCode() + 13 * getArtifactId().trim().hashCode() + 23 * getVersion().trim().hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof Archetype)) {
+ return false;
+ }
+ Archetype ar1 = (Archetype)obj;
+ boolean gr = ar1.getGroupId().trim().equals(getGroupId().trim());
+ if (!gr) {
+ return false;
+ }
+ boolean ar = ar1.getArtifactId().trim().equals(getArtifactId().trim());
+ if (!ar) {
+ return false;
+ }
+ boolean ver = ar1.getVersion().trim().equals(getVersion().trim());
+ return ver;
+ }
+
+ @Override
+ public String toString() {
+ return delegate.toString();
+ }
+
+}
Index: api.maven.archetype/src/org/netbeans/api/maven/archetype/ArchetypeWizards.java
--- api.maven.archetype/src/org/netbeans/api/maven/archetype/ArchetypeWizards.java
+++ api.maven.archetype/src/org/netbeans/api/maven/archetype/ArchetypeWizards.java
@@ -0,0 +1,140 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License. When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2010 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.api.maven.archetype;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+import java.util.Set;
+import org.netbeans.api.annotations.common.NullAllowed;
+import org.netbeans.api.templates.TemplateRegistration;
+import org.openide.WizardDescriptor;
+import org.openide.filesystems.FileObject;
+
+/**
+ * Utilities for creating New Project wizards based on maven-archetype-plugin.
+ *
+ * @author Tomas Stupka
+ * @since 1.0
+ */
+public class ArchetypeWizards {
+
+ private ArchetypeWizards() { }
+
+ /**
+ * Run a single archetype.
+ *
+ * @param projDir the new project directory (must be normalized first!) (note: parent dir is actually passed to plugin, i.e. assumes that project name matches this basedir)
+ * @param vi metadata for new project
+ * @param arch the archetype to process
+ * @param additionalProperties any additional archetype properties, or null
+ * @param updateLastUsedProjectDir true to update last-used project directory for next wizard run
+ * @since 1.0
+ * @throws java.io.IOException
+ */
+ public static void createFromArchetype(File projDir, ProjectInfo vi, Archetype arch, @NullAllowed Map