當前位置: 首頁>>代碼示例>>Java>>正文


Java Model.setGroupId方法代碼示例

本文整理匯總了Java中org.apache.maven.model.Model.setGroupId方法的典型用法代碼示例。如果您正苦於以下問題:Java Model.setGroupId方法的具體用法?Java Model.setGroupId怎麽用?Java Model.setGroupId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.maven.model.Model的用法示例。


在下文中一共展示了Model.setGroupId方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ModelTree

import org.apache.maven.model.Model; //導入方法依賴的package包/類
/**
     * This is a tree of Maven artifacts, which are represented by {@link Model} objects.
     * The idea here is, given a list of Maven pom.xml {@link File} objects, create a tree
     * based on dependency among them, but specifying explicitly which Maven artifact should
     * be at the root of the tree. That means, if any artifact in the list is not a child,
     * directly or indirectly, of the root artifact, then it will end up no being in the tree.
     * <br>
     * As a result of building this tree, it is possible to know, out of the initial pom.xml files list,
     * which ones actually inherit, directly or not, from the root artifact. The result is retrieved
     * by calling {@link #getPomFilesInTree()}
     *
     * @param rootGroupId the group id of the artifact that should be at the root of the tree
     * @param rootArtifactId the artifact id of the artifact that should be at the root of the tree
     * @param rootVersion the version of the artifact that should be at the root of the tree
     * @param pomFiles a list of pom.xml files used to make the tree
     */
    public ModelTree(String rootGroupId, String rootArtifactId, String rootVersion, List<File> pomFiles) {
        Model rootModel = new Model();
        rootModel.setGroupId(rootGroupId);
        rootModel.setArtifactId(rootArtifactId);
        rootModel.setVersion(rootVersion);

        List<Model> models = new ArrayList<>();
        models.add(rootModel);

        for (File pomFile : pomFiles) {
            models.add(createModel(pomFile));
        }

// TODO we can comment this out in the future if we need this feature
//        modelsNotInTree = add(models);
        add(models);
    }
 
開發者ID:paypal,項目名稱:butterfly,代碼行數:34,代碼來源:ModelTree.java

示例2: pomFileWithDependencies

import org.apache.maven.model.Model; //導入方法依賴的package包/類
@And("^POM file with dependencies:$")
public void pomFileWithDependencies(List<MavenDependencySpec> dependencies) throws Throwable {
  for (MavenDependencySpec dependency : dependencies) {
    dependency.setExcludes(dependency.excludes);
  }

  Model model = new Model();
  model.setModelVersion("4.0.0");
  model.setGroupId("com.example");
  model.setArtifactId("example-artifact");
  model.setVersion("1.0.0-SNAPSHOT");
  model.setPackaging("pom");
  dependencies.forEach(model::addDependency);

  Path pomFile = projectDir.resolve("pom.xml");
  new MavenXpp3Writer().write(Files.newBufferedWriter(pomFile), model);
}
 
開發者ID:bsideup,項目名稱:gradle-maven-sync-plugin,代碼行數:18,代碼來源:GradleStepdefs.java

示例3: POMData

import org.apache.maven.model.Model; //導入方法依賴的package包/類
public POMData(ParentData parentData, String groupId, String artifactId, String versionId,
               List<DependencyData>
        dependencies, List<RepositoryData> repositories) throws IOException {
    Model model = new Model();
    parentData.write(model);
    model.setGroupId(groupId);
    model.setArtifactId(artifactId);
    model.setVersion(versionId);
    model.setModelVersion("4.0.0");
    dependencies.forEach((dependencyData -> dependencyData.write(model)));
    repositories.forEach((repositoryData -> repositoryData.write(model)));
    this.dependencies = dependencies;
    this.repositories = repositories;
    this.groupId = groupId;
    this.artifactId = artifactId;
    this.version = versionId;
    StringWriter writer = new StringWriter();
    new MavenXpp3Writer().write(writer, model);
    this.xml = writer.toString();
}
 
開發者ID:PizzaCrust,項目名稱:IodineToolkit,代碼行數:21,代碼來源:POMData.java

示例4: model

import org.apache.maven.model.Model; //導入方法依賴的package包/類
private ModelWrapper model(String projectName, String groupId) {
	Model parent = new Model();
	parent.setArtifactId(projectName);
	parent.setGroupId(groupId);
	return new ModelWrapper(parent);
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-release-tools,代碼行數:7,代碼來源:PomUpdaterTests.java

示例5: createProjectDependencyPomModel

import org.apache.maven.model.Model; //導入方法依賴的package包/類
private Model createProjectDependencyPomModel(Model processingPomModel) {
    Model templateModel = new Model();
    templateModel.setModelVersion(processingPomModel.getModelVersion());
    templateModel.setGroupId("org.processing.idea");
    templateModel.setArtifactId("core");
    templateModel.setVersion("1.0.0");

    List<Dependency> artifactDependencies = new ArrayList<>(6);

    String joglVersion = null;
    for (Dependency dependency : processingPomModel.getDependencies()) {
        if (dependency.getGroupId().equals("org.jogamp.jogl") && dependency.getArtifactId().equals("jogl")) {
            joglVersion = dependency.getVersion();
        }
    }

    if (joglVersion == null) {
        throw new IllegalStateException("Unable to determine JOGL version used for this build of Processing.");
    }

    Dependency core = new Dependency();
    core.setGroupId("org.processing");
    core.setArtifactId("core");
    core.setVersion(version.toString());
    artifactDependencies.add(core);

    Dependency pdfExport = new Dependency();
    pdfExport.setGroupId(VanillaLibrary.PDF_EXPORT.getGroupId());
    pdfExport.setArtifactId(VanillaLibrary.PDF_EXPORT.getArtifactId());
    pdfExport.setVersion(version.toString());
    artifactDependencies.add(pdfExport);

    Dependency serial = new Dependency();
    serial.setGroupId(VanillaLibrary.SERIAL.getGroupId());
    serial.setArtifactId(VanillaLibrary.SERIAL.getArtifactId());
    serial.setVersion(version.toString());
    artifactDependencies.add(serial);

    Dependency network = new Dependency();
    network.setGroupId(VanillaLibrary.NETWORK.getGroupId());
    network.setArtifactId(VanillaLibrary.NETWORK.getArtifactId());
    network.setVersion(version.toString());
    artifactDependencies.add(network);

    Dependency gluegenRt = new Dependency();
    gluegenRt.setGroupId("org.jogamp.gluegen");
    gluegenRt.setArtifactId("gluegen-rt-main");
    gluegenRt.setVersion(joglVersion);
    artifactDependencies.add(gluegenRt);

    Dependency joglAllMain = new Dependency();
    joglAllMain.setGroupId("org.jogamp.jogl");
    joglAllMain.setArtifactId("jogl-all-main");
    joglAllMain.setVersion(joglVersion);
    artifactDependencies.add(joglAllMain);

    if (SystemInfo.isMac) {
        Dependency appleExtensions = new Dependency();
        appleExtensions.setGroupId("com.apple");
        appleExtensions.setArtifactId("AppleJavaExtensions");
        appleExtensions.setVersion("LATEST");
        artifactDependencies.add(appleExtensions);
    }

    templateModel.setDependencies(artifactDependencies);

    return templateModel;
}
 
開發者ID:mistodev,項目名稱:processing-idea,代碼行數:69,代碼來源:CreateVersionedProcessingPom.java


注:本文中的org.apache.maven.model.Model.setGroupId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。