1

I'm tring ivy to not download javadoc or source of given artifacts. I have tried lots of things, but couldn't achive yet! The solutions which are tried:

  1. I have added <exclude> inside <dependencies> tag.
  2. I have added <exclude> inside each <dependency> tag.
  3. I have added type="jar" as attribute into <ivy:retrieve>

Ivy and related ant tasks are as in below:

ivy.xml

<ivy-module version="2.0">
  <info organisation="com.XXX" module="accountactivity"/>
  <configurations defaultconfmapping="lib->default">
    <conf name="lib" description="application libraries"/>
  </configurations>
  
  <dependencies>
    <dependency org="com.XXX.account"    name="account-core"            rev="0.3-SNAPSHOT" transitive="false"/>
    <dependency org="com.XXX.account"    name="account-dao"             rev="0.3-SNAPSHOT" transitive="false"/>
    <dependency org="com.XXX.account"    name="account-sdf"             rev="0.3-SNAPSHOT" transitive="false"/>

    <dependency org="com.XXX.client"     name="abm-client"              rev="1.3"          transitive="false"/>
    <dependency org="com.XXX.client"     name="accountactivity-client"  rev="2.0"          transitive="false"/>
    <dependency org="com.XXX.client"     name="unifiedmessaging-client" rev="4.0"          transitive="false"/>

    <dependency org="commons-configuration" name="commons-configuration"   rev="1.4"          transitive="false"/>
    <dependency org="commons-net"           name="commons-net"             rev="3.1"          transitive="false"/>
    <dependency org="com.lowagie"           name="itext"                   rev="4.2.1"        transitive="false"/>

    <exclude type="source" ext="*" conf="*" />
    <exclude type="javadoc" ext="*" conf="*" />
    <exclude type="license" ext="*" conf="*" />
  </dependencies>
</ivy-module>

ivysettings.xml

<ivysettings>
  <settings defaultResolver="nexus"/>
  
  <credentials host="localhost"
               realm="Sonatype Nexus Repository Manager"
               username="username" passwd="password"/>
  
  <property name="nexus.XXX" value="url"/>
  <property name="nexus-public" value="http://${nexus.XXX}:8081/nexus/content/groups/public"/>
  
  <resolvers>
    <ibiblio name="nexus" m2compatible="true" root="${nexus-public}"/>
  </resolvers>

</ivysettings>

build.xml

  <target name="ivy-download" unless="offline">
    <mkdir dir="${ivy.dir}"/>
    <get src="${repo_public}/org/apache/ivy/ivy/${ivy.ver}/ivy-${ivy.ver}.jar" dest="${ivy.jar}" usetimestamp="true"/>
  </target>

  <target name="ivy-install" depends="ivy-download">
    <path id="ivy.lib.path">
      <fileset file="${ivy.jar}"/>
    </path>
    <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
    <ivy:settings file="ivysettings.xml" />
  </target>

  <target name="lib.get" depends="ivy.clean">
    <mkdir dir="${lib.dir}"/>
    <ivy:retrieve type="jar" conf="lib" pattern="${lib.dir}/[artifact]-[revision].[ext]"/>
  </target>

Although I have tried so much things, still i get this message! cmd debug

How can I prevent to download javadoc and sources?? Thanks in advance

Community
  • 1
  • 1
Adem İlhan
  • 1,460
  • 3
  • 16
  • 26
  • possible duplicate of [Ivy appears to fetch javadoc jars only](http://stackoverflow.com/questions/4982485/ivy-appears-to-fetch-javadoc-jars-only) – Mark O'Connor Jan 07 '15 at 20:45
  • I think this question is not duplicate of the question you mentioned. The problem there is that sometimes javadocs are downloaded instead of actual jars. my problem is that 2 jars downloaded, but i dont want one of them which is javadoc. – Adem İlhan Jan 08 '15 at 07:57
  • If you following the advice in the answer, you'll discover the javadocs will not be downloaded (It uses ivy configurations). The magic part is the default configuration mapping of "compile->default". It tells ivy that the local "compile" configuration should be mapped to the remote "default", which in Maven is the compile scope. For more detail on how Maven scopes are interpreted by ivy see: http://stackoverflow.com/questions/7104364/how-are-maven-scopes-mapped-to-ivy-configurations-by-ivy/7116577#7116577 – Mark O'Connor Jan 08 '15 at 18:25
  • Please try removing the "transitive=false" directives they're not required if you have configuration mappings defined. (I also think the exclude tags would be ineffective, but open to correction) – Mark O'Connor Jan 08 '15 at 18:28

0 Answers0