Ivy
  1. Ivy
  2. IVY-1016

Patch to add an ivy:eclipse ant task that generates Eclipse .classpath files

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.3.0-RC1
    • Fix Version/s: None
    • Component/s: Ant
    • Labels:
      None

      Description

      I put together a post-resolve ivy:eclipse task that updates the Eclipse .classpath file according to the result of ivy:resolve. It also will discover any source jars if they are part of the resolve/download, and automatically attach them to the corresponding entries.

      For example, I have this entry in ivy.xml:

      ivy.xml
      <dependency org="commons-collections" name="commons-collections" rev="3.2.1" conf="compile;references">
          <artifact name="commons-collections" type="sources" ext="jar" m:classifier="sources" conf="references" />
      </dependency>
      

      In build.xml, I have:

      build.xml
      <target name="eclipse" description="Updates eclipse classpath.">
          <ivy:configure settingsId="ivy.eclipse" override="true" />
          <ivy:resolve settingsRef="ivy.eclipse" conf="compile, references" />
          <ivy:eclipse settingsRef="ivy.eclipse" conf="compile, references" />
      </target>
      

      And running 'ant eclipse' will update my .classpath with the cache path to the commons-collections jar, with its sources jar attached. The classpath entry will be annotated with an ivygen="true". Next time I run 'ant eclipse', this entry will be recognized and replaced with whatever updated paths.

      This is only the first draft. I know there is IvyDE, but I feel that this could be a good starting point for an alternative that is more Ant-oriented.

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Jing Xue
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development