Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.netbeans.modules.maven.newproject;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.regex.Pattern;
import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.project.Project;
import org.netbeans.api.project.ProjectInformation;
import org.netbeans.api.project.ProjectManager;
import org.netbeans.api.templates.CreateDescriptor;
import org.netbeans.modules.maven.api.archetype.ProjectInfo;
import org.netbeans.modules.maven.model.Utilities;
import org.netbeans.modules.maven.model.pom.POMModel;
import org.netbeans.modules.maven.model.pom.POMModelFactory;
import org.netbeans.modules.xml.xam.ModelSource;
import org.netbeans.spi.project.ActionProgress;
import org.netbeans.spi.project.ActionProvider;
import org.netbeans.spi.project.ui.support.CommonProjectActions;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.util.Lookup;
import org.openide.util.NbBundle;
import org.openide.util.lookup.Lookups;
import org.openide.util.lookup.ProxyLookup;
public final class TemplateUtils {
/**
* Archetype to be used with the template.
*/
public static final String PARAM_ARCHETYPE = "archetype"; // NOI18N
/**
* Artifact ID for the new project.
*/
public static final String PARAM_ARTIFACT_ID = "artifactId"; // NOI18N
/**
* Group ID for the new project.
*/
public static final String PARAM_GROUP_ID = "groupId"; // NOI18N
/**
* Packaging for a project template.
*/
public static final String PARAM_PACKAGING = "packaging"; // NOI18N
/**
* Version for the new project, will default to {@link #PARAM_VERSION_DEFAULT 1.0-SNAPSHOT} if not specified.
*/
public static final String PARAM_VERSION = "version"; // NOI18N
/**
* Base package for the sources in the project
*/
public static final String PARAM_PACKAGE = "package"; // NOI18N
/**
* Version for the new project, will default to 1.0-SNAPSHOT if not specified.
*/
public static final String PARAM_VERSION_DEFAULT = "1.0-SNAPSHOT"; // NOI18N
/**
* Files to open after project creation. Comma-delimited list of
* file names, relative to the template directory.
*/
public static final String PARAM_TO_OPEN = "openFiles"; // NOI18N
/**
* If the parameter value is {@link Boolean#TRUE}, will build
* the project.
*/
public static final String PARAM_INITIAL_BUILD = "buildAfterCreate"; // NOI18N
/**
* If the parameter value is {@link Boolean#TRUE}, will prime the project,
* downloading the necessary dependent artifacts.
*/
public static final String PARAM_INITIAL_PRIME = "primedAfterCreate"; // NOI18N
/**
* Name of the created main class.
*/
public static final String PARAM_MAIN_CLASS_NAME = "mainClassName"; // NOI18N
/**
* The target directory
*/
public static final String PARAM_PROJDIR = CommonProjectActions.PROJECT_PARENT_FOLDER;
private TemplateUtils() {}
/**
* Performs post-creation tasks, like priming, build or file opens.
*/
@NbBundle.Messages({
"# {0} - project name",
"ProgressTitleBuild=Building project {0}",
"# {0} - project name",
"ProgressTitlePrime=Priming project {0}",
"# {0} - project name",
"ProgressTitleBuildFailed=Failed to build project {0}",
"# {0} - project name",
"ProgressTitlePrimeFailed=Failed to prime project {0}"
})
public static List afterTemplateCreation(
Map