当前位置: 首页>>代码示例>>Java>>正文


Java Dependency.setGroupId方法代码示例

本文整理汇总了Java中org.apache.maven.model.Dependency.setGroupId方法的典型用法代码示例。如果您正苦于以下问题:Java Dependency.setGroupId方法的具体用法?Java Dependency.setGroupId怎么用?Java Dependency.setGroupId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.maven.model.Dependency的用法示例。


在下文中一共展示了Dependency.setGroupId方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addDependency

import org.apache.maven.model.Dependency; //导入方法依赖的package包/类
private void addDependency(MavenDependencyInternal dependency, String artifactId, String scope, String type, String classifier) {
    Dependency mavenDependency = new Dependency();
    mavenDependency.setGroupId(dependency.getGroupId());
    mavenDependency.setArtifactId(artifactId);
    mavenDependency.setVersion(mapToMavenSyntax(dependency.getVersion()));
    mavenDependency.setType(type);
    mavenDependency.setScope(scope);
    mavenDependency.setClassifier(classifier);

    for (ExcludeRule excludeRule : dependency.getExcludeRules()) {
        Exclusion exclusion = new Exclusion();
        exclusion.setGroupId(GUtil.elvis(excludeRule.getGroup(), "*"));
        exclusion.setArtifactId(GUtil.elvis(excludeRule.getModule(), "*"));
        mavenDependency.addExclusion(exclusion);
    }

    getModel().addDependency(mavenDependency);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:19,代码来源:MavenPomFileGenerator.java

示例2: getDependencyList

import org.apache.maven.model.Dependency; //导入方法依赖的package包/类
public List getDependencyList( ArtifactItem item )
{
    Dependency dep = new Dependency();
    dep.setArtifactId( item.getArtifactId() );
    dep.setClassifier( item.getClassifier() );
    dep.setGroupId( item.getGroupId() );
    dep.setType( item.getType() );
    dep.setVersion( "2.0-SNAPSHOT" );

    Dependency dep2 = new Dependency();
    dep2.setArtifactId( item.getArtifactId() );
    dep2.setClassifier( "classifier" );
    dep2.setGroupId( item.getGroupId() );
    dep2.setType( item.getType() );
    dep2.setVersion( "2.1" );

    List list = new ArrayList( 2 );
    list.add( dep2 );
    list.add( dep );

    return list;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:23,代码来源:TestUnpackMojo.java

示例3: getDependencyMgtList

import org.apache.maven.model.Dependency; //导入方法依赖的package包/类
public List getDependencyMgtList( ArtifactItem item )
{
    Dependency dep = new Dependency();
    dep.setArtifactId( item.getArtifactId() );
    dep.setClassifier( item.getClassifier() );
    dep.setGroupId( item.getGroupId() );
    dep.setType( item.getType() );
    dep.setVersion( "3.0-SNAPSHOT" );

    Dependency dep2 = new Dependency();
    dep2.setArtifactId( item.getArtifactId() );
    dep2.setClassifier( "classifier" );
    dep2.setGroupId( item.getGroupId() );
    dep2.setType( item.getType() );
    dep2.setVersion( "3.1" );

    List list = new ArrayList( 2 );
    list.add( dep2 );
    list.add( dep );

    return list;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:23,代码来源:TestUnpackMojo.java

示例4: createDependency

import org.apache.maven.model.Dependency; //导入方法依赖的package包/类
private Dependency createDependency( Artifact artifact )
{
    Dependency dep = new Dependency();
    dep.setArtifactId( artifact.getArtifactId() );
    if ( artifact.hasClassifier() )
    {
        dep.setClassifier( artifact.getClassifier() );
    }
    dep.setGroupId( artifact.getGroupId() );
    dep.setOptional( artifact.isOptional() );
    dep.setScope( artifact.getScope() );
    dep.setType( artifact.getType() );
    if ( useBaseVersion )
    {
        dep.setVersion( artifact.getBaseVersion() );
    }
    else
    {
        dep.setVersion( artifact.getVersion() );
    }
    return dep;
}
 
开发者ID:javiersigler,项目名称:apache-maven-shade-plugin,代码行数:23,代码来源:ShadeMojo.java

示例5: getDependency

import org.apache.maven.model.Dependency; //导入方法依赖的package包/类
private Dependency getDependency(String coordinates, String scope) {
  String[] coordinateArray = coordinates.split(":");
  Preconditions.checkState(coordinateArray.length == 3);
  Dependency dependency = new Dependency();
  dependency.setGroupId(coordinateArray[0]);
  dependency.setArtifactId(coordinateArray[1]);
  dependency.setVersion(coordinateArray[2]);
  dependency.setScope(scope);
  return dependency;
}
 
开发者ID:bazelbuild,项目名称:migration-tooling,代码行数:11,代码来源:ResolverTest.java

示例6: smartTestingProviderDependency

import org.apache.maven.model.Dependency; //导入方法依赖的package包/类
private Dependency smartTestingProviderDependency() {
    final Dependency smartTestingSurefireProvider = new Dependency();
    smartTestingSurefireProvider.setGroupId("org.arquillian.smart.testing");
    smartTestingSurefireProvider.setArtifactId("surefire-provider");
    smartTestingSurefireProvider.setVersion(ExtensionVersion.version().toString());
    smartTestingSurefireProvider.setScope("runtime");
    smartTestingSurefireProvider.setClassifier("shaded");
    return smartTestingSurefireProvider;
}
 
开发者ID:arquillian,项目名称:smart-testing,代码行数:10,代码来源:DependencyResolver.java

示例7: createDependencyFromCoordinates

import org.apache.maven.model.Dependency; //导入方法依赖的package包/类
static Dependency createDependencyFromCoordinates(String coordinatesString, boolean excludeTransitive) {
    final String[] coordinates = coordinatesString.split(":");
    int amountOfCoordinates = coordinates.length;
    if (amountOfCoordinates < 2) {
        throw new IllegalArgumentException(
            "Coordinates of the specified strategy [" + coordinatesString + "] doesn't have the correct format.");
    }
    final Dependency dependency = new Dependency();
    dependency.setGroupId(coordinates[0]);
    dependency.setArtifactId(coordinates[1]);
    if (amountOfCoordinates == 3) {
        dependency.setVersion(coordinates[2]);
    } else if (amountOfCoordinates >= 4) {
        dependency.setType(coordinates[2].isEmpty() ? "jar" : coordinates[2]);
        dependency.setClassifier(coordinates[3]);
    }
    if (amountOfCoordinates >= 5) {
        dependency.setVersion(coordinates[4]);
    }
    if (amountOfCoordinates == 6) {
        dependency.setScope(coordinates[5]);
    }
    if (dependency.getVersion() == null || dependency.getVersion().isEmpty()) {
        dependency.setVersion(ExtensionVersion.version().toString());
    }
    if (excludeTransitive) {
        Exclusion exclusion = new Exclusion();
        exclusion.setGroupId("*");
        exclusion.setArtifactId("*");
        dependency.setExclusions(Arrays.asList(exclusion));
    }
    return dependency;
}
 
开发者ID:arquillian,项目名称:smart-testing,代码行数:34,代码来源:MavenCoordinatesResolver.java

示例8: createDependency

import org.apache.maven.model.Dependency; //导入方法依赖的package包/类
private Dependency createDependency(String groupId, String artifactId, String version) {
    Dependency dependency = new Dependency();
    dependency.setGroupId(groupId);
    dependency.setArtifactId(artifactId);
    dependency.setVersion(version);
    return dependency;
}
 
开发者ID:arquillian,项目名称:smart-testing,代码行数:8,代码来源:CustomProvidersTest.java

示例9: write

import org.apache.maven.model.Dependency; //导入方法依赖的package包/类
void write(Model model) {
    Dependency dependency = new Dependency();
    dependency.setGroupId(groupId);
    dependency.setArtifactId(artifactId);
    dependency.setVersion(version);
    model.addDependency(dependency);
}
 
开发者ID:PizzaCrust,项目名称:IodineToolkit,代码行数:8,代码来源:DependencyData.java

示例10: processModules

import org.apache.maven.model.Dependency; //导入方法依赖的package包/类
public void processModules(ProjectBuildingRequest projectBuildingRequest, MavenProject project) {
	String modulesText = project.getProperties().getProperty(PROP_CONTRACTORS);
	if (modulesText == null || modulesText.trim().isEmpty()) {
		if (Flag.verbose()) {
			logger.info("No available modules in '{}'", PROP_CONTRACTORS);
		} else if (logger.isDebugEnabled()) {
			logger.debug("No available modules in '{}'", PROP_CONTRACTORS);
		}
		return;
	}
	String[] modulesArray = modulesText.split("[\\s]*[,\\n][\\s]*");
	Set<String> modulesSet = Arrays.stream(modulesArray).collect(Collectors.toSet());
	modulesSet.add("com.commsen.em.contractors:em.contractors.runtime:" + VAL_EXTENSION_VERSION);
	for (String moduleText : modulesSet) {
		String[] coordinates = moduleText.split(":");
		if (coordinates.length != 3) {
			logger.warn("Invalid maven coordinates for module '{}'! It will be ignored!", moduleText);
			continue;
		}

		Dependency dependency = new Dependency();
		dependency.setGroupId(coordinates[0]);
		dependency.setArtifactId(coordinates[1]);
		dependency.setVersion(coordinates[2]);
		dependency.setScope("runtime");
		dependency.setType("pom");

		try {
			Artifact pomArtifact = dependencies.asArtifact(projectBuildingRequest, dependency);
			dependency.setType("jar");
			MavenXpp3Reader reader = new MavenXpp3Reader();
			Model model = reader.read(new FileInputStream(pomArtifact.getFile()));
			DependencyManagement dm = model.getDependencyManagement();

			if (dm == null) {
				dependencies.addToDependencyManagement(project, dependency);
			} else {
				for (Dependency d : dm.getDependencies()) {
					/*
					 * TODO handle variables properly! For now assume variable is referring to the
					 * contract's artifact itself (that's what EM contractors do).
					 */
					if (d.getArtifactId().startsWith("${")) {
						dependencies.addToDependencyManagement(project, dependency);
					} else {
						dependencies.addToDependencyManagement(project, d);
					}
				}
			}

		} catch (Exception e) {
			logger.warn("Could not process modules from " + coordinates[0] + ":" + coordinates[1] + ":"
					+ coordinates[2], e);
		}
	}

}
 
开发者ID:commsen,项目名称:EM,代码行数:58,代码来源:ExportMojo.java

示例11: createProjectDependencyPomModel

import org.apache.maven.model.Dependency; //导入方法依赖的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.Dependency.setGroupId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。