how to remove desktop-module and portal-module from project

I want to remove desktop-module and portlet-module from project and keep only the web application portal.
Please help me to do this…
Thanks!
Hariprasad

Hello,
Studio does not provide simple facility to remove created modules, but it can be done manually.
When the new portal-, desktop- or web toolkit module is created bu Studio:

  1. new sources are generated in the project (they are put into the corresponding folder in the ‘modules’- directory)
  2. build.gradle configuration file is modified
  3. settings.gradle configuration is modified

So If you have added a new module and want to delete it, you should revert the changes listed above.

To remove the desktop module:

  1. Modify the build.gradle file:
    a) erase the
def desktopModule = project(':app-desktop')

b) remove the desktopModule from a list of modules of the common ‘configure’ -block

configure([globalModule, coreModule, guiModule, webModule, <s>desktopModule</s>])

c) erase the ‘desktopModule’ configure - block

configure(desktopModule) {..

d) remove the delete("$cuba.tomcat.dir/webapps/app-webstart") from the ‘undeploy’ task of the Web module:

task undeploy(type: Delete, dependsOn: ':app-web:cleanConf') {
     delete("$cuba.tomcat.dir/shared")
     delete("$cuba.tomcat.dir/webapps/app-core")
     delete("$cuba.tomcat.dir/webapps/app")
<s>delete("$cuba.tomcat.dir/webapps/app-webstart")</s>
  1. Modify the settings.gradle file:
    a) remove the ‘:app-desktop’ from the ‘include’ expression
 include(':app-global', ':app-core', ':app-gui', ':app-web', <s>':app-desktop'</s>)

b) remove the:

project(':app-desktop').projectDir = new File(settingsDir, 'modules/desktop')
  1. Finally, remove the ‘desktop’ folder from the ‘modules’ directory of the project.

To remove the portal module:

  1. Modify the build.gradle file:
    a) erase the
def portalModule = project(':app-portal')

b) remove the portalModule from a list of modules of the common ‘configure’ -block

configure([globalModule, coreModule, guiModule, webModule, <s>portalModule</s>])

c) erase the ‘portalModule’ configure - block

configure(portalModule) {..

d) remove the delete("$cuba.tomcat.dir/webapps/app-portal") from the ‘undeploy’ task of the Web module:

task undeploy(type: Delete, dependsOn: ':app-web:cleanConf') {
     delete("$cuba.tomcat.dir/shared")
     delete("$cuba.tomcat.dir/webapps/app-core")
     delete("$cuba.tomcat.dir/webapps/app")
<s>delete("$cuba.tomcat.dir/webapps/app-webstart")</s>

e) erase the ‘:app-portal:deploy’ from dependencies of the ‘restart’ task
task restart(dependsOn: [‘stop’, ‘:app-core:deploy’, ‘:app-web:deploy’, ‘:app-portal:deploy’], description: ‘Redeploys applications and restarts local Tomcat’)

  1. Modify the settings.gradle file:
    a) remove the’:app-portal’ from the ‘include’ expression
 include(':app-global', ':app-core', ':app-gui', ':app-web', <s>':app-portal'</s>)

b) remove the:

project(':app-portal').projectDir = new File(settingsDir, 'modules/portal')
  1. Remove the ‘portal’ folder from ‘modules’ directory of the project.

To remove the web toolkit module:

  1. Modify the build.gradle:
    a) erase
def webToolkitModule = project(':app-web-toolkit')

b) remove the webToolkitModule form the list of modules of the common ‘configure’ - block

configure([globalModule, coreModule, guiModule, webModule, <s>webToolkitModule</s>]){
    apply(plugin: 'java')
    apply(plugin: 'maven')
    apply(plugin: 'idea')
...

c) To a ‘webModule’ configuration, bring back a dependency on the cuba-web-toolkit:


dependencies {
        provided(servletApi)
        compile(guiModule)
        compile("com.haulmont.cuba:cuba-web:$cubaVersion")
        webcontent("com.haulmont.cuba:cuba-web:$cubaVersion:web@zip")
        <i>webcontent("com.haulmont.cuba:cuba-web-toolkit:$cubaVersion:web@zip")</i>
        testCompile("com.haulmont.cuba:cuba-client-tests:$cubaVersion")

d) remove the configure(webToolkitModule) block

configure(webToolkitModule) {
+    dependencies {
+        compile(webModule)
...

e) remove a dependency on the ‘:app-web-toolkit:deploy’ from a ‘restart’ task

task restart(dependsOn: ['stop', ':app-core:deploy', ':app-web:deploy', <s>':app-web-toolkit:deploy'</s>], description: 'Redeploys applications and restarts local Tomcat')
  1. Modify settings.gradle:
    a) remove ‘:app-web-toolkit’ from the ‘include’ expression
include(':app-global', ':app-core', ':app-gui', ':app-web', <s>':app-web-toolkit' </s>)

b) remove the

 project(':app-web-toolkit').projectDir = new File(settingsDir, 'modules/web-toolkit')
1 Like