You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "matthiasblaesing (via GitHub)" <gi...@apache.org> on 2026/09/29 19:48:44 UTC

Re: [I] Files cannot be uploaded to FTP server when included by Composer from a local 'path' repository [netbeans]

matthiasblaesing commented on issue #8781:
URL: https://github.com/apache/netbeans/issues/8781#issuecomment-5897478939

   Steps to reproduce locally:
   
   ```shell
   cd c:\temp
   mkdir comp-test
   mkdir comp-test\lib
   mkdir comp-test\consumer
   cd comp-test\lib
   composer init
   ```
   
   Package name: demo/lib
   Everything else empty/default
   
   ```shell
   cd ..
   cd consumer
   composer init
   ```
   
   Package name: consumer
   Everything else empty/default
   
   Update composer.json in `consumer`:
   
   ```json
   {
     // ...
     "repositories": [{
       "type": "path",
       "url": "../lib"
     }],
     "require": {
        "demo/lib": "dev-main"
     }
     // ...
   }
   ```
   
   run "composer install" in consumer 
   
   The problem ist most probably caused by this:
   
   ```
   jshell> new File("C:/Temp/comp-test/consumer/vendor/demo/lib/composer.json").getAbsolutePath();
   $2 ==> "C:\\Temp\\comp-test\\consumer\\vendor\\demo\\lib\\composer.json"
   
   jshell> new File("C:/Temp/comp-test/consumer/vendor/demo/lib/composer.json").getCanonicalPath();
   $3 ==> "C:\\Temp\\comp-test\\lib\\composer.json"
   ```
   
   On linux the problem is not observed as there the file normalization uses `getAbsolutePath`, while the windows implementation uses `getCanonicalPath`. `getCanonicalPath` normalizes the path and resolves the junction composer uses to reference the local directory.
   
   The file upload checks that files uploaded are "below" the project directory, which is true based on comparison of the normalized paths. We might need to do a tree search of the project directory to locate symlinks/junctions in it and record the "secondary" roots.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists