Files cannot be uploaded to FTP server when included by Composer from a local 'path' repository
Apache NetBeans version
Apache NetBeans 27
What happened
Files cannot be uploaded to FTP server when included by Composer from a local 'path' repository.
This started happening after I switched from NetBeans 17 to NetBeans 26, and updating to NetBeans 27 has not helped.
Language / Project Type / NetBeans Component
PHP Composer project
How to reproduce
Create basic composer project and inside composer.json file, include something like this:
"repositories": [
{
"type": "path",
"url": "../../../Global Libs/dbi/dbi_libs"
}
],
"require": {
"sps/dbi": "*"
}
Then in terminal on the project folder run composer update
This should create the appropriate 'vendor' directory which includes the files from the source you specified in the composer.json file.
When right-clicking on the 'vendor' folder and selecting upload, it will not upload any of the files from the source you specified in composer.json
Did this work correctly in an earlier version?
Apache NetBeans 24 or earlier
Operating System
Windlows 11
JDK
24
Apache NetBeans packaging
FoAN provided installer
Anything else
When viewing the directory in Windows Explorer project > vendor > sps
Are you willing to submit a pull request?
No
Maybe same issue. Begin from version 26 (and exist in 27). Try upload file from folder symbolic link and nothing happens, but exception:
java.lang.IllegalArgumentException: File 'C:\Project\web\vendor_folder\yii2-shared-middleware\SomeFile.php' must be underneath base directory 'C:\Project\web\current_project' at org.netbeans.modules.php.project.connections.transfer.LocalTransferFile.
(LocalTransferFile.java:52) at org.netbeans.modules.php.project.connections.transfer.TransferFile.fromFile(TransferFile.java:168) at org.netbeans.modules.php.project.connections.transfer.TransferFile.fromFileObject(TransferFile.java:117) at org.netbeans.modules.php.project.connections.RemoteClient.prepareUpload(RemoteClient.java:283) at org.netbeans.modules.php.project.ui.actions.UploadCommand.prepareUpload(UploadCommand.java:106) at org.netbeans.modules.php.project.ui.actions.UploadCommand.uploadFiles(UploadCommand.java:97) at org.netbeans.modules.php.project.ui.actions.UploadCommand.invokeActionImpl(UploadCommand.java:82) at org.netbeans.modules.php.project.ui.actions.UploadCommand$1.run(UploadCommand.java:69) at org.netbeans.modules.php.project.ui.actions.RemoteCommand$1.run(RemoteCommand.java:83) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403) at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2018)
File upload by path C:\Project\web\current_project\vendor\yii2-shared-middleware\SomeFile.php C:\Project\web\current_project\vendor\yii2-shared-middleware\ is symbolic folder C:\Project\web\vendor_folder
I tested this without composer and creating a symlink on windows pointing outside the directory will yield this exception if JDK24 is used.
I suspect we see fallout from https://bugs.openjdk.org/browse/JDK-8355342 here too. We might have to rework the check in the FTP integration, but before we do this, we should wait how the situation will look with a fix for the referenced issue.