Ivy
  1. Ivy
  2. IVY-1235

Generate classpath from retrieve results, allow cachepath to take a repo path/pattern

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.0-RC1
    • Fix Version/s: 2.3.0-RC1
    • Component/s: Ant
    • Labels:
      None

      Description

      Currently you can use the cachepath directive to generate a classpath that refers to the ivy cache.

      However, if you are generating a jar file manifest, this is not very useful.

      Instead, you want to generate a classpath for a bunch of jars relative to the jar you are creating.

      One way to make this easy would be to have ivy:retrieve have an option that causes it to also export a path similar to the way cachepath does. This path could then be used in the <jar> command to set the classpath on the jar file.

      Alternatively, cachepath could be changed so that it accepts a retrieve pattern and it applies that pattern to the resolved dependencies instead of using the ivy cache paths.

        Issue Links

          Activity

          Hide
          Nicolas Lalevée added a comment -

          That's better but not sufficient: we need the mapping between the artifact and the file so IvyDE can properly bind a source on the jar for instance.
          I have made the modification in r1069157.

          Note that I didn't make any change in IvyDE so it doesn't require now Ivy 2.3. So people could still install it with earlier Ivy. Once we choose IvyDE to require Ivy 2.3, we will then use this cleaner API.
          Thanks !

          Show
          Nicolas Lalevée added a comment - That's better but not sufficient: we need the mapping between the artifact and the file so IvyDE can properly bind a source on the jar for instance. I have made the modification in r1069157. Note that I didn't make any change in IvyDE so it doesn't require now Ivy 2.3. So people could still install it with earlier Ivy. Once we choose IvyDE to require Ivy 2.3, we will then use this cleaner API. Thanks !
          Hide
          Maarten Coene added a comment -

          The ivy:retrieve Ant task can now create a path or a fileset containing the retrieved artifacts by setting the 'pathId' or 'setId' attributes. This path or fileset can be used later in other Ant tasks, like the javac task.

          Nicolas: the RetrieveEngine now returns a RetrieveReport object. Could you check if the new API is good enough to fulfil your needs?

          Show
          Maarten Coene added a comment - The ivy:retrieve Ant task can now create a path or a fileset containing the retrieved artifacts by setting the 'pathId' or 'setId' attributes. This path or fileset can be used later in other Ant tasks, like the javac task. Nicolas: the RetrieveEngine now returns a RetrieveReport object. Could you check if the new API is good enough to fulfil your needs?
          Hide
          Maarten Coene added a comment -

          Thanks for the links Nicolas.
          I had implemented this some time ago, but I need to clean up the code a bit before I can commit.

          Show
          Maarten Coene added a comment - Thanks for the links Nicolas. I had implemented this some time ago, but I need to clean up the code a bit before I can commit.
          Hide
          Nicolas Lalevée added a comment -

          As you may have seen Maarten, IVYDE-56 tried to implement that feature for Eclipse.
          See the function maybeRetrieve in IvyResolver: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolver.java?revision=1060436&view=markup

          I would be great to have this functionality at the API level. I tried to implement at that time but I was not enough confident because of some possible API break I was making.

          Show
          Nicolas Lalevée added a comment - As you may have seen Maarten, IVYDE-56 tried to implement that feature for Eclipse. See the function maybeRetrieve in IvyResolver: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/resolve/IvyResolver.java?revision=1060436&view=markup I would be great to have this functionality at the API level. I tried to implement at that time but I was not enough confident because of some possible API break I was making.

            People

            • Assignee:
              Maarten Coene
              Reporter:
              Dobes Vandermeer
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development