Usage of useOrigin has changed with Ivy 2, now it's the cache which is
responsible for telling if it's configured in useOrigin mode or not, and not
the resolve operation. To preserve backward compatibility, we have thus
deprecated "useOrigin" in resolve.

Though the command line version of Ivy should still accept the now
depcreated useOrigin argument, and take it into account. The lines
responsible to handle this are:
            if (line.hasOption("useOrigin")) {
                ivy.getSettings().useDeprecatedUseOrigin();
            }

This changes the default value of useOrigin which should be taken into
account in the cache implementation. But we may have a bug due to the recent
change...

To track this down, could you please provide the version of Ivy you use, and
your debug log (running with -debug) on a simple case?

Xavier

On Thu, Mar 27, 2008 at 12:42 AM, <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I'm running Ivy through the command line and my current requirement with
> Ivy is not to download and cache artifacts. I tried setting useOrigin on
> the command line but it seems like it may not be accounted for. Please
> note my inline comments below:
>
>                ResolveOptions resolveOptions = new
> ResolveOptions().setConfs(confs)
>                .setValidate(validate);
>
> // This call to resolve does not account for any use of useOrigin it
> seems, thus it attempts to download dependencies to the cache
>            ResolveReport report = ivy.resolve(ivyfile.toURL(),
> resolveOptions);
>            if (report.hasError()) {
>                System.exit(1);
>            }
>            ModuleDescriptor md = report.getModuleDescriptor();
>
>            if (confs.length == 1 && "*".equals(confs[0])) {
>                confs = md.getConfigurationsNames();
>            }
>            if (line.hasOption("retrieve")) {
>                String retrievePattern =
> settings.substitute(line.getOptionValue("retrieve"));
>                if (retrievePattern.indexOf("[") == -1) {
>                    retrievePattern = retrievePattern +
> "/lib/[conf]/[artifact].[ext]";
>                }
>
> // Here the option is checked by this is not reached, and is for a
> different purpose anyway
>                ivy.retrieve(md.getModuleRevisionId(), retrievePattern,
> new RetrieveOptions()
>                        .setConfs(confs).setSync(line.hasOption("sync"))
>                        .setUseOrigin(line.hasOption("useOrigin")));
>
>
> Am I missing anything here?
>
> thanks
>
> paul
>
>


-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/

Reply via email to