Ivy
  1. Ivy
  2. IVY-1324

[originalname] not expanded for source and javadoc types during publish in ivy:install

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.3.0-RC1
    • Component/s: Core
    • Labels:
      None
    • Environment:

      Ivy 2.2.0
      Ant 1.8.1
      Windows 7 x64

      Description

      When using ivy:install to create a local repository, [originalname] for the source and javadoc types is not expanded.

      The artifacts are correctly named in the cache, but when publishing to my local repository, original name is not expanded correctly.

      Related Jiras may be IVY-631 and IVY-1096 which fixed the expansion of [originalname] on retrieval

      I've created a simplified test which demonstrates the problem.

      ivy-settings.xml
      ----------------
      <ivysettings>
      <settings defaultResolver="maven.repo" />
      <resolvers>
      <filesystem name="incubator">
      <ivy pattern="$

      {repository.dir}/[organisation]/[module]/[revision]/ivy.xml" />
      <artifact pattern="${repository.dir}

      /[organisation]/[module]/[revision]/[type]/[originalname].[ext]" />
      </filesystem>
      <ibiblio name="maven.repo" m2compatible="true" />
      </resolvers>
      </ivysettings>

      ivy-settings.properties
      -----------------------
      ivy.cache.dir=C:\\Temp\\ivytest
      cache
      repository.dir=C:\\Temp\\ivytest
      incubator

      build.xml
      ---------
      <?xml version="1.0"?>
      <project name="ivy-repository" default="ivy.init" xmlns:ivy="antlib:org.apache.ivy.ant">
      <target name="ivy.init">
      <property file="$

      {basedir}/ivy-settings.properties" />
      <ivy:configure file="${basedir}

      /ivy-settings.xml" />
      </target>

      <target name="clean.incubator" depends="ivy.init"
      description=" ==> deletes the contents of the incubator directory">
      <delete dir="$

      {repository.dir}

      " />
      </target>

      <target name="install.commons.collections" depends="ivy.init,clean.incubator">
      <ivy:install
      organisation="commons-collections"
      module="commons-collections"
      revision="3.1"
      type="*"
      transitive="true"
      overwrite="false"
      from="maven.repo"
      to="incubator" />
      </target>

      </project>

      Output produced
      ---------------

      16:21:36.29
      c:\Temp\ivytest>ant
      Buildfile: c:\Temp\ivytest\build.xml

      ivy.init:
      [ivy:configure] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ ::
      [ivy:configure] :: loading settings :: file = c:\Temp\ivytest\ivy-settings.xml

      clean.incubator:
      [delete] Deleting directory C:\Temp\ivytest\incubator

      install.commons.collections:
      [ivy:install] :: installing commons-collections#commons-collections;3.1 ::
      [ivy:install] :: resolving dependencies ::
      [ivy:install] found commons-collections#commons-collections;3.1 in maven.repo
      [ivy:install] :: downloading artifacts to cache ::
      [ivy:install] :: installing in incubator ::
      [ivy:install] published commons-collections to C:\Temp\ivytest\incubator/commons-collections/commons-collections/3.1.part/javadoc/[originalname].jar
      [ivy:install] published commons-collections to C:\Temp\ivytest\incubator/commons-collections/commons-collections/3.1.part/jar/commons-collections-3.1.jar
      [ivy:install] published commons-collections to C:\Temp\ivytest\incubator/commons-collections/commons-collections/3.1.part/source/[originalname].jar
      [ivy:install] published ivy to C:\Temp\ivytest\incubator/commons-collections/commons-collections/3.1.part/ivy.xml
      [ivy:install] publish commited: moved C:\Temp\ivytest\incubator\commons-collections\commons-collections\3.1.part
      [ivy:install] to C:\Temp\ivytest\incubator\commons-collections\commons-collections\3.1
      [ivy:install] :: install resolution report ::
      [ivy:install] :: resolution report :: resolve 0ms :: artifacts dl 0ms
      ---------------------------------------------------------------------

        modules artifacts
      conf number search dwnlded evicted number dwnlded

      ---------------------------------------------------------------------

      default 1 0 0 0 3 0

      ---------------------------------------------------------------------

      BUILD SUCCESSFUL
      Total time: 0 seconds
      16:21:40.66
      c:\Temp\ivytest>

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        58d 6h 11m 1 Maarten Coene 14/Feb/12 22:46
        Hide
        David Featherstone added a comment -

        Hi Maarten,

        Apologies for the long delay in getting back to this. I can confirm that your fix has solved my problem.

        Thanks for your help.

        Regards
        Dave

        Show
        David Featherstone added a comment - Hi Maarten, Apologies for the long delay in getting back to this. I can confirm that your fix has solved my problem. Thanks for your help. Regards Dave
        Maarten Coene made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Maarten Coene [ maartenc ]
        Fix Version/s trunk [ 12313426 ]
        Resolution Fixed [ 1 ]
        Hide
        Maarten Coene added a comment -

        I think I was able to fix the issue in SVN trunk.
        Could you confirm that it indeed solves your problem?

        thanks,
        Maarten

        Show
        Maarten Coene added a comment - I think I was able to fix the issue in SVN trunk. Could you confirm that it indeed solves your problem? thanks, Maarten
        Hide
        David Featherstone added a comment -

        The ant script downloads the commons-collections files from the maven repository into the cache and then publishes to the incubator directory. Two files end up in the cache in the commons-collections\commons-collections directory, ivy-3.1.xml and ivy-3.1xml.original. I've posted ivy-3.1.xml - let me know if you need the original too.

        ivy-3.1.xml
        -----------

        <?xml version="1.0" encoding="UTF-8"?>
        <ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
        <info organisation="commons-collections"
        module="commons-collections"
        revision="3.1"
        status="release"
        publication="20051108223131"
        >
        <description homepage="">
        Types that extend and augment the Java Collections Framework.
        </description>
        <m:maven.plugins>null_maven-surefire-plugin_null</m:maven.plugins>
        </info>
        <configurations>
        <conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/>
        <conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/>
        <conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths."/>
        <conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/>
        <conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath." extends="compile"/>
        <conf name="test" visibility="private" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases." extends="runtime"/>
        <conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository."/>
        <conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/>
        <conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/>
        <conf name="optional" visibility="public" description="contains all optional dependencies"/>
        </configurations>
        <publications>
        <artifact name="commons-collections" type="jar" ext="jar" conf="master"/>
        <artifact name="commons-collections" type="source" ext="jar" conf="sources" m:classifier="sources"/>
        <artifact name="commons-collections" type="javadoc" ext="jar" conf="javadoc" m:classifier="javadoc"/>
        </publications>
        <dependencies>
        <dependency org="junit" name="junit" rev="3.8.1" force="true" conf="test->runtime,master"/>
        </dependencies>
        </ivy-module>

        Show
        David Featherstone added a comment - The ant script downloads the commons-collections files from the maven repository into the cache and then publishes to the incubator directory. Two files end up in the cache in the commons-collections\commons-collections directory, ivy-3.1.xml and ivy-3.1xml.original. I've posted ivy-3.1.xml - let me know if you need the original too. ivy-3.1.xml ----------- <?xml version="1.0" encoding="UTF-8"?> <ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven"> <info organisation="commons-collections" module="commons-collections" revision="3.1" status="release" publication="20051108223131" > <description homepage=""> Types that extend and augment the Java Collections Framework. </description> <m:maven.plugins>null_ maven-surefire-plugin _null</m:maven.plugins> </info> <configurations> <conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/> <conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/> <conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths."/> <conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/> <conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath." extends="compile"/> <conf name="test" visibility="private" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases." extends="runtime"/> <conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository."/> <conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/> <conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/> <conf name="optional" visibility="public" description="contains all optional dependencies"/> </configurations> <publications> <artifact name="commons-collections" type="jar" ext="jar" conf="master"/> <artifact name="commons-collections" type="source" ext="jar" conf="sources" m:classifier="sources"/> <artifact name="commons-collections" type="javadoc" ext="jar" conf="javadoc" m:classifier="javadoc"/> </publications> <dependencies> <dependency org="junit" name="junit" rev="3.8.1" force="true" conf="test->runtime ,master "/> </dependencies> </ivy-module>
        Hide
        Maarten Coene added a comment -

        Could you also post your commons-collections ivy.xml file?

        Show
        Maarten Coene added a comment - Could you also post your commons-collections ivy.xml file?
        David Featherstone created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development