Author: mkleint
Date: Wed Nov 21 10:28:16 2007
New Revision: 597171

URL: http://svn.apache.org/viewvc?rev=597171&view=rev
Log:
use MavenSession for ToolchainManager calls, plugin requires 2.1-SNAPSHOT now

Modified:
    maven/plugins/branches/MNG-468/maven-javadoc-plugin/pom.xml
    
maven/plugins/branches/MNG-468/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java

Modified: maven/plugins/branches/MNG-468/maven-javadoc-plugin/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/branches/MNG-468/maven-javadoc-plugin/pom.xml?rev=597171&r1=597170&r2=597171&view=diff
==============================================================================
--- maven/plugins/branches/MNG-468/maven-javadoc-plugin/pom.xml (original)
+++ maven/plugins/branches/MNG-468/maven-javadoc-plugin/pom.xml Wed Nov 21 
10:28:16 2007
@@ -43,7 +43,7 @@
   </issueManagement>
 
   <prerequisites>
-    <maven>2.0.6</maven>
+    <maven>2.1-SNAPSHOT</maven>
   </prerequisites>
 
   <build>

Modified: 
maven/plugins/branches/MNG-468/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/branches/MNG-468/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java?rev=597171&r1=597170&r2=597171&view=diff
==============================================================================
--- 
maven/plugins/branches/MNG-468/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
 (original)
+++ 
maven/plugins/branches/MNG-468/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
 Wed Nov 21 10:28:16 2007
@@ -53,7 +53,7 @@
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
 import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.context.BuildContextManager;
+import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.javadoc.options.Group;
 import org.apache.maven.plugin.javadoc.options.DocletArtifact;
@@ -97,10 +97,14 @@
     private ToolchainManager toolchainManager;
     
     /**
+     * The current build session instance. This is used for
+     * toolchain manager API calls.
      *
-     * @component
+     * @parameter expression="${session}"
+     * @required
+     * @readonly
      */
-    private BuildContextManager buildContextManager;
+    private MavenSession session;
 
     /**
      * The current class directory
@@ -2059,14 +2063,18 @@
     private String getJavadocExecutable()
         throws IOException
     {
-        Toolchain tc = toolchainManager.getToolchainFromBuildContext("jdk", 
//NOI18N
-                                buildContextManager.readBuildContext(true));
-        if (tc != null) {
-            getLog().info("Toolchain in javadoc-plugin: " + tc);
-            if ( javadocExecutable  != null) { 
-                getLog().warn("Toolchains are ignored, 'javadocExecutable' 
parameter is set to " + javadocExecutable);
-            } else {
-                javadocExecutable = tc.findTool("javadoc"); //NOI18N
+        Toolchain tc = toolchainManager.getToolchainFromBuildContext( "jdk", 
//NOI18N
+                                session );
+        if ( tc != null )
+        {
+            getLog().info( "Toolchain in javadoc-plugin: " + tc );
+            if ( javadocExecutable  != null) 
+            { 
+                getLog().warn( "Toolchains are ignored, 'javadocExecutable' 
parameter is set to " + javadocExecutable );
+            } 
+            else 
+            {
+                javadocExecutable = tc.findTool( "javadoc" ); //NOI18N
             }
         }
         


Reply via email to