Uploaded image for project: 'Spring Tool Suite'
  1. Spring Tool Suite
  2. STS-2213

STS should allow more parameters for Gradle builds / task execution to be controlled via the task UI (JRE home, system properties, environment parameters, Java options ...)

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 2.8.0.RELEASE
    • Fix Version/s: 3.0.0.M2
    • Component/s: GRADLE
    • Labels:
      None

      Description

      I don't know how hard it would be, but I miss the possibility to run Gradle in a different JRE when configuring a Gradle Build launch configuration, just like it is possible with an Ant Build.

      Benefits:

      • the possibility to specify the JRE to use (see "JRE" tab of an Ant Build launch configuration)
      • the possibility to compose the classpath for the Gradle build script (see "Classpath" tab of an Ant Build launch configuration)
      • (most important) the possibility to set environment variables (see "Environment" tab of an Ant Build launch configuration) to be made available to Gradle when running the build script

      The last thing would be extremely useful to me: in fact, right now the Gradle daemon says that I have no JAVA_HOME set (because I haven't this environment variable set at the OS level) so if I run a Gradle task that needs to compile Java code from Eclipse, I get an error because a JDK cannot be found. So, I'm forced to set this environment variable at the OS level or at least to make it available to the whole Eclipse IDE, with possible side effects on other components that may use that environment variable value.

        Activity

        Hide
        kdvolder Kris De Volder added a comment -

        Actually, I think most if not all of what you are asking for is possible since now since 3.0.0.M2 (but I guess I just forgot to close the issue when I did the work).

        In M2 you can now configure Java_HOME and commandline options to pass to Gradle in both a Global preferences page and individual launch configurations.

        So I'll close it now.

        If you are still finding that there are things that you can't do, or have suggestions on how to improve it further, please don't hesitate to open other issues / bugs/ feature requests.

        Show
        kdvolder Kris De Volder added a comment - Actually, I think most if not all of what you are asking for is possible since now since 3.0.0.M2 (but I guess I just forgot to close the issue when I did the work). In M2 you can now configure Java_HOME and commandline options to pass to Gradle in both a Global preferences page and individual launch configurations. So I'll close it now. If you are still finding that there are things that you can't do, or have suggestions on how to improve it further, please don't hesitate to open other issues / bugs/ feature requests.
        Hide
        mauromol Mauro Molinari added a comment - - edited

        Hi Kris,
        actually I can't find the possibility to select the JRE in the launch configuration in STS 3.1.0: I can just add JVM/program args. I can't find the possibility to set environment variables either.
        Moreover, another option which is present for Ant builds could be useful: a checkbox to choose whether the project must be built before launching or not (see the "Build" tab for Ant launch configurations). Right now, build before launching is always on. There are (many, if not all) cases in which I don't need the project to be built in Eclipse before launching the Gradle build script, so it would be better not having to wait for a project build to complete if not necessary.

        Show
        mauromol Mauro Molinari added a comment - - edited Hi Kris, actually I can't find the possibility to select the JRE in the launch configuration in STS 3.1.0: I can just add JVM/program args. I can't find the possibility to set environment variables either. Moreover, another option which is present for Ant builds could be useful: a checkbox to choose whether the project must be built before launching or not (see the "Build" tab for Ant launch configurations). Right now, build before launching is always on. There are (many, if not all) cases in which I don't need the project to be built in Eclipse before launching the Gradle build script, so it would be better not having to wait for a project build to complete if not necessary.
        Hide
        kdvolder Kris De Volder added a comment -

        All good points. But I don't want to reopen this issue. Would you mind creating separate smaller issues?

        I would have to investigate and implement each separately. I don't even know, at the moment, if it is posible to set env variables via the tooling API. So some of what you are asking here is probably implementable today, but other bits may not be. That's a good reason to split things up.

        Show
        kdvolder Kris De Volder added a comment - All good points. But I don't want to reopen this issue. Would you mind creating separate smaller issues? I would have to investigate and implement each separately. I don't even know, at the moment, if it is posible to set env variables via the tooling API. So some of what you are asking here is probably implementable today, but other bits may not be. That's a good reason to split things up.
        Hide
        mauromol Mauro Molinari added a comment -

        Hi Kris, I opened STS-2998, STS-2999 and STS-3000 (yeah, I won the issue number 3000! :-D).

        Show
        mauromol Mauro Molinari added a comment - Hi Kris, I opened STS-2998 , STS-2999 and STS-3000 (yeah, I won the issue number 3000! :-D).
        Hide
        kdvolder Kris De Volder added a comment -

        Thanks!

        Show
        kdvolder Kris De Volder added a comment - Thanks!

          People

          • Assignee:
            kdvolder Kris De Volder
            Reporter:
            mauromol Mauro Molinari
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: