Spring Tool Suite
  1. Spring Tool Suite
  2. STS-2405

Detect dependencies to maven projects located in workspace and create project dependencies instead of repository ones

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 2.8.1.RELEASE
    • Fix Version/s: 3.1.0.M1
    • Component/s: GRADLE
    • Labels:
      None

      Description

      Assume the following situation:

      • Project A (Maven, m2eclipse)
      • Project B (Gradle)

      The Gradle Dependencies library in Project B refers to Project A via it's build artifact (the local Maven repo). So if I change something in Project A, I need to run mvn clean install and Update Dependencies on Project B after that which is pretty tedious if you're working on the projects in parallel.

      So it would be cool if STS Gradle support detected a project with the same id (in Maven case the artifact id) inside the current workspace to create a project dependency rather than a JAR one. m2eclipse provides a checkbox inside the project properties to "Resolve dependencies from Workspace projects" which is enabled by default to enable this behavior amongst m2eclipse.

        Activity

        Hide
        Kris De Volder (c) added a comment -

        Thanks Oliver, that's a good example. But I am having some problems importing the spring-gemfire project. I think I can still experiment a little despite these problems. (I can see the spring-data-commons dependency which is really what matters here

        I've raised a couple of Jira tickets re the build problems. Someone may want to figure out if the gradle build files and/or the readme instructions need updating.

        Show
        Kris De Volder (c) added a comment - Thanks Oliver, that's a good example. But I am having some problems importing the spring-gemfire project. I think I can still experiment a little despite these problems. (I can see the spring-data-commons dependency which is really what matters here I've raised a couple of Jira tickets re the build problems. Someone may want to figure out if the gradle build files and/or the readme instructions need updating. https://jira.springsource.org/browse/SGF-119 https://jira.springsource.org/browse/SGF-118
        Hide
        Kris De Volder (c) added a comment -

        A fix for this case (i.e. convert a jar entry under 'Gradle Dependencies' to a maven project dependency is now on the nighly update site.

        http://dist.springsource.com/snapshot/TOOLS/gradle/nightly/

        It would be nice if someone (Oliver?) could take it for a spin and see if it does what you wanted.

        Some things to be aware of:

        1) you must have 'Dependency Management' enabled for the Gradle project for this to work.
        2) you must have m2e installed for this to work.
        3) Gradle must be able to resolve the dependency outside the workspace so you must at least publish the jar from your maven project once (but once you have a project dependency, it should be ok not to republish for every change).

        The reason for (3) is http://issues.gradle.org/browse/GRADLE-2436

        I'm not closing this issue just yet. Still looking into creating some kind of regression tests for this feature, but because of (3) this is a bit harder to setup

        4) This feature will be turned on by default, but it can be disabled from the Project's Gradle properties page. This project property is always stored in the root project of a multi-project hierarchy so it enables/disables it for all projects in the hierarchy.

        Show
        Kris De Volder (c) added a comment - A fix for this case (i.e. convert a jar entry under 'Gradle Dependencies' to a maven project dependency is now on the nighly update site. http://dist.springsource.com/snapshot/TOOLS/gradle/nightly/ It would be nice if someone (Oliver?) could take it for a spin and see if it does what you wanted. Some things to be aware of: 1) you must have 'Dependency Management' enabled for the Gradle project for this to work. 2) you must have m2e installed for this to work. 3) Gradle must be able to resolve the dependency outside the workspace so you must at least publish the jar from your maven project once (but once you have a project dependency, it should be ok not to republish for every change). The reason for (3) is http://issues.gradle.org/browse/GRADLE-2436 I'm not closing this issue just yet. Still looking into creating some kind of regression tests for this feature, but because of (3) this is a bit harder to setup 4) This feature will be turned on by default, but it can be disabled from the Project's Gradle properties page. This project property is always stored in the root project of a multi-project hierarchy so it enables/disables it for all projects in the hierarchy.
        Hide
        Oliver Gierke added a comment -

        Very cool, I'll have a look early next week and report back.

        Show
        Oliver Gierke added a comment - Very cool, I'll have a look early next week and report back.
        Hide
        Kris De Volder (c) added a comment -

        Oliver, great! Thanks.

        In the mean time I will close this issue now as I think my work is finished for now. (I've just pushed a regression test).

        However, if you think more work is needed we can reopen, or raise new issues for additional requirements (e.g. maybe related to some of the limitations listed above).

        Kris

        Show
        Kris De Volder (c) added a comment - Oliver, great! Thanks. In the mean time I will close this issue now as I think my work is finished for now. (I've just pushed a regression test). However, if you think more work is needed we can reopen, or raise new issues for additional requirements (e.g. maybe related to some of the limitations listed above). Kris
        Hide
        Lance added a comment -

        FYI, the blocking issue GRADLE-2750 has been fixed in gradle (trunk) and will be available in the next release (gradle-1.12)

        Show
        Lance added a comment - FYI, the blocking issue GRADLE-2750 has been fixed in gradle (trunk) and will be available in the next release (gradle-1.12)

          People

          • Assignee:
            Kris De Volder (c)
            Reporter:
            Oliver Gierke
          • Votes:
            4 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              First Response Date: