本文整理汇总了Java中org.apache.maven.model.Dependency.setClassifier方法的典型用法代码示例。如果您正苦于以下问题:Java Dependency.setClassifier方法的具体用法?Java Dependency.setClassifier怎么用?Java Dependency.setClassifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.model.Dependency
的用法示例。
在下文中一共展示了Dependency.setClassifier方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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;
}
示例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;
}
示例5: 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;
}
示例6: 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;
}