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

Summary: The option to force archive deployment instead of directory deployment should be supported
Product: serverplugins Reporter: brett <brett>
Component: GlassFishAssignee: Petr Hejl <phejl>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 7   
See Also: https://netbeans.org/bugzilla/show_bug.cgi?id=271314
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Screenshot of the proposed addition

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.