Gradle
  1. Gradle
  2. GRADLE-154

Create a utility to easily translate Maven dependency lists to Gradle dependency lists - XSLT?

    Details

    • Type: New Feature New Feature
    • Status: Resolved Resolved
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2-rc-1

      Description

      Perhaps this could initially easily be done with an XSLT sheet?
      It would do two things:
      speed up migration from larger Maven projects to Gradle
      More easily allow people to try out Gradle on their existing projects

      1. dExtractor.groovy
        4 kB
        Antony Stubbs
      2. Maven2Gradle.groovy
        15 kB
        Baruch Sadogursky
      3. maven dependency translator.groovy
        1.0 kB
        Antony Stubbs
      4. pom.xml
        12 kB
        Antony Stubbs

        Activity

        Hide
        Chris Beams
        added a comment -

        To Bob's ease-of-use comments, I too would like to see this functionality available directly from `gradle`. Whether it's using some variant of Baruch's approach, XSLT, or the forthcoming embedded Maven support, the point is that the 'how' should be an implementation detail to the user, who simply expresses through a convenient CLI 'what' he or she wants to do. In this case, the 'what' is converting an existing (set of) pom(s) to Gradle script(s).

        I say when in doubt, ask yourself "what would Git do"? Git would certainly integrate this as a subcommand, something like `gradle convert`. Because doing such a conversion could be arbitrarily complex with many options, Git would also likely provide an interactive mode (`gradle convert -i`).

        I think Git is a shining example of command-line power and usability. We should strive to make Gradle's CLI just as inclusive and even more user friendly. Gradle is about more than 'building your code'. The vision is that Gradle is your one stop for project automation needs. If a conversion from Maven is something that Gradle intends to support, then I'd say that's right in the core `gradle` executable's wheelhouse.

        Supporting such features suggests that Gradle's CLI needs to expand a bit. Perhaps 'everything is a task', but as-is, that wouldn't be too friendly to the user. Hans and Adam have already been discussing this, but Gradle needs to somehow accomodate things like per-task options, a structure that feels like Git's subcommands, etc.

        Show
        Chris Beams
        added a comment - To Bob's ease-of-use comments, I too would like to see this functionality available directly from `gradle`. Whether it's using some variant of Baruch's approach, XSLT, or the forthcoming embedded Maven support, the point is that the 'how' should be an implementation detail to the user, who simply expresses through a convenient CLI 'what' he or she wants to do. In this case, the 'what' is converting an existing (set of) pom(s) to Gradle script(s). I say when in doubt, ask yourself "what would Git do"? Git would certainly integrate this as a subcommand, something like `gradle convert`. Because doing such a conversion could be arbitrarily complex with many options, Git would also likely provide an interactive mode (`gradle convert -i`). I think Git is a shining example of command-line power and usability. We should strive to make Gradle's CLI just as inclusive and even more user friendly. Gradle is about more than 'building your code'. The vision is that Gradle is your one stop for project automation needs. If a conversion from Maven is something that Gradle intends to support, then I'd say that's right in the core `gradle` executable's wheelhouse. Supporting such features suggests that Gradle's CLI needs to expand a bit. Perhaps 'everything is a task', but as-is, that wouldn't be too friendly to the user. Hans and Adam have already been discussing this, but Gradle needs to somehow accomodate things like per-task options, a structure that feels like Git's subcommands, etc.
        Hide
        Hans Dockter
        added a comment -

        Eventually we will putt this functionality in the maven plugin. Plus in the future you will be able to call a plugin from the command line without applying it from the build script. That way Gradle will provide a good solution for this.

        Show
        Hans Dockter
        added a comment - Eventually we will putt this functionality in the maven plugin. Plus in the future you will be able to call a plugin from the command line without applying it from the build script. That way Gradle will provide a good solution for this.
        Hide
        Daz DeBoer
        added a comment -

        This feature is included in the new Bootstrap plugin: http://www.gradle.org/docs/current/userguide/bootstrap_plugin.html#N13E69

        Show
        Daz DeBoer
        added a comment - This feature is included in the new Bootstrap plugin: http://www.gradle.org/docs/current/userguide/bootstrap_plugin.html#N13E69
        Hide
        Antony Stubbs
        added a comment -

        Awesome!

        What's the way to go the other way again? To generate a pom? Would be nice to have that snippet of info here too.

        haha, cool, my 4 year old little issue

        Show
        Antony Stubbs
        added a comment - Awesome! What's the way to go the other way again? To generate a pom? Would be nice to have that snippet of info here too. haha, cool, my 4 year old little issue
        Hide
        Baruch Sadogursky
        added a comment -

        Antony, using Maven plugin's install task generates pom file. All you need to do is configure the location. http://www.gradle.org/docs/current/userguide/maven_plugin.html
        You can also tweak the pom at will.

        Thanks for inception what eventually became the Bootstrap plugin

        Show
        Baruch Sadogursky
        added a comment - Antony, using Maven plugin's install task generates pom file. All you need to do is configure the location. http://www.gradle.org/docs/current/userguide/maven_plugin.html You can also tweak the pom at will. Thanks for inception what eventually became the Bootstrap plugin

          People

          • Assignee:
            Unassigned
            Reporter:
            Antony Stubbs
          • Votes:
            9 Vote for this issue
            Watchers:
            15 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: