groovy

"grape resolve -ivy (... ... ...)+" could generate ivy dependencies

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.6.4
  • Fix Version/s: 1.6.6, 1.7-rc-1
  • Component/s: Grape
  • Labels:
    None
  • Environment:
    groovy 1.6.4
  • Number of attachments :
    1

Description

Please add an option for grape to generate ivy dependencies from the command line, just like -ant or -dos options.

For example, this command :

grape resolve -ivy "org.apache.poi" "poi" "3.5-beta6" "org.apache.poi" "poi-ooxml" "3.5-beta6"

Could generate the following output :

<dependency org="org.apache.poi" name="poi" revision="3.5-beta6"/>
<dependency org="org.apache.poi" name="poi-ooxml" revision="3.5-beta6"/>

Activity

Hide
Roshan Dawrani added a comment -

Attaching a patch for review.

For the command

grape resolve -ivy "org.apache.poi" "poi" "3.5-beta6" "org.apache.poi" "poi-ooxml" "3.5-beta6"

here is how the output looks like:

<dependency org="org.apache.poi" name="poi-ooxml" revision="3.5-beta6">
<dependency org="org.apache.poi" name="poi" revision="3.5-beta6">
<dependency org="org.apache.poi" name="ooxml-schemas" revision="1.0">
<dependency org="dom4j" name="dom4j" revision="1.6.1">
<dependency org="commons-logging" name="commons-logging" revision="1.1">
<dependency org="log4j" name="log4j" revision="1.2.13">
<dependency org="log4j" name="log4j" revision="1.2.12">
<dependency org="logkit" name="logkit" revision="1.0.1">
<dependency org="avalon-framework" name="avalon-framework" revision="4.1.3">
<dependency org="javax.servlet" name="servlet-api" revision="2.3">
<dependency org="org.apache.xmlbeans" name="xmlbeans" revision="2.3.0">
<dependency org="stax" name="stax-api" revision="1.0.1">
<dependency org="xml-apis" name="xml-apis" revision="1.0.b2">
Show
Roshan Dawrani added a comment - Attaching a patch for review. For the command
grape resolve -ivy "org.apache.poi" "poi" "3.5-beta6" "org.apache.poi" "poi-ooxml" "3.5-beta6"
here is how the output looks like:
<dependency org="org.apache.poi" name="poi-ooxml" revision="3.5-beta6">
<dependency org="org.apache.poi" name="poi" revision="3.5-beta6">
<dependency org="org.apache.poi" name="ooxml-schemas" revision="1.0">
<dependency org="dom4j" name="dom4j" revision="1.6.1">
<dependency org="commons-logging" name="commons-logging" revision="1.1">
<dependency org="log4j" name="log4j" revision="1.2.13">
<dependency org="log4j" name="log4j" revision="1.2.12">
<dependency org="logkit" name="logkit" revision="1.0.1">
<dependency org="avalon-framework" name="avalon-framework" revision="4.1.3">
<dependency org="javax.servlet" name="servlet-api" revision="2.3">
<dependency org="org.apache.xmlbeans" name="xmlbeans" revision="2.3.0">
<dependency org="stax" name="stax-api" revision="1.0.1">
<dependency org="xml-apis" name="xml-apis" revision="1.0.b2">
Hide
blackdrag blackdrag added a comment -

Roshan, these are transitive dependencies, or not? Now I don't know what Jean-Yves Leboué prefers, but it might be a good idea to have an option that shows the transitives dependcies and turn it off by default

Show
blackdrag blackdrag added a comment - Roshan, these are transitive dependencies, or not? Now I don't know what Jean-Yves Leboué prefers, but it might be a good idea to have an option that shows the transitives dependcies and turn it off by default
Hide
Roshan Dawrani added a comment -

Yes, this new -ivy option is showing the output with transitive dependencies - but it is inline with current grape resolve options such as -shell, -ant, -dos, and I think -ivy should not become the odd one out having transitive dependencies switched off.

So, here is the output of, say, existing -ant option

grape resolve -ant "org.apache.poi" "poi" "3.5-beta6" "org.apache.poi" "poi-ooxml" "3.5-beta6" -
<pathelement location="...\.groovy\grapes\org.apache.poi\poi-ooxml\jars\poi-ooxml-3.5-beta6.jar">
<pathelement location="...\.groovy\grapes\org.apache.poi\poi\jars\poi-3.5-beta6.jar">
<pathelement location="...\.groovy\grapes\commons-logging\commons-logging\jars\commons-logging-1.1.jar">
<pathelement location="...\.groovy\grapes\logkit\logkit\jars\logkit-1.0.1.jar">
<pathelement location="...\.groovy\grapes\avalon-framework\avalon-framework\jars\avalon-framework-4.1.3.jar">
<pathelement location="...\.groovy\grapes\javax.servlet\servlet-api\jars\servlet-api-2.3.jar">
<pathelement location="...\.groovy\grapes\log4j\log4j\jars\log4j-1.2.13.jar">
<pathelement location="...\.groovy\grapes\org.apache.poi\ooxml-schemas\jars\ooxml-schemas-1.0.jar">
<pathelement location="...\.groovy\grapes\org.apache.xmlbeans\xmlbeans\jars\xmlbeans-2.3.0.jar">
<pathelement location="...\.groovy\grapes\stax\stax-api\jars\stax-api-1.0.1.jar">
<pathelement location="...\.groovy\grapes\dom4j\dom4j\jars\dom4j-1.6.1.jar">
<pathelement location="...\.groovy\grapes\xml-apis\xml-apis\jars\xml-apis-1.0.b2.jar">

So, I think it will be better to have -ivy option's behavior as in the current patch.

We can open another improvement JIRA for a new switch that turns-off/on transitive dependencies in all the tions - ant, dos, ivy, shell and not just in ivy.

Regarding the default behavior of that new transitive-dependency switch, I think it will be better to have it on by default - coming to know about all the dependencies is the value add of it, otherwise it is just having the same input org/module/revision values outputted in different formats.

Show
Roshan Dawrani added a comment - Yes, this new -ivy option is showing the output with transitive dependencies - but it is inline with current grape resolve options such as -shell, -ant, -dos, and I think -ivy should not become the odd one out having transitive dependencies switched off. So, here is the output of, say, existing -ant option
grape resolve -ant "org.apache.poi" "poi" "3.5-beta6" "org.apache.poi" "poi-ooxml" "3.5-beta6" -
<pathelement location="...\.groovy\grapes\org.apache.poi\poi-ooxml\jars\poi-ooxml-3.5-beta6.jar">
<pathelement location="...\.groovy\grapes\org.apache.poi\poi\jars\poi-3.5-beta6.jar">
<pathelement location="...\.groovy\grapes\commons-logging\commons-logging\jars\commons-logging-1.1.jar">
<pathelement location="...\.groovy\grapes\logkit\logkit\jars\logkit-1.0.1.jar">
<pathelement location="...\.groovy\grapes\avalon-framework\avalon-framework\jars\avalon-framework-4.1.3.jar">
<pathelement location="...\.groovy\grapes\javax.servlet\servlet-api\jars\servlet-api-2.3.jar">
<pathelement location="...\.groovy\grapes\log4j\log4j\jars\log4j-1.2.13.jar">
<pathelement location="...\.groovy\grapes\org.apache.poi\ooxml-schemas\jars\ooxml-schemas-1.0.jar">
<pathelement location="...\.groovy\grapes\org.apache.xmlbeans\xmlbeans\jars\xmlbeans-2.3.0.jar">
<pathelement location="...\.groovy\grapes\stax\stax-api\jars\stax-api-1.0.1.jar">
<pathelement location="...\.groovy\grapes\dom4j\dom4j\jars\dom4j-1.6.1.jar">
<pathelement location="...\.groovy\grapes\xml-apis\xml-apis\jars\xml-apis-1.0.b2.jar">
So, I think it will be better to have -ivy option's behavior as in the current patch. We can open another improvement JIRA for a new switch that turns-off/on transitive dependencies in all the tions - ant, dos, ivy, shell and not just in ivy. Regarding the default behavior of that new transitive-dependency switch, I think it will be better to have it on by default - coming to know about all the dependencies is the value add of it, otherwise it is just having the same input org/module/revision values outputted in different formats.
Hide
blackdrag blackdrag added a comment -

ok

Show
blackdrag blackdrag added a comment - ok
Hide
Roshan Dawrani added a comment -

Done

Show
Roshan Dawrani added a comment - Done

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: