FELIX-498: add <javadoc> tag to OBR resource if javadocs are attached

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@629375 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ResourcesBundle.java b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ResourcesBundle.java
index d187679..ed337ef 100644
--- a/bundleplugin/src/main/java/org/apache/felix/obrplugin/ResourcesBundle.java
+++ b/bundleplugin/src/main/java/org/apache/felix/obrplugin/ResourcesBundle.java
@@ -77,6 +77,11 @@
     private String m_source;
 
     /**
+     * store the bundle javadoc.
+     */
+    private String m_javadoc;
+
+    /**
      * store the bundle license.
      */
     private String m_license;
@@ -261,6 +266,18 @@
     }
 
 
+    public String getJavadoc()
+    {
+        return m_javadoc;
+    }
+
+
+    public void setJavadoc( String javadoc )
+    {
+        m_javadoc = javadoc;
+    }
+
+
     public String getId()
     {
         return m_id;
@@ -323,6 +340,7 @@
         Element size = father.createElement( "size" );
         Element documentation = father.createElement( "documentation" );
         Element source = father.createElement( "source" );
+        Element javadoc = father.createElement( "javadoc" );
         Element license = father.createElement( "license" );
 
         resource.setAttribute( "id", getId() );
@@ -349,6 +367,12 @@
             resource.appendChild( source );
         }
 
+        if ( getJavadoc() != null )
+        {
+            XmlHelper.setTextContent( javadoc, getJavadoc() );
+            resource.appendChild( javadoc );
+        }
+
         if ( getLicense() != null )
         {
             XmlHelper.setTextContent( license, getLicense() );
@@ -382,10 +406,10 @@
      * @param project project information given by maven
      * @param ebi bundle information extracted from bindex
      * @param sourcePath path to local sources
-     * @param docPath path to local docs
+     * @param javadocPath path to local javadocs
      * @return true
      */
-    public boolean construct( MavenProject project, ExtractBindexInfo ebi, String sourcePath, String docPath )
+    public boolean construct( MavenProject project, ExtractBindexInfo ebi, String sourcePath, String javadocPath )
     {
 
         if ( ebi.getPresentationName() != null )
@@ -449,7 +473,7 @@
         String documentation = project.getUrl();
         if ( null == documentation )
         {
-            documentation = docPath;
+            documentation = javadocPath;
         }
 
         if ( ebi.getDocumentation() != null )
@@ -478,6 +502,8 @@
             setSource( sourcePath );
         }
 
+        setJavadoc( javadocPath );
+
         if ( ebi.getLicense() != null )
         {
             setLicense( ebi.getLicense() );