ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Namespace rules applying to dependencies
Date Fri, 03 Apr 2009 13:35:20 GMT
Hello.

I'm struggling to create a local "filesystem" repository with "ivy:install".
Here is the relevant part of my "ivysettings" file:

[...]

  <namespaces>

    <namespace name="apache-rule_org-is-module">
      <rule>
	<fromsystem>
          <src org="org.apache"
	       module=".+"/>

          <dest org="$m0"
		module="$m0"/>
        </fromsystem>
	
	<tosystem>
	  <src org=".+"
	       module=".+"/>

	  <dest org="org.apache"
		module="$m0"/>
	</tosystem>
      </rule>
    </namespace>

  </namespaces>

  <resolvers>

    <filesystem name="local-rep">
      <ivy pattern="${repo.dir}/[organisation]/[module]/ivys/ivy-[revision].xml"/>
      <artifact pattern="${repo.dir}/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
    </filesystem>

    <chain name="apache"
	   returnFirst="true">
      <ibiblio name="apache-rule_org-is-module"
	       m2compatible="true"
	       root="http://repo2.maven.org/maven2"
	       namespace="apache-rule_org-is-module"/>
      <ibiblio name="apache-no-rule"
	       m2compatible="true"
	       root="http://repo2.maven.org/maven2"/>
    </chain>

  </resolvers>

[...]

The rule is quite similar to the one in the "buid a repository" tutorial.
I used it as

    <ivy:install organisation="org.apache"
                 module="log4j"
                 revision="1.2.15"
                 from="apache"
                 to="local-rep"
                 overwrite="true"/>

It's fine for creating the repository structure but it seems to wrongly
alter the dependency list written to the automatically created ivy file,
as shown in this excerpt:

        <dependencies>
                <dependency org="org.apache" name="mail" rev="1.4" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
                <dependency org="org.apache" name="jms" rev="1.1" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
                <dependency org="org.apache" name="jmxtools" rev="1.2.1" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
                <dependency org="org.apache" name="jmxri" rev="1.2.1" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
                <dependency org="org.apache" name="oro" rev="2.0.8" force="true" conf="test->runtime(*),master(*)"/>
                <dependency org="org.apache" name="junit" rev="3.8.1" force="true" conf="test->runtime(*),master(*)"/>
        </dependencies>

Indeed, the "org" attribute in the first <dependency> above should in fact
be "javax.mail", but the original value has been replaced.
As a consequence, "ivy" can never resolve these non-exsistent dependencies.

Conversely, if I remove the rule, the dependencies are correct but local
repository structure becomes
  log4j/log4j
whereas I want it to be
  org.apache/log4j

What am I doing wrong?

Best,
Gilles

Mime
View raw message