[ 
https://issues.apache.org/jira/browse/MJAVADOC-813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17883913#comment-17883913
 ] 

Michael Osipov edited comment on MJAVADOC-813 at 9/23/24 3:21 PM:
------------------------------------------------------------------

Well, the actual reproducer creates a chicken-and-egg problem. You cannot link 
to something which is not there, but if it is not there you cannot generate it. 
Here it makes on sense to do, but if you are using the wrong directory. Fix:
{noformat}
$ diff pom.xml.orig pom.xml --ignore-all-space
--- pom.xml.orig        2024-09-23 17:12:31.497543000 +0200
+++ pom.xml     2024-09-23 17:16:13.386163000 +0200
@@ -35,7 +35,7 @@
                             <offlineLinks>
                                 <offlineLink>
                                     
<url>https://cowwoc.github.io/requirements.java/${project.version}/docs/api/</url>
-                                    
<location>${project.basedir}/target/apidocs/</location>
+                                    
<location>${project.build.directory}/reports/apidocs/</location>
                                 </offlineLink>
                             </offlineLinks>
                         </configuration>

{noformat}

You haven't paid attention to the announcement: 
https://www.mail-archive.com/announce@maven.apache.org/msg01478.html
MJAVADOC-560 which in turn is also 
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=235836144#TowardsDoxia2.0.0Stack-MavenReportingImpl4.0.0


was (Author: michael-o):
Well, the actual reproducer creates a chicken-and-egg problem. You cannot link 
to something which is not there, but if it is not there you cannot generate it. 
Here it makes on sense to do, but if you are using the wrong directory. Fix:
{code:patch}
$ diff pom.xml.orig pom.xml --ignore-all-space
--- pom.xml.orig        2024-09-23 17:12:31.497543000 +0200
+++ pom.xml     2024-09-23 17:16:13.386163000 +0200
@@ -35,7 +35,7 @@
                             <offlineLinks>
                                 <offlineLink>
                                     
<url>https://cowwoc.github.io/requirements.java/${project.version}/docs/api/</url>
-                                    
<location>${project.basedir}/target/apidocs/</location>
+                                    
<location>${project.build.directory}/reports/apidocs/</location>
                                 </offlineLink>
                             </offlineLinks>
                         </configuration>

{code}

You haven't paid attention to the announcement: 
https://www.mail-archive.com/announce@maven.apache.org/msg01478.html
MJAVADOC-560 which in turn is also 
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=235836144#TowardsDoxia2.0.0Stack-MavenReportingImpl4.0.0

> [regression] The given File link: X is not a dir
> ------------------------------------------------
>
>                 Key: MJAVADOC-813
>                 URL: https://issues.apache.org/jira/browse/MJAVADOC-813
>             Project: Maven Javadoc Plugin
>          Issue Type: Bug
>          Components: javadoc
>    Affects Versions: 3.10.0
>            Reporter: Gili
>            Assignee: Michael Osipov
>            Priority: Major
>         Attachments: javadoc-test.zip
>
>
> Given:
> {noformat}
> <offlineLinks>
>   <offlineLink>
>     
> <url>https://cowwoc.github.io/requirements.java/${project.version}/docs/api/</url>
>     <location>${rootBaseDir}/java/target/apidocs/</location>
>   </offlineLink>
> </offlineLinks>{noformat}
>  
>  
> Running the "attach-javadocs" goal works fine in version 3.8.0 but if I 
> update to version 3.10.0 the execution fails with:
>  
>  
> {noformat}
> [ERROR] The given File link: 
> C:\Users\Gili\Documents\requirements.java\guava\..\java\target\apidocs is not 
> a dir.
> [ERROR] Error fetching link: 
> C:\Users\Gili\Documents\requirements.java\guava/../java/target/apidocs/. 
> Ignored it.  {noformat}
>  
> Under version 3.8.0 the target/apidocs directory is created and the javadoc 
> is generated. Under version 3.10.0 the error is thrown and the apidocs 
> directory is never created.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to