You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2008/07/16 22:24:40 UTC
svn commit: r677407 - in /maven/plugins/trunk/maven-doap-plugin: pom.xml
src/main/java/org/apache/maven/plugin/doap/DoapMojo.java
src/main/java/org/apache/maven/plugin/doap/DoapUtil.java
src/main/mdo/asfextOptions.mdo src/main/mdo/doapOptions.mdo
Author: vsiveton
Date: Wed Jul 16 13:24:39 2008
New Revision: 677407
URL: http://svn.apache.org/viewvc?rev=677407&view=rev
Log:
MDOAP-8: ASF namespace is always include
o added new asdextoptions modello
o verify asfext as describe on the website
o implement asfext:* only if asfExtOptions.isIncluded()
o allow shortdesc
Added:
maven/plugins/trunk/maven-doap-plugin/src/main/mdo/asfextOptions.mdo (with props)
Modified:
maven/plugins/trunk/maven-doap-plugin/pom.xml
maven/plugins/trunk/maven-doap-plugin/src/main/java/org/apache/maven/plugin/doap/DoapMojo.java
maven/plugins/trunk/maven-doap-plugin/src/main/java/org/apache/maven/plugin/doap/DoapUtil.java
maven/plugins/trunk/maven-doap-plugin/src/main/mdo/doapOptions.mdo
Modified: maven/plugins/trunk/maven-doap-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-doap-plugin/pom.xml?rev=677407&r1=677406&r2=677407&view=diff
==============================================================================
--- maven/plugins/trunk/maven-doap-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-doap-plugin/pom.xml Wed Jul 16 13:24:39 2008
@@ -125,6 +125,7 @@
<version>1.0.0</version>
<models>
<model>src/main/mdo/doapOptions.mdo</model>
+ <model>src/main/mdo/asfextOptions.mdo</model>
</models>
</configuration>
</plugin>
Modified: maven/plugins/trunk/maven-doap-plugin/src/main/java/org/apache/maven/plugin/doap/DoapMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-doap-plugin/src/main/java/org/apache/maven/plugin/doap/DoapMojo.java?rev=677407&r1=677406&r2=677407&view=diff
==============================================================================
--- maven/plugins/trunk/maven-doap-plugin/src/main/java/org/apache/maven/plugin/doap/DoapMojo.java (original)
+++ maven/plugins/trunk/maven-doap-plugin/src/main/java/org/apache/maven/plugin/doap/DoapMojo.java Wed Jul 16 13:24:39 2008
@@ -43,7 +43,9 @@
import org.apache.maven.model.Scm;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.doap.options.ASFExtOptions;
import org.apache.maven.plugin.doap.options.DoapOptions;
+import org.apache.maven.plugin.doap.options.Standard;
import org.apache.maven.project.MavenProject;
import org.apache.maven.scm.manager.NoSuchScmProviderException;
import org.apache.maven.scm.manager.ScmManager;
@@ -171,9 +173,33 @@
*
* @parameter expression="${doapOptions}"
* @since 1.0
+ * @see <a href="http://usefulinc.com/ns/doap#">http://usefulinc.com/ns/doap#</a>
*/
private DoapOptions doapOptions;
+ /**
+ * Specific ASF extensions parameters, i.e. options that POM doesn't have any notions but required by ASF DOAP
+ * requirements.
+ * <br/>
+ * Example:
+ * <pre>
+ * <asfExtOptions>
+ * <included>true</included>
+ * <charter>The mission of the Apache XXX project is to create and maintain software
+ * libraries that provide ...</charter>
+ * ...
+ * </asfExtOptions>
+ * </pre>
+ *
+ * @parameter expression="${asfExtOptions}"
+ * @since 1.0
+ * @see <a href="http://svn.apache.org/repos/asf/infrastructure/site-tools/trunk/projects/asfext">
+ * http://svn.apache.org/repos/asf/infrastructure/site-tools/trunk/projects/asfext</a>
+ * @see <a href="http://projects.apache.org/docs/pmc.html">http://projects.apache.org/docs/pmc.html</a>
+ * @see <a href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a>
+ */
+ private ASFExtOptions asfExtOptions;
+
// ----------------------------------------------------------------------
// Public methods
// ----------------------------------------------------------------------
@@ -211,8 +237,11 @@
writer.addAttribute( "xml:lang", "en" );
writer.addAttribute( "xmlns", "http://usefulinc.com/ns/doap#" );
writer.addAttribute( "xmlns:rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#" );
- writer.addAttribute( "xmlns:asfext", "http://projects.apache.org/ns/asfext#" );
writer.addAttribute( "xmlns:foaf", "http://xmlns.com/foaf/0.1/" );
+ if ( asfExtOptions.isIncluded() )
+ {
+ writer.addAttribute( "xmlns:asfext", ASFExtOptions.ASFEXT_NAMESPACE );
+ }
// Project
writer.startElement( "Project" );
@@ -233,8 +262,6 @@
// licenses
writeLicenses( writer );
- DoapUtil.writeRdfResourceElement( writer, "asfext:pmc", project.getUrl() );
-
// programming-language
writeProgrammingLanguage( writer );
@@ -271,6 +298,12 @@
// Contributors
writeDevelopersOrContributors( writer, project.getContributors() );
+ // ASFext
+ if ( asfExtOptions.isIncluded() )
+ {
+ writeASFext( writer );
+ }
+
writer.endElement(); // Project
writer.endElement(); // rdf:RDF
@@ -303,7 +336,15 @@
XmlWriterUtil.writeLineBreak( writer );
XmlWriterUtil.writeCommentText( writer, "A name of something.", 2 );
- DoapUtil.writeElement( writer, "name", project.getName() );
+
+ if ( asfExtOptions.isIncluded() && !project.getName().toLowerCase().trim().startsWith( "apache" ) )
+ {
+ DoapUtil.writeRdfResourceElement( writer, "name", "Apache " + project.getName() );
+ }
+ else
+ {
+ DoapUtil.writeRdfResourceElement( writer, "name", project.getName() );
+ }
}
/**
@@ -323,7 +364,14 @@
XmlWriterUtil.writeLineBreak( writer );
XmlWriterUtil.writeCommentText( writer, "Plain text description of a project, of 2-4 sentences in length.", 2 );
DoapUtil.writeElement( writer, "description", project.getDescription() );
- DoapUtil.writeElement( writer, "shortdesc", project.getDescription() );
+ if ( StringUtils.isNotEmpty( doapOptions.getShortdesc() ) )
+ {
+ DoapUtil.writeElement( writer, "shortdesc", doapOptions.getShortdesc() );
+ }
+ else
+ {
+ DoapUtil.writeElement( writer, "shortdesc", project.getDescription() );
+ }
}
/**
@@ -389,6 +437,13 @@
if ( StringUtils.isNotEmpty( language ) ) // backward compatible
{
+ if ( asfExtOptions.isIncluded() && !ASFExtOptions.isProgrammingLanguageSupportedByASF( language ) )
+ {
+ getLog().warn(
+ "The programming language '" + language + "' is not supported by ASF. "
+ + "Refer you to http://projects.apache.org/languages.html" );
+ }
+
DoapUtil.writeRdfResourceElement( writer, "programming-language", language );
}
@@ -397,6 +452,13 @@
String[] languages = StringUtils.split( doapOptions.getProgrammingLanguage(), "," );
for ( int i = 0; i < languages.length; i++ )
{
+ if ( asfExtOptions.isIncluded() && !ASFExtOptions.isProgrammingLanguageSupportedByASF( languages[i].trim() ) )
+ {
+ getLog().warn(
+ "The programming language '" + languages[i].trim() + "' is not supported by ASF. "
+ + "Refer you to http://projects.apache.org/languages.html" );
+ }
+
DoapUtil.writeRdfResourceElement( writer, "programming-language", languages[i].trim() );
}
}
@@ -421,7 +483,22 @@
if ( StringUtils.isNotEmpty( category ) ) // backward compatible
{
- DoapUtil.writeRdfResourceElement( writer, "category", "http://projects.apache.org/category/" + category );
+ if ( asfExtOptions.isIncluded() && !ASFExtOptions.isCategorySupportedByASF( category ) )
+ {
+ getLog().warn(
+ "The given category '" + category + "' is not supported by ASF. "
+ + "Refer you to http://projects.apache.org/categories.html" );
+ }
+
+ if ( asfExtOptions.isIncluded() )
+ {
+ DoapUtil
+ .writeRdfResourceElement( writer, "category", "http://projects.apache.org/category/" + category );
+ }
+ else
+ {
+ DoapUtil.writeRdfResourceElement( writer, "category", category );
+ }
}
if ( StringUtils.isNotEmpty( doapOptions.getCategory() ) )
@@ -429,8 +506,22 @@
String[] categories = StringUtils.split( doapOptions.getCategory(), "," );
for ( int i = 0; i < categories.length; i++ )
{
- DoapUtil.writeRdfResourceElement( writer, "category", "http://projects.apache.org/category/"
- + categories[i].trim() );
+ if ( asfExtOptions.isIncluded() && !ASFExtOptions.isCategorySupportedByASF( categories[i] ) )
+ {
+ getLog().warn(
+ "The given category '" + categories[i] + "' is not supported by ASF. "
+ + "Refer you to http://projects.apache.org/categories.html" );
+ }
+
+ if ( asfExtOptions.isIncluded() )
+ {
+ DoapUtil.writeRdfResourceElement( writer, "category", "http://projects.apache.org/category/"
+ + categories[i].trim() );
+ }
+ else
+ {
+ DoapUtil.writeRdfResourceElement( writer, "category", categories[i].trim() );
+ }
}
}
}
@@ -538,7 +629,7 @@
*/
private void writeLicenses( XMLWriter writer )
{
- if ( project.getLicenses() == null || project.getLicenses().size() == 0 )
+ if ( project.getLicenses() == null || project.getLicenses().isEmpty() )
{
return;
}
@@ -595,7 +686,7 @@
*/
private void writeMailingList( XMLWriter writer )
{
- if ( project.getMailingLists() == null || project.getMailingLists().size() == 0 )
+ if ( project.getMailingLists() == null || project.getMailingLists().isEmpty() )
{
return;
}
@@ -852,7 +943,7 @@
*/
private void writeDevelopersOrContributors( XMLWriter writer, List developersOrContributors )
{
- if ( developersOrContributors == null || developersOrContributors.size() == 0 )
+ if ( developersOrContributors == null || developersOrContributors.isEmpty() )
{
return;
}
@@ -933,23 +1024,13 @@
* </pre>
*
* @param writer not null
- * @param developersOrContributors not null
+ * @param developersOrContributors list of <code>{@link Developer}/{@link Contributor}</code>
* @param doapType not null
- * @see <a href="http://usefulinc.com/ns/doap#maintainer">http://usefulinc.com/ns/doap#maintainer</a>
- * @see <a href="http://usefulinc.com/ns/doap#developer">http://usefulinc.com/ns/doap#developer</a>
- * @see <a href="http://usefulinc.com/ns/doap#documenter">http://usefulinc.com/ns/doap#documenter</a>
- * @see <a href="http://usefulinc.com/ns/doap#translator">http://usefulinc.com/ns/doap#translator</a>
- * @see <a href="http://usefulinc.com/ns/doap#tester">http://usefulinc.com/ns/doap#tester</a>
- * @see <a href="http://usefulinc.com/ns/doap#helper">http://usefulinc.com/ns/doap#helper</a>
- * @see <a href="http://xmlns.com/foaf/0.1/Person">http://xmlns.com/foaf/0.1/Person</a>
- * @see <a href="http://xmlns.com/foaf/0.1/name">http://xmlns.com/foaf/0.1/name</a>
- * @see <a href="http://xmlns.com/foaf/0.1/mbox">http://xmlns.com/foaf/0.1/mbox</a>
- * @see <a href="http://xmlns.com/foaf/0.1/Organization">http://xmlns.com/foaf/0.1/Organization</a>
- * @see <a href="http://xmlns.com/foaf/0.1/homepage">http://xmlns.com/foaf/0.1/homepage</a>
+ * @see #writeDeveloperOrContributor(XMLWriter, Object, String)
*/
private void writeDeveloperOrContributor( XMLWriter writer, List developersOrContributors, String doapType )
{
- if ( developersOrContributors == null || developersOrContributors.size() == 0 )
+ if ( developersOrContributors == null || developersOrContributors.isEmpty() )
{
return;
}
@@ -998,55 +1079,87 @@
for ( Iterator it = developersOrContributors.iterator(); it.hasNext(); )
{
Object obj = it.next();
+ writeDeveloperOrContributor( writer, obj, doapType );
+ }
+ }
- String name;
- String email;
- String organization;
- String homepage;
-
- if ( Developer.class.isAssignableFrom( obj.getClass() ) )
- {
- Developer d = (Developer) obj;
- name = d.getName();
- email = d.getEmail();
- organization = d.getOrganization();
- homepage = d.getUrl();
- }
- else
- {
- Contributor c = (Contributor) obj;
- name = c.getName();
- email = c.getEmail();
- organization = c.getOrganization();
- homepage = c.getUrl();
- }
+ /**
+ * Writer a single developer or contributor
+ *
+ * @param writer not null
+ * @param developerOrContributor not null, instance of <code>{@link Developer}/{@link Contributor}</code>
+ * @param doapType not null
+ * @see <a href="http://usefulinc.com/ns/doap#maintainer">http://usefulinc.com/ns/doap#maintainer</a>
+ * @see <a href="http://usefulinc.com/ns/doap#developer">http://usefulinc.com/ns/doap#developer</a>
+ * @see <a href="http://usefulinc.com/ns/doap#documenter">http://usefulinc.com/ns/doap#documenter</a>
+ * @see <a href="http://usefulinc.com/ns/doap#translator">http://usefulinc.com/ns/doap#translator</a>
+ * @see <a href="http://usefulinc.com/ns/doap#tester">http://usefulinc.com/ns/doap#tester</a>
+ * @see <a href="http://usefulinc.com/ns/doap#helper">http://usefulinc.com/ns/doap#helper</a>
+ * @see <a href="http://xmlns.com/foaf/0.1/Person">http://xmlns.com/foaf/0.1/Person</a>
+ * @see <a href="http://xmlns.com/foaf/0.1/name">http://xmlns.com/foaf/0.1/name</a>
+ * @see <a href="http://xmlns.com/foaf/0.1/mbox">http://xmlns.com/foaf/0.1/mbox</a>
+ * @see <a href="http://xmlns.com/foaf/0.1/Organization">http://xmlns.com/foaf/0.1/Organization</a>
+ * @see <a href="http://xmlns.com/foaf/0.1/homepage">http://xmlns.com/foaf/0.1/homepage</a>
+ */
+ private void writeDeveloperOrContributor( XMLWriter writer, Object developerOrContributor, String doapType )
+ {
+ if ( developerOrContributor == null )
+ {
+ return;
+ }
- // Name is required to write doap
- if ( StringUtils.isEmpty( name ) )
- {
- continue;
- }
+ if ( StringUtils.isEmpty( doapType ) )
+ {
+ throw new IllegalArgumentException( "doapType is required." );
+ }
- writer.startElement( doapType );
- writer.startElement( "foaf:Person" );
- writer.startElement( "foaf:name" );
- writer.writeText( name );
- writer.endElement(); // foaf:name
- if ( StringUtils.isNotEmpty( email ) )
- {
- DoapUtil.writeRdfResourceElement( writer, "foaf:mbox", "mailto:" + email );
- }
- if ( StringUtils.isNotEmpty( organization ) )
- {
- DoapUtil.writeRdfResourceElement( writer, "foaf:Organization", organization );
- }
- if ( StringUtils.isNotEmpty( homepage ) )
- {
- DoapUtil.writeRdfResourceElement( writer, "foaf:homepage", homepage );
- }
- writer.endElement(); // foaf:Person
- writer.endElement(); // doapType
+ String name;
+ String email;
+ String organization;
+ String homepage;
+
+ if ( Developer.class.isAssignableFrom( developerOrContributor.getClass() ) )
+ {
+ Developer d = (Developer) developerOrContributor;
+ name = d.getName();
+ email = d.getEmail();
+ organization = d.getOrganization();
+ homepage = d.getUrl();
+ }
+ else
+ {
+ Contributor c = (Contributor) developerOrContributor;
+ name = c.getName();
+ email = c.getEmail();
+ organization = c.getOrganization();
+ homepage = c.getUrl();
+ }
+
+ // Name is required to write doap
+ if ( StringUtils.isEmpty( name ) )
+ {
+ return;
}
+
+ writer.startElement( doapType );
+ writer.startElement( "foaf:Person" );
+ writer.startElement( "foaf:name" );
+ writer.writeText( name );
+ writer.endElement(); // foaf:name
+ if ( StringUtils.isNotEmpty( email ) )
+ {
+ DoapUtil.writeRdfResourceElement( writer, "foaf:mbox", "mailto:" + email );
+ }
+ if ( StringUtils.isNotEmpty( organization ) )
+ {
+ DoapUtil.writeRdfResourceElement( writer, "foaf:Organization", organization );
+ }
+ if ( StringUtils.isNotEmpty( homepage ) )
+ {
+ DoapUtil.writeRdfResourceElement( writer, "foaf:homepage", homepage );
+ }
+ writer.endElement(); // foaf:Person
+ writer.endElement(); // doapType
}
/**
@@ -1079,9 +1192,197 @@
}
}
}
+
return repo;
}
+ /**
+ * Write the ASF extensions
+ *
+ * @param writer not null
+ * @see <a href="http://svn.apache.org/repos/asf/infrastructure/site-tools/trunk/projects/asfext">
+ * http://svn.apache.org/repos/asf/infrastructure/site-tools/trunk/projects/asfext</a>
+ * @see <a href="http://projects.apache.org/docs/pmc.html">http://projects.apache.org/docs/pmc.html</a>
+ */
+ private void writeASFext( XMLWriter writer )
+ {
+ XmlWriterUtil.writeLineBreak( writer );
+ XmlWriterUtil.writeCommentText( writer, "ASF extension", 2 );
+
+ // asfext:pmc
+ if ( StringUtils.isNotEmpty( asfExtOptions.getPmc() ) )
+ {
+ DoapUtil.writeRdfResourceElement( writer, "asfext:pmc", asfExtOptions.getPmc() );
+ }
+ else
+ {
+ if ( StringUtils.isEmpty( project.getUrl() ) )
+ {
+ getLog().warn(
+ "No project url discovered! According http://projects.apache.org/docs/pmc.html, "
+ + "asfext:pmc is required" );
+ }
+ else
+ {
+ DoapUtil.writeRdfResourceElement( writer, "asfext:pmc", project.getUrl() );
+ }
+ }
+
+ // asfext:name
+ if ( StringUtils.isNotEmpty( asfExtOptions.getName() ) )
+ {
+ DoapUtil.writeRdfResourceElement( writer, "asfext:name", asfExtOptions.getName() );
+ }
+ else
+ {
+ if ( StringUtils.isEmpty( project.getName() ) )
+ {
+ getLog().warn(
+ "No project name discovered! According http://projects.apache.org/docs/pmc.html, "
+ + "asfext:name is required" );
+ }
+ else
+ {
+ // Respect ASF rule
+ if ( !project.getName().trim().startsWith( "Apache" ) )
+ {
+ DoapUtil.writeRdfResourceElement( writer, "asfext:name", "Apache " + project.getName().trim() );
+ }
+ else
+ {
+ DoapUtil.writeRdfResourceElement( writer, "asfext:name", project.getName().trim() );
+ }
+ }
+ }
+
+ // asfext:charter
+ if ( StringUtils.isEmpty( asfExtOptions.getCharter() ) )
+ {
+ getLog().warn(
+ "No charter specified! According http://projects.apache.org/docs/pmc.html, "
+ + "charter is required" );
+ }
+ else
+ {
+ DoapUtil.writeRdfResourceElement( writer, "asfext:charter", asfExtOptions.getCharter() );
+ }
+
+ // asfext:chair
+ List developers = project.getDevelopers();
+
+ if ( StringUtils.isNotEmpty( asfExtOptions.getChair() ) )
+ {
+ writer.startElement( "asfext:chair" );
+ writer.startElement( "foaf:Person" );
+ writer.startElement( "foaf:name" );
+ writer.writeText( asfExtOptions.getChair() );
+ writer.endElement(); // foaf:name
+ writer.endElement(); // foaf:Person
+ writer.endElement(); // asfext:chair
+ }
+ else
+ {
+ Developer chair = ASFExtOptions.findChair( developers );
+ if ( chair != null )
+ {
+ writeDeveloperOrContributor( writer, chair, "asfext:chair" );
+ }
+ else
+ {
+ getLog().warn(
+ "No chair man discovered! According http://projects.apache.org/docs/pmc.html, "
+ + "asfext:chair is required" );
+ }
+ }
+
+ // asfext:member
+ if ( developers != null && developers.size() > 0 )
+ {
+ List pmcMember = ASFExtOptions.findPMCMembers( developers );
+ for ( Iterator it = pmcMember.iterator(); it.hasNext(); )
+ {
+ Developer developer = (Developer) it.next();
+
+ writeDeveloperOrContributor( writer, developer, "asfext:member" );
+ }
+ }
+
+ writeASFImplements( writer );
+ }
+
+ /**
+ * Write the ASF implements.
+ *
+ * @param writer not null
+ * @see <a href="http://svn.apache.org/repos/asf/infrastructure/site-tools/trunk/projects/asfext">
+ * http://svn.apache.org/repos/asf/infrastructure/site-tools/trunk/projects/asfext</a>
+ * @see <a href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a>
+ */
+ private void writeASFImplements( XMLWriter writer )
+ {
+ if ( asfExtOptions.getStandards() == null || asfExtOptions.getStandards().isEmpty() )
+ {
+ return;
+ }
+
+ for ( Iterator it = asfExtOptions.getStandards().iterator(); it.hasNext(); )
+ {
+ Standard standard = (Standard) it.next();
+
+ writer.startElement( "asfext:implements" );
+ writer.startElement( "asfext:Standard" );
+
+ if ( StringUtils.isEmpty( standard.getTitle() ) )
+ {
+ getLog().warn(
+ "No title specified! According http://projects.apache.org/docs/standards.html, "
+ + "asfext:title is required" );
+ }
+ else
+ {
+ writer.startElement( "asfext:title" );
+ writer.writeText( standard.getTitle() );
+ writer.endElement(); // asfext:title
+ }
+
+ if ( StringUtils.isEmpty( standard.getBody() ) )
+ {
+ getLog().warn(
+ "No body specified! According http://projects.apache.org/docs/standards.html, "
+ + "asfext:body is required" );
+ }
+ else
+ {
+ writer.startElement( "asfext:body" );
+ writer.writeText( standard.getBody() );
+ writer.endElement(); // asfext:body
+ }
+
+ if ( StringUtils.isEmpty( standard.getId() ) )
+ {
+ getLog().warn(
+ "No id specified! According http://projects.apache.org/docs/standards.html, "
+ + "asfext:id is required" );
+ }
+ else
+ {
+ writer.startElement( "asfext:id" );
+ writer.writeText( standard.getId() );
+ writer.endElement(); // asfext:id
+ }
+
+ if ( StringUtils.isNotEmpty( standard.getUrl() ) )
+ {
+ writer.startElement( "asfext:url" );
+ writer.writeText( standard.getUrl() );
+ writer.endElement(); // asfext:url
+ }
+
+ writer.endElement(); // asfext:Standard
+ writer.endElement(); // asfext:implements
+ }
+ }
+
// ----------------------------------------------------------------------
// Static methods
// ----------------------------------------------------------------------
Modified: maven/plugins/trunk/maven-doap-plugin/src/main/java/org/apache/maven/plugin/doap/DoapUtil.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-doap-plugin/src/main/java/org/apache/maven/plugin/doap/DoapUtil.java?rev=677407&r1=677406&r2=677407&view=diff
==============================================================================
--- maven/plugins/trunk/maven-doap-plugin/src/main/java/org/apache/maven/plugin/doap/DoapUtil.java (original)
+++ maven/plugins/trunk/maven-doap-plugin/src/main/java/org/apache/maven/plugin/doap/DoapUtil.java Wed Jul 16 13:24:39 2008
@@ -144,7 +144,7 @@
returnMap.put( "helpers", new ArrayList() );
returnMap.put( "unknowns", new ArrayList() );
- if ( developersOrContributors == null || developersOrContributors.size() == 0 )
+ if ( developersOrContributors == null || developersOrContributors.isEmpty() )
{
return returnMap;
}
Added: maven/plugins/trunk/maven-doap-plugin/src/main/mdo/asfextOptions.mdo
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-doap-plugin/src/main/mdo/asfextOptions.mdo?rev=677407&view=auto
==============================================================================
--- maven/plugins/trunk/maven-doap-plugin/src/main/mdo/asfextOptions.mdo (added)
+++ maven/plugins/trunk/maven-doap-plugin/src/main/mdo/asfextOptions.mdo Wed Jul 16 13:24:39 2008
@@ -0,0 +1,348 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<model>
+ <id>asfextOptions</id>
+ <name>asfextOptions</name>
+ <description><![CDATA[Model for ASF extensions to DOAP.]]></description>
+ <defaults>
+ <default>
+ <key>package</key>
+ <value>org.apache.maven.plugin.doap.options</value>
+ </default>
+ </defaults>
+ <classes>
+ <class>
+ <name>ASFExtOptions</name>
+ <description><![CDATA[Specific ASF DOAP parameters, i.e. ASF options which make DOAP file ASF compliant.
+@see <a href="http://svn.apache.org/repos/asf/infrastructure/site-tools/trunk/projects/asfext">
+http://svn.apache.org/repos/asf/infrastructure/site-tools/trunk/projects/asfext</a>
+@see <a href="http://projects.apache.org/docs/pmc.html">http://projects.apache.org/docs/pmc.html</a>
+@see <a href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a>]]></description>
+ <version>1.0.0</version>
+ <fields>
+ <field>
+ <name>included</name>
+ <description>Flag to use or not the ASF extension in the generated DOAP. Required.</description>
+ <version>1.0.0</version>
+ <type>boolean</type>
+ <identifier>true</identifier>
+ <defaultValue>true</defaultValue>
+ </field>
+ <field>
+ <name>pmc</name>
+ <description><![CDATA[The top level element within a file. Optional will be discovered from POM.
+@see <a href="http://projects.apache.org/docs/pmc.html">http://projects.apache.org/docs/pmc.html</a>]]></description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>name</name>
+ <description><![CDATA[The name of the PMC, including the 'Apache ', e.g. 'Apache Forrest'. Optional will be discovered from POM.
+@see <a href="http://projects.apache.org/docs/pmc.html">http://projects.apache.org/docs/pmc.html</a>]]></description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>charter</name>
+ <description><![CDATA[Every PMC is created by a board resolution with a specific charter. That charter should be
+ listed here as it gives the focus and scope of the PMC. Optional.
+@see <a href="http://projects.apache.org/docs/pmc.html">http://projects.apache.org/docs/pmc.html</a>]]></description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>chair</name>
+ <description><![CDATA[This should contain the name of the current PMC chairperson. Optional.
+@see <a href="http://projects.apache.org/docs/pmc.html">http://projects.apache.org/docs/pmc.html</a>]]></description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+
+ <field>
+ <name>standards</name>
+ <version>1.0.0</version>
+ <description><![CDATA[List of Standard object. Optional.
+@see <a href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a>]]></description>
+ <association>
+ <type>Standard</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ </fields>
+
+ <codeSegments>
+ <codeSegment>
+ <code>
+ <![CDATA[
+ /** The ASF ext namespace. */
+ public static final String ASFEXT_NAMESPACE = "http://projects.apache.org/ns/asfext#";
+
+ /**
+ * The ASF category resource.
+ *
+ * @see <a href="http://projects.apache.org/guidelines.html">http://projects.apache.org/guidelines.html</a>
+ */
+ public static final String CATEGORY_RESOURCE = "http://projects.apache.org/category/";
+
+ /** Projects related to building/maintaining source code/websites. */
+ public static final String BUILD_MANAGEMENT_CATEGORY = "build-management";
+
+ /** Projects related to databases. */
+ public static final String DATABASE_CATEGORY = "database";
+
+ /** Related to the HyperText Transfer Protocol. */
+ public static final String HTTP_CATEGORY = "http";
+
+ /** Modules designed for use by the Apache HTTP Server. */
+ public static final String HTTP_MODULES_CATEGORY = "httpd-modules";
+
+ /** A library meant to be used by other applications. */
+ public static final String LIBRARY_CATEGORY = "library";
+
+ /** Servers or applications related to internet mail protocols. */
+ public static final String MAIL_CATEGORY = "mail";
+
+ /** Anything that acts as a client across a network. */
+ public static final String NETWORK_CLIENT_CATEGORY = "network-client";
+
+ /** Anything that acts as a server across a network. */
+ public static final String NETWORK_SERVER_CATEGORY = "network-server";
+
+ /** Software designed to test or verify other software. */
+ public static final String TESTING_CATEGORY = "testing";
+
+ /** Unifying frameworks for website development. */
+ public static final String WEB_FRAMEWORK_CATEGORY = "web-framework";
+
+ /** Software based on XML technologies. */
+ public static final String XML_CATEGORY = "xml";
+
+ /** All categories supported by ASF */
+ public static final String[] CATEGORIES = {
+ BUILD_MANAGEMENT_CATEGORY,
+ DATABASE_CATEGORY,
+ HTTP_CATEGORY,
+ HTTP_MODULES_CATEGORY,
+ LIBRARY_CATEGORY,
+ MAIL_CATEGORY,
+ NETWORK_CLIENT_CATEGORY,
+ NETWORK_SERVER_CATEGORY,
+ TESTING_CATEGORY,
+ WEB_FRAMEWORK_CATEGORY,
+ XML_CATEGORY };
+
+ /** C or C++ Programming Language. */
+ public static final String C_PROGRAMMING_LANGUAGE = "C";
+
+ /** Java Programming Language and all its components.*/
+ public static final String JAVA_PROGRAMMING_LANGUAGE = "Java";
+
+ /** Perl Programming Language.*/
+ public static final String PERL_PROGRAMMING_LANGUAGE = "Perl";
+
+ /** Python Programming Language.*/
+ public static final String PYTHON_PROGRAMMING_LANGUAGE = "Python";
+
+ /** Scalable Vector Graphic Programming Language.*/
+ public static final String SVG_PROGRAMMING_LANGUAGE = "SVG";
+
+ /** Tcl Programming Language.*/
+ public static final String TCL_PROGRAMMING_LANGUAGE = "Tcl";
+
+ /** All Programming Languages supported by ASF */
+ public static final String[] PROGRAMMING_LANGUAGES = {
+ C_PROGRAMMING_LANGUAGE,
+ JAVA_PROGRAMMING_LANGUAGE,
+ PERL_PROGRAMMING_LANGUAGE,
+ PYTHON_PROGRAMMING_LANGUAGE,
+ SVG_PROGRAMMING_LANGUAGE,
+ TCL_PROGRAMMING_LANGUAGE};
+
+ /**
+ * @param category not null
+ * @return <code>true</code> if the given category is supported by ASF.
+ * @see <a href="http://projects.apache.org/categories.html">http://projects.apache.org/categories.html</a>
+ * @see #CATEGORIES
+ */
+ public static boolean isCategorySupportedByASF( String category )
+ {
+ for ( int i = 0; i < CATEGORIES.length; i++ )
+ {
+ if ( CATEGORIES[i].equalsIgnoreCase( category ) )
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * @param programmingLanguage not null
+ * @return <code>true</code> if the given programming language is supported by ASF.
+ * @see <a href="http://projects.apache.org/languages.html">http://projects.apache.org/languages.html</a>
+ * @see #PROGRAMMING_LANGUAGES
+ */
+ public static boolean isProgrammingLanguageSupportedByASF( String programmingLanguage )
+ {
+ for ( int i = 0; i < PROGRAMMING_LANGUAGES.length; i++ )
+ {
+ if ( PROGRAMMING_LANGUAGES[i].equalsIgnoreCase( programmingLanguage ) )
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Find the chair man of the project. The role of the developer should contain <code>chair</code>.
+ *
+ * @param developers list of <code>{@link org.apache.maven.model.Developer}</code>
+ * @return a Developer or null if not found.
+ */
+ public static org.apache.maven.model.Developer findChair( java.util.List developers )
+ {
+ if ( developers == null || developers.isEmpty() )
+ {
+ return null;
+ }
+
+ for ( java.util.Iterator it = developers.iterator(); it.hasNext(); )
+ {
+ org.apache.maven.model.Developer developer = (org.apache.maven.model.Developer) it.next();
+ java.util.List roles = developer.getRoles();
+
+ for ( java.util.Iterator it2 = roles.iterator(); it2.hasNext(); )
+ {
+ String role = (String) it2.next();
+
+ if ( role.toLowerCase().indexOf( "chair" ) != -1 )
+ {
+ return developer;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Find the list of PMC members of the project. The role of each developer should contain <code>pmc</code>.
+ *
+ * @param developers list of <code>{@link org.apache.maven.model.Developer}</code>
+ * @return a not null list of Developer.
+ */
+ public static java.util.List findPMCMembers( java.util.List developers )
+ {
+ if ( developers == null || developers.isEmpty() )
+ {
+ return null;
+ }
+
+ java.util.List pmc = new java.util.ArrayList();
+ for ( java.util.Iterator it = developers.iterator(); it.hasNext(); )
+ {
+ org.apache.maven.model.Developer developer = (org.apache.maven.model.Developer) it.next();
+ java.util.List roles = developer.getRoles();
+
+ for ( java.util.Iterator it2 = roles.iterator(); it2.hasNext(); )
+ {
+ String role = (String) it2.next();
+
+ if ( role.toLowerCase().indexOf( "pmc" ) != -1 )
+ {
+ pmc.add( developer );
+ }
+ }
+ }
+
+ return pmc;
+ }
+ ]]>
+ </code>
+ </codeSegment>
+ </codeSegments>
+ </class>
+
+ <class>
+ <name>Standard</name>
+ <description><![CDATA[The "Standard" element is used to list all the relevant standards implemented by the project.
+These standards include W3C or ISO standards, RFCs, various technical specifications etc.
+Example:
+<pre>
+<asfext:implements>
+ <asfext:Standard>
+ <asfext:title>Extensible Stylesheet Language - Formatting Objects (XSL-FO 1.1)</asfext:title>
+ <asfext:body>W3C</asfext:body>
+ <asfext:id>XSL 1.1</asfext:id>
+ <asfext:url rdf:resource="http://www.w3.org/TR/xsl11/"/>
+ </asfext:Standard>
+</asfext:implements>
+</pre>
+@see <a href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a>]]></description>
+ <version>1.0.0</version>
+ <fields>
+ <field>
+ <name>title</name>
+ <description><![CDATA[The expanded title of the standard. Required.
+@see <a href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a>]]></description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <required>true</required>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>body</name>
+ <description><![CDATA[The body which published the standard (Example: "W3C", "OASIS", "ISO" etc.). Required.
+@see <a href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a>]]></description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <required>true</required>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>id</name>
+ <description><![CDATA[An identifier for the standard (Example: ISO/IEC 15438, RFC2397, JSR206 etc.). Required.
+@see <a href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a>]]></description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <required>true</required>
+ <identifier>true</identifier>
+ </field>
+ <field>
+ <name>url</name>
+ <description><![CDATA[An URL pointing to the standard (main website or specification document). Optional.
+@see <a href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a>]]></description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ </fields>
+ </class>
+ </classes>
+</model>
Propchange: maven/plugins/trunk/maven-doap-plugin/src/main/mdo/asfextOptions.mdo
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-doap-plugin/src/main/mdo/asfextOptions.mdo
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/plugins/trunk/maven-doap-plugin/src/main/mdo/doapOptions.mdo
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-doap-plugin/src/main/mdo/doapOptions.mdo?rev=677407&r1=677406&r2=677407&view=diff
==============================================================================
--- maven/plugins/trunk/maven-doap-plugin/src/main/mdo/doapOptions.mdo (original)
+++ maven/plugins/trunk/maven-doap-plugin/src/main/mdo/doapOptions.mdo Wed Jul 16 13:24:39 2008
@@ -37,6 +37,14 @@
<version>1.0.0</version>
<fields>
<field>
+ <name>shortdesc</name>
+ <description><![CDATA[Short (8 or 9 words) plain text description of a project.
+@see <a href="http://usefulinc.com/ns/doap#shortdesc">http://usefulinc.com/ns/doap#shortdesc</a>]]></description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ <field>
<name>category</name>
<description><![CDATA[A category of project.<br/>
<b>Note</b>: This string is comma separated to allow several categories.