Problems with hot deploy

OK, then please be aware that you have issues with Hot Deploy.
In previous versions, if I made changes to the code and then stop the Idea and re run, the Hot Deploy was started automatically. Now I need to check all the time if Hot Deploy started because it doesn’t always happen (for example, if I comment a few lines, etc.).

Best Regards,
-n

Hi,
If you want CUBA team to be able to help you, please provide information about your environment:

  • What CUBA version do you use?

  • What Studio version do you use? (CUBA ->Welcome -> Product Versions)

  • What is the value of the settings CUBA -> Settings -> “Instant hot deploy” and “Hot deploy compiled classes” ?

  • Please present the screenshot of the hot deploy settings dialog: CUBA -> Settings -> Hot Deploy Settings.

  • Please present here your build.gradle file (cleared from any passwords or other sensitive information if there is).

  • Please present a screenshot of how the screen looks like when the hot deploy doesn’t happen.
    Are there any messages in the console on the bottom of the screen?

1 Like

Hi Alex,

  1. 7.2.3
  2. Cuba Studio version: 12.1-191
  3. Instant hot deploy is checked
  4. image
  5. see atached
  6. the problem is that hot deploy doesn’t start when I make some modification and re (run)/start the IDEA but only if I have the application (UI) opened and even then it does not always happen.
    (upload://l27WhKkA77bPA8rIomN2uBm6O8J.txt) (5.0 KB)

Is there any shortcut key for hot deploy?

Hi,
Your CUBA Studio version (12.1) is very old. It does not support CUBA 7.2 at all.
You have to download and use the latest Studio version.

Keeping in mind Studio updates coming soon, I would advise to do it the following way:

OK.I ve done this. Thank you!
However this action doesn’t solve the problem.
Maybe I wasn’t very clear: I am in Idea, I make some code modification, Run the Idea, Starting server…at http://localhost:8080…open the program…the modifications are not taken because Hot deploy is not triggered. I make (again) a modification in code (int i=1; whatever, except //comments), the Hot Deploy start to work and appears in Console. Now modifications are taken.

OK, good.

Based on your description, I suspect that the problem is because of wrong build.gradle content (clearConf task not working properly when the CUBA run configuration is started).

So please present your build.gradle contents cleared from sensitive content. File in your previous post wasn’t successfully attached for some reason.

Please find attached.gradle.txt (5.1 KB)

Hi,
Yes, your build.gradle file has some wrong references to cuba.tomcat.dir.
The reason for that was - you used too old Studio version to migrate your project to CUBA 7.2.

E.g. cleanConf task should use “cuba.appHome”, not “cuba.tomcat.dir”. It should be like this:

    task cleanConf(description: 'Cleans up conf directory', type: Delete) {
        delete "$cuba.appHome/${modulePrefix}-core/conf"
    }

You need to manually make modifications your some project files.
Changes are described here:
https://youtrack.cuba-platform.com/issue/STUDIO-6936
https://youtrack.cuba-platform.com/issue/STUDIO-6832

You can also create new empty project based on CUBA 7.2, and compare contents of fresh build.gradle file with your build script to see where changes should be made.

Hello Alex,

Is strange because in Cuba/Welcome I have:

image
In conclusion I must replace this:

  task cleanConf(description: 'Cleans up conf directory') {
        doLast {
            def dir = new File(cuba.tomcat.dir, "/conf/${modulePrefix}")
            if (dir.isDirectory()) {
                ant.delete(includeemptydirs: true) {
                    fileset(dir: dir, includes: '**/*', excludes: 'local.app.properties')
                }
            }
        }
    }

with this

 task cleanConf(description: 'Cleans up conf directory', type: Delete) {
        delete "$cuba.appHome/${modulePrefix}-core/conf"
    }

???

BR,
-n

You have migrated your project to CUBA 7.2 at some point in the past by using an old Studio version.

Yes, in two places of build.gradle (there are two cleanConf tasks). It should fix hot-deploy.

But there are some other places in project config files that need to be fixed. Again:

It’s better now, thank you.
However I don’t understand why (when I made Cuba platform update) the build.gradle file didn’t update automatically?
Let say I have an old project made in Cuba 7.1 and old Cuba Studio and now I want to add some new features.
I make update to the last Cuba Platform version…update Cuba Studio and after that I make a new test project and compare/update the build.gradle file?
I knew that Cuba Studio Plugin was related mainly to the let say “interface” with the user and the update is not so “dangerous”. Now I see that has an impact to build.gradle file as well (like the Cuba platform).

Please advise,
-n

As long as you stay up to date you’ll be fine. You were very, very, very far behind on versions. That generally is a bad idea in anything to do with computers. :smiley:

1 Like

It didn’t update automatically because you used the old Studio 12.1.
It was our mistake that we did not limit users and allowed Studio 12 to use CUBA 7.2 and migrate projects to 7.2.

But anyway it is a good idea to keep your Studio installation to be the latest version, because any new Studio version brings improvements and bug fixes not just for latest platform version, but for all projects and versions.

Thank you!