Author: vsiveton
Date: Sun Dec 12 22:16:32 2010
New Revision: 1044941
URL: http://svn.apache.org/viewvc?rev=1044941&view=rev
Log:
MDOAP-31: Generated DOAP Mailing lists are too stricts
o added a new ML parameter
Modified:
maven/plugins/trunk/maven-doap-plugin/src/main/java/org/apache/maven/plugin/doap/DoapMojo.java
maven/plugins/trunk/maven-doap-plugin/src/main/mdo/doapOptions.mdo
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=1044941&r1=1044940&r2=1044941&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
Sun Dec 12 22:16:32 2010
@@ -815,40 +815,50 @@ public class DoapMojo
*
* @param writer not null
* @see <a
href="http://usefulinc.com/ns/doap#mailing-list">http://usefulinc.com/ns/doap#mailing-list</a>
+ * @see DoapOptions#getMailingList()
+ * @see MavenProject#getMailingLists()
*/
private void writeMailingList( XMLWriter writer )
{
- if ( project.getMailingLists() == null ||
project.getMailingLists().isEmpty() )
+ if ( StringUtils.isEmpty( doapOptions.getMailingList() ) ||
project.getMailingLists() == null || project.getMailingLists().isEmpty() )
{
return;
}
XmlWriterUtil.writeLineBreak( writer );
XmlWriterUtil.writeCommentText( writer, "Mailing lists.", 2 );
- @SuppressWarnings( "unchecked" )
- List<MailingList> mailingLists = project.getMailingLists();
- for ( MailingList mailingList : mailingLists )
+ if ( StringUtils.isNotEmpty( doapOptions.getMailingList() ) )
{
- if ( StringUtils.isNotEmpty( mailingList.getArchive() ) )
- {
- DoapUtil.writeRdfResourceElement( writer, "mailing-list",
mailingList.getArchive() );
- }
- else
- {
- getLog().warn( "No archive was specified for mailing list " +
mailingList.getName() );
- }
-
- if ( mailingList.getOtherArchives() != null )
+ DoapUtil.writeRdfResourceElement( writer, "mailing-list",
doapOptions.getMailingList() );
+ }
+ else
+ {
+ @SuppressWarnings( "unchecked" )
+ List<MailingList> mailingLists = project.getMailingLists();
+ for ( MailingList mailingList : mailingLists )
{
- for ( String otherArchive : mailingList.getOtherArchives() )
+ if ( StringUtils.isNotEmpty( mailingList.getArchive() ) )
{
- if ( StringUtils.isNotEmpty( otherArchive ) )
- {
- DoapUtil.writeRdfResourceElement( writer,
"mailing-list", otherArchive );
- }
- else
+ DoapUtil.writeRdfResourceElement( writer, "mailing-list",
mailingList.getArchive() );
+ }
+ else
+ {
+ getLog().warn( "No archive was specified for mailing list
" + mailingList.getName() );
+
+ if ( mailingList.getOtherArchives() != null )
{
- getLog().warn( "No other archive was specified for
mailing list " + mailingList.getName() );
+ for ( String otherArchive :
mailingList.getOtherArchives() )
+ {
+ if ( StringUtils.isNotEmpty( otherArchive ) )
+ {
+ DoapUtil.writeRdfResourceElement( writer,
"mailing-list", otherArchive );
+ }
+ else
+ {
+ getLog().warn( "No other archive was specified
for mailing list "
+ + mailingList.getName() );
+ }
+ }
}
}
}
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=1044941&r1=1044940&r2=1044941&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 Sun Dec
12 22:16:32 2010
@@ -73,6 +73,15 @@ under the License.
<identifier>true</identifier>
</field>
<field>
+ <name>mailingList</name>
+ <description><![CDATA[Single web page that allows people to find out
more information about the mailing lists provided by the project.<br/>
+<b>Note</b>: this field supercedes the default Maven mailing lists.
+...@see <a
href="http://usefulinc.com/ns/doap#mailing-list">http://usefulinc.com/ns/doap#mailing-list</a>]]></description>
+ <version>1.0.0</version>
+ <type>String</type>
+ <identifier>true</identifier>
+ </field>
+ <field>
<name>oldHomepage</name>
<description><![CDATA[URL of a project's past homepage, associated
with exactly one project.
@see <a
href="http://usefulinc.com/ns/doap#old-homepage">http://usefulinc.com/ns/doap#old-homepage</a>]]></description>