本文整理汇总了Java中org.apache.maven.model.Developer类的典型用法代码示例。如果您正苦于以下问题:Java Developer类的具体用法?Java Developer怎么用?Java Developer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Developer类属于org.apache.maven.model包,在下文中一共展示了Developer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ExtendedArtifact
import org.apache.maven.model.Developer; //导入依赖的package包/类
/** Constructor.
* @param artifact the artifact.
* @param name name of the artifact.
* @param website website.
* @param organization organization.
* @param scmRevision url of the SCM.
* @param scm SCM.
* @param developers developers.
* @param contributors constributors.
* @param licenses licenses.
*/
public ExtendedArtifact(
Artifact artifact, String name,
String website, Organization organization,
String scmRevision,
Scm scm,
List<? extends Developer> developers,
List<? extends Contributor> contributors,
List<? extends License> licenses) {
this.original = artifact;
this.artifactName = name;
this.developers = developers;
this.contributors = contributors;
this.website = website;
this.organization = organization;
this.scm = scm;
this.scmRevision = scmRevision;
this.licenses = licenses;
}
示例2: shouldNotFindBestPracticesViolation
import org.apache.maven.model.Developer; //导入依赖的package包/类
@Test
public void shouldNotFindBestPracticesViolation() {
License license = new License();
license.setName("license-name");
license.setUrl("license-url");
Developer developer = new Developer();
developer.setId("dev-id");
developer.setName("dev-name");
Scm scm = new Scm();
scm.setUrl("scm-url");
scm.setConnection("scm-connection");
PomBuilder pomBuilder = pom();
pomBuilder.model().setName("foo-name");
pomBuilder.model().setDescription(""); // empty description is allowed, see WOLF-69
pomBuilder.model().setUrl("foo-url");
pomBuilder.model().addLicense(license);
pomBuilder.model().addDeveloper(developer);
pomBuilder.model().setScm(scm);
pomBuilder.create(repoFooDir);
validationExecutor.execute(ctx);
assertSuccess();
}
开发者ID:release-engineering,项目名称:redhat-repository-validator,代码行数:27,代码来源:TestBestPracticesValidator.java
示例3: updateDeveloper
import org.apache.maven.model.Developer; //导入依赖的package包/类
/**
* Method updateDeveloper
*
* @param value
* @param element
* @param counter
* @param xmlTag
*/
protected void updateDeveloper( Developer value, String xmlTag, Counter counter, Element element )
{
Element root = element;
Counter innerCount = new Counter( counter.getDepth() + 1 );
findAndReplaceSimpleElement( innerCount, root, "id", value.getId(), null );
findAndReplaceSimpleElement( innerCount, root, "name", value.getName(), null );
findAndReplaceSimpleElement( innerCount, root, "email", value.getEmail(), null );
findAndReplaceSimpleElement( innerCount, root, "url", value.getUrl(), null );
findAndReplaceSimpleElement( innerCount, root, "organization", value.getOrganization(), null );
findAndReplaceSimpleElement( innerCount, root, "organizationUrl", value.getOrganizationUrl(), null );
findAndReplaceSimpleLists( innerCount, root, value.getRoles(), "roles", "role" );
findAndReplaceSimpleElement( innerCount, root, "timezone", value.getTimezone(), null );
findAndReplaceProperties( innerCount, root, "properties", value.getProperties() );
}
示例4: visitDeveloper
import org.apache.maven.model.Developer; //导入依赖的package包/类
private void visitDeveloper( ModelVisitor visitor, Developer developer )
{
List<String> roles = developer.getRoles();
if ( roles != null )
{
ListIterator<String> roleIterator = roles.listIterator();
while ( roleIterator.hasNext() )
{
String role = roleIterator.next();
visitor.visitDeveloperRole( role );
role = visitor.replaceDeveloperRole( role );
if ( role == null )
roleIterator.remove();
else
roleIterator.set( role );
}
}
Properties properties = developer.getProperties();
if ( properties != null )
{
Iterator<Entry<Object, Object>> propertyIterator = properties.entrySet().iterator();
while ( propertyIterator.hasNext() )
{
Entry<Object, Object> property = propertyIterator.next();
String propertyKey = (String) property.getKey();
String propertyValue = (String) property.getKey();
visitor.visitDeveloperProperty( propertyKey, propertyValue );
propertyValue = visitor.replaceDeveloperProperty( propertyKey, propertyValue );
if ( propertyValue == null )
propertyIterator.remove();
else
property.setValue( propertyValue );
}
}
}
示例5: addProjectHavingAnArchitectAsDeveloperAndABusinessEngineerAsContributorToHelper
import org.apache.maven.model.Developer; //导入依赖的package包/类
private void addProjectHavingAnArchitectAsDeveloperAndABusinessEngineerAsContributorToHelper() throws Exception
{
final MavenProject mavenProject = new MavenProject();
final Developer developer = new Developer();
developer.addRole( "architect" );
mavenProject.addDeveloper( developer );
final Contributor contributor = new Contributor();
contributor.addRole( "business engineer" );
mavenProject.addContributor( contributor );
Mockito.when( helper.evaluate( "${project}" ) ).thenReturn( mavenProject );
}
示例6: createDefaultLicenseHeader
import org.apache.maven.model.Developer; //导入依赖的package包/类
private String createDefaultLicenseHeader()
{
String organization = "";
Organization org = project.getOrganization();
if (org != null) {
organization = org.getName();
}
if (organization == null) {
List devs = project.getDevelopers();
if (devs.size() > 0) {
Iterator dvs = devs.iterator();
String devsString = "";
while (dvs.hasNext()) {
Developer d = ( Developer )dvs.next();
devsString = devsString + "," + d.getName() != null ? d.getName() : d.getId();
}
organization = devsString.substring( 1 );
}
}
if (organization == null) {
organization = ""; //what's a good default value?
}
String date = "";
if (project.getInceptionYear() != null) {
date = project.getInceptionYear();
}
String year = Integer.toString( Calendar.getInstance().get( Calendar.YEAR ));
if (!year.equals( date ) ) {
date = date.length() == 0 ? year : date + "-" + year;
}
return "Copyright " + organization + " " + date;
}
示例7: mergeDeveloper_Id
import org.apache.maven.model.Developer; //导入依赖的package包/类
protected void mergeDeveloper_Id( Developer target, Developer source, boolean sourceDominant,
Map<Object, Object> context )
{
String src = source.getId();
if ( src != null )
{
if ( sourceDominant || target.getId() == null )
{
target.setId( src );
target.setLocation( "id", source.getLocation( "id" ) );
}
}
}
示例8: mergeModel_Developers
import org.apache.maven.model.Developer; //导入依赖的package包/类
@Override
protected void mergeModel_Developers( Model target, Model source, boolean sourceDominant,
Map<Object, Object> context )
{
if ( target.getDevelopers().isEmpty() )
{
target.setDevelopers( new ArrayList<Developer>( source.getDevelopers() ) );
}
}
示例9: shouldUseTemplateIfProvided
import org.apache.maven.model.Developer; //导入依赖的package包/类
@Test
public void shouldUseTemplateIfProvided() throws Exception {
MavenPublishable withoutTemplate =
createMavenPublishable("//example:no-template", "example.com:project:1.0.0", null);
Model noTemplate = parse(Pom.generatePomFile(pathResolver, withoutTemplate));
MavenPublishable withTemplate =
createMavenPublishable(
"//example:template",
"example.com:project:1.0.0",
FakeSourcePath.of(
TestDataHelper.getTestDataDirectory(getClass())
.resolve("poms/template-pom.xml")
.toString()));
Model templated = parse(Pom.generatePomFile(pathResolver, withTemplate));
// Template sets developers and an example dep. Check that these aren't in the non-templated
// version
assertTrue(noTemplate.getDevelopers().isEmpty());
assertTrue(noTemplate.getDependencies().isEmpty());
// Now check the same fields in the templated version.
Developer seenDev = Iterables.getOnlyElement(templated.getDevelopers());
assertEquals("susan", seenDev.getId());
assertEquals("Susan The Developer", seenDev.getName());
assertEquals(ImmutableList.of("Owner"), seenDev.getRoles());
Dependency seenDep = Iterables.getOnlyElement(templated.getDependencies());
assertEquals("com.google.guava", seenDep.getGroupId());
assertEquals("guava", seenDep.getArtifactId());
assertEquals("19.0", seenDep.getVersion());
}
示例10: replaceDeveloper
import org.apache.maven.model.Developer; //导入依赖的package包/类
@Override
public Developer replaceDeveloper( Developer developer )
{
return developer;
}
示例11: visitDeveloper
import org.apache.maven.model.Developer; //导入依赖的package包/类
@Override
public void visitDeveloper( Developer developer )
{
}
示例12: checkRequiredHeaders
import org.apache.maven.model.Developer; //导入依赖的package包/类
/**
* @param units contributors and developers to check
* @return required headers
*/
private Map<String, Boolean> checkRequiredHeaders( List<? extends Contributor> units )
{
Map<String, Boolean> requiredHeaders = new HashMap<String, Boolean>();
requiredHeaders.put( IMAGE, Boolean.FALSE );
requiredHeaders.put( ID, Boolean.FALSE );
requiredHeaders.put( NAME, Boolean.FALSE );
requiredHeaders.put( EMAIL, Boolean.FALSE );
requiredHeaders.put( URL, Boolean.FALSE );
requiredHeaders.put( ORGANIZATION, Boolean.FALSE );
requiredHeaders.put( ORGANIZATION_URL, Boolean.FALSE );
requiredHeaders.put( ROLES, Boolean.FALSE );
requiredHeaders.put( TIME_ZONE, Boolean.FALSE );
requiredHeaders.put( PROPERTIES, Boolean.FALSE );
for ( Contributor unit : units )
{
if ( unit instanceof Developer )
{
Developer developer = (Developer) unit;
if ( StringUtils.isNotEmpty( developer.getId() ) )
{
requiredHeaders.put( ID, Boolean.TRUE );
}
}
if ( StringUtils.isNotEmpty( unit.getName() ) )
{
requiredHeaders.put( NAME, Boolean.TRUE );
}
if ( StringUtils.isNotEmpty( unit.getEmail() ) )
{
requiredHeaders.put( EMAIL, Boolean.TRUE );
requiredHeaders.put( IMAGE, Boolean.TRUE );
}
if ( StringUtils.isNotEmpty( unit.getUrl() ) )
{
requiredHeaders.put( URL, Boolean.TRUE );
}
if ( StringUtils.isNotEmpty( unit.getOrganization() ) )
{
requiredHeaders.put( ORGANIZATION, Boolean.TRUE );
}
if ( StringUtils.isNotEmpty( unit.getOrganizationUrl() ) )
{
requiredHeaders.put( ORGANIZATION_URL, Boolean.TRUE );
}
if ( !isEmpty( unit.getRoles() ) )
{
requiredHeaders.put( ROLES, Boolean.TRUE );
}
if ( StringUtils.isNotEmpty( unit.getTimezone() ) )
{
requiredHeaders.put( TIME_ZONE, Boolean.TRUE );
}
Properties properties = unit.getProperties();
boolean hasPicUrl = properties.containsKey( "picUrl" );
if ( hasPicUrl )
{
requiredHeaders.put( IMAGE, Boolean.TRUE );
}
boolean isJustAnImageProperty = properties.size() == 1 && hasPicUrl;
if ( !isJustAnImageProperty && !properties.isEmpty() )
{
requiredHeaders.put( PROPERTIES, Boolean.TRUE );
}
}
return requiredHeaders;
}
示例13: getRoles
import org.apache.maven.model.Developer; //导入依赖的package包/类
@Override
protected List<Developer> getRoles( MavenProject mavenProject )
{
return mavenProject.getDevelopers();
}
示例14: get
import org.apache.maven.model.Developer; //导入依赖的package包/类
@Override
public List<Developer> get( Model model )
{
return model.getDevelopers();
}
示例15: set
import org.apache.maven.model.Developer; //导入依赖的package包/类
@Override
public void set( Model model, List<Developer> value )
{
model.setDevelopers( value );
}