This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 271216 - The option to force archive deployment instead of directory deployment should be supported
Summary: The option to force archive deployment instead of directory deployment should...
Status: NEW
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 8.2
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-01 17:44 UTC by brett
Modified: 2017-08-17 03:06 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Screenshot of the proposed addition (60.43 KB, image/png)
2017-08-02 11:25 UTC, brett
Details

Note You need to log in before you can comment on or make changes to this bug.
Description brett 2017-08-01 17:44:41 UTC
Back in Netbeans 6.x with Glassfish 2.x, it was possible to disable directory deployment.  Directory deployment sometimes does not work depending on the application being deployed or its construction.

Examples:

https://forums.netbeans.org/topic46412.html&highlight=directory+deploy
https://forums.netbeans.org/topic56095.html&highlight=directory+deploy

With Netbeans 8.x and Glassfish 4.x there is no way to disable directory deployment when the Glassfish server is local.   

There should be a way to disable directly deployment and force archive deployment
Comment 1 brett 2017-08-01 17:50:14 UTC
I have implemented this enhancement by modifying the Glassfish Common module and the Glassfish Java EE module.

The attached image shows the UI for the Glassfish server properties.  There is a new "Force Archive Deployment" option to force the deployment to not do directory deployment but rather upload the archive.

This is a simple change GlassishModule.java with the addition of:

    
    public static final String FORCE_ARCHIVE_DEPLOYMENT_FLAG = "forceArchiveDeployment";
    
A simple change to the InstancePanel.java to add support for the "Force Archive Deployment" checkbox.

And then a simple change FastDeploy.java to not support directory deployment if the "Force Archive Deployment" is checked:


   @Override
    public boolean canFileDeploy(Target target, J2eeModule deployable) {
        if (null == deployable){
            return false;
        }
        
        if (deployable.getType() == J2eeModule.Type.CAR) {
            return false;
        }

        final GlassfishModule commonSupport = dm.getCommonServerSupport();
// new code
        Boolean forceArchiveDeployment = Boolean.parseBoolean(commonSupport.getInstanceProperties().get(GlassfishModule.FORCE_ARCHIVE_DEPLOYMENT_FLAG));
        if (Boolean.TRUE.equals(forceArchiveDeployment)) {
            return false;
        }
//
        String url = commonSupport.getInstanceProperties().get(GlassfishModule.URL_ATTR);

        if (!url.trim().matches(".*:[0-9]+$"))  // NOI18N
            return url.trim().endsWith("server");

        return true;
    }
Comment 2 brett 2017-08-02 11:25:29 UTC
Created attachment 164885 [details]
Screenshot of the proposed addition

I forgot to upload what the screen would look like with the new addition.