title: Why does ivy put my locally resolved jar in a sub directory within the libs directory
body: <p>I am not that experienced with ivy and not sure how to solve this problem, which I probably caused myself by not understanding ivy.</p>
  
  <p>so I have this in my ivysettings.xml to use a local filesystem repo</p>
  
  <pre><code>&lt;ivysettings&gt;
     &lt;settings defaultResolver="central" /&gt;
     &lt;resolvers&gt;
        &lt;ibiblio name="central" m2compatible="true"/&gt;
        &lt;filesystem name='local'&gt;
          &lt;artifact pattern='/home/tester/JAVA/tester-libs/'/&gt;
        &lt;/filesystem&gt;
     &lt;/resolvers&gt;
     &lt;modules&gt;
        &lt;module organisation="myorg" resolver="local"/&gt;
     &lt;/modules&gt;
  &lt;/ivysettings&gt;
  </code></pre>
  
  <p>JarL.java exsists in /home/tester/JAVA/tester-libs/</p>
  
  <p>my dependencies are set in ivy.xml as</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ivy-module version="1.0"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:noNamespaceSchemaLocation="http://www.jayasoft.org/misc/ivy/samples/ivy.xsd"
  &gt;
      &lt;info organisation="org.naps" module="naps"/&gt;
      &lt;dependencies&gt;
          &lt;dependency org="commons-configuration" name="commons-configuration" rev="1.10"/&gt;
          &lt;dependency org="myorg" name="Jarl" rev="NA" changing="true"/&gt;
      &lt;/dependencies&gt;
  &lt;/ivy-module&gt;
  </code></pre>
  
  <p>which resolves the dependency but where all the other jars like commons-configuration are placed in lib/ during the build, my jar is placed in lib/JarL sub-directory.</p>
  
  <p>I want JarL to be placed in lib/ like the other dependencies and have no idea what to do. I hacked these scripts together from other answers I found on the net.</p>
  
  <p>Ivy is just too in-depth for me. I not want to take months out of my life to learn yet another tool. I just want easy lazy development where I concentrate on the problem at hand not the dev tools.</p>
  
  <p>UPDATE:</p>
  
  <p>For the moment I have had to add the following 2 lines to the packing step in build.xml to get around this problem but it is a silly fix.</p>
  
  <pre><code>&lt;move file="lib/JarL-NA.jar/JarL.jar" todir="lib"/&gt;
  &lt;delete dir="lib/JarL-NA.jar"/&gt;
  </code></pre>
  
  <p>UPDATE:
  added build.xml as per Mark's request</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;!-- You may freely edit this file. See commented blocks below for --&gt;&lt;!-- some examples of how to customize the build. --&gt;&lt;!-- (If you delete it and reopen the project it will be recreated.) --&gt;&lt;!-- By default, only the Clean and Build commands use this build script. --&gt;&lt;project name="Naps" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant"&gt;
      &lt;description&gt;Builds, tests, and runs the project Naps.&lt;/description&gt;
      &lt;import file="nbproject/build-impl.xml"/&gt;
      &lt;!--
  
      There exist several targets which are by default empty and which can be 
      used for execution of your tasks. These targets are usually executed 
      before and after some main targets. Those of them relevant for JavaFX project are: 
  
        -pre-init:                 called before initialization of project properties
        -post-init:                called after initialization of project properties
        -pre-compile:              called before javac compilation
        -post-compile:             called after javac compilation
        -pre-compile-test:         called before javac compilation of JUnit tests
        -post-compile-test:        called after javac compilation of JUnit tests
        -pre-jfx-jar:              called before FX SDK specific &lt;fx:jar&gt; task
        -post-jfx-jar:             called after FX SDK specific &lt;fx:jar&gt; task
        -pre-jfx-deploy:           called before FX SDK specific &lt;fx:deploy&gt; task
        -post-jfx-deploy:          called after FX SDK specific &lt;fx:deploy&gt; task
        -pre-jfx-native:           called just after -pre-jfx-deploy if &lt;fx:deploy&gt; runs in native packaging mode
        -post-jfx-native:          called just after -post-jfx-deploy if &lt;fx:deploy&gt; runs in native packaging mode
        -post-clean:               called after cleaning build products
  
      (Targets beginning with '-' are not intended to be called on their own.)
  
      Example of inserting a HTML postprocessor after javaFX SDK deployment:
  
          &lt;target name="-post-jfx-deploy"&gt;
              &lt;basename property="jfx.deployment.base" file="${jfx.deployment.jar}" suffix=".jar"/&gt;
              &lt;property name="jfx.deployment.html" location="${jfx.deployment.dir}${file.separator}${jfx.deployment.base}.html"/&gt;
              &lt;custompostprocess&gt;
                  &lt;fileset dir="${jfx.deployment.html}"/&gt;
              &lt;/custompostprocess&gt;
          &lt;/target&gt;
  
      Example of calling an Ant task from JavaFX SDK. Note that access to JavaFX SDK Ant tasks must be
      initialized; to ensure this is done add the dependence on -check-jfx-sdk-version target:
  
          &lt;target name="-post-jfx-jar" depends="-check-jfx-sdk-version"&gt;
              &lt;echo message="Calling jar task from JavaFX SDK"/&gt;
              &lt;fx:jar ...&gt;
                  ...
              &lt;/fx:jar&gt;
          &lt;/target&gt;
  
      For more details about JavaFX SDK Ant tasks go to
      http://docs.oracle.com/javafx/2/deployment/jfxpub-deployment.htm
  
      For list of available properties check the files
      nbproject/build-impl.xml and nbproject/jfx-impl.xml.
  
      --&gt;
      &lt;target name="-check-for-ivy"&gt;
          &lt;available property="have.ivy" resource="fr/jayasoft/ivy/ant/antlib.xml"/&gt;
      &lt;/target&gt;
      &lt;target name="-ivy-define" depends="-check-for-ivy" unless="have.ivy"&gt;
          &lt;taskdef resource="fr/jayasoft/ivy/ant/antlib.xml" uri="antlib:fr.jayasoft.ivy.ant"&gt;
              &lt;classpath&gt;
                  &lt;fileset dir="${ivy.home}"&gt;
                      &lt;include name="ivy*.jar"/&gt;
                      &lt;include name="lib/*.jar"/&gt;
                  &lt;/fileset&gt;
              &lt;/classpath&gt;
          &lt;/taskdef&gt;
      &lt;/target&gt;
      &lt;target name="-ivy-retrieve" depends="-ivy-define" xmlns:ivy="antlib:fr.jayasoft.ivy.ant"&gt;
          &lt;ivy:resolve/&gt; &lt;!-- Tell Ivy to resolve dependencies --&gt;
          &lt;ivy:retrieve/&gt; &lt;!-- Load dependencies to the project --&gt;
          &lt;pathconvert property="ivy.classpath.computed" dirsep="/" pathsep=":"&gt;
              &lt;path&gt;
                  &lt;fileset dir="lib" includes="*.jar"/&gt;
              &lt;/path&gt;
              &lt;map from="${basedir}${file.separator}" to=""/&gt;
          &lt;/pathconvert&gt;
          &lt;propertyfile file="nbproject/project.properties"&gt;
              &lt;entry operation="=" key="ivy.classpath" value="${ivy.classpath.computed}"/&gt;
          &lt;/propertyfile&gt;
      &lt;/target&gt;
      &lt;target name="-pre-compile" depends="-ivy-retrieve"/&gt;
      &lt;target name="-pre-compile-single" depends="-ivy-retrieve"/&gt;
      &lt;target name="-post-clean"&gt;
          &lt;delete dir="lib"/&gt;
      &lt;/target&gt;
  
      &lt;!-- fix ivy task --&gt;
      &lt;target name="-pre-jfx-jar"&gt;
          &lt;move file="lib/JarL-NA.jar/JarL.jar" todir="lib"/&gt;
          &lt;delete dir="lib/JarL-NA.jar"/&gt;
      &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>and this is the nb properties file it loads</p>
  
  <pre><code>#Thu, 02 Jul 2015 05:24:03 +0100
  annotation.processing.enabled=true
  annotation.processing.enabled.in.editor=false
  annotation.processing.processors.list=
  annotation.processing.run.all.processors=true
  annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
  application.splash=
  application.title=Naps
  application.vendor=Tester
  auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml
  build.classes.dir=${build.dir}/classes
  build.classes.excludes=**/*.java,**/*.form
  # This directory is removed when the project is cleaned:
  build.dir=build
  build.generated.dir=${build.dir}/generated
  build.generated.sources.dir=${build.dir}/generated-sources
  # Only compile against the classpath explicitly listed here:
  build.sysclasspath=ignore
  build.test.classes.dir=${build.dir}/test/classes
  build.test.results.dir=${build.dir}/test/results
  compile.on.save=true
  compile.on.save.unsupported.javafx=true
  # Uncomment to specify the preferred debugger connection transport:
  #debug.transport=dt_socket
  debug.classpath=${run.classpath}
  debug.test.classpath=${run.test.classpath}
  # This directory is removed when the project is cleaned:
  dist.dir=dist
  dist.jar=${dist.dir}/Naps.jar
  dist.javadoc.dir=${dist.dir}/javadoc
  endorsed.classpath=
  excludes=
  includes=**
  # Non-JavaFX jar file creation is deactivated in JavaFX 2.0+ projects
  jar.archive.disabled=true
  jar.compress=false
  #
  # Tester - replaced classpath with ivy
  javac.classpath=${ivy.classpath}\:${javafx.classpath.extension}
  # javac.classpath=\
  #    ${javafx.classpath.extension}
  # Space-separated list of extra javac options
  javac.compilerargs=
  javac.deprecation=false
  javac.processorpath=${javac.classpath}
  javac.source=1.8
  javac.target=1.8
  javac.test.classpath=${javac.classpath}\:${build.classes.dir}
  javac.test.processorpath=${javac.test.classpath}
  javadoc.additionalparam=
  javadoc.author=false
  javadoc.encoding=${source.encoding}
  javadoc.noindex=false
  javadoc.nonavbar=false
  javadoc.notree=false
  javadoc.private=false
  javadoc.splitindex=true
  javadoc.use=true
  javadoc.version=false
  javadoc.windowtitle=
  javafx.application.implementation.version=1.0
  javafx.binarycss=false
  javafx.classpath.extension=${java.home}/lib/javaws.jar\:${java.home}/lib/deploy.jar\:${java.home}/lib/plugin.jar
  javafx.deploy.adddesktopshortcut=false
  javafx.deploy.addstartmenushortcut=false
  javafx.deploy.allowoffline=true
  # If true, application update mode is set to 'background', if false, update mode is set to 'eager'
  javafx.deploy.backgroundupdate=false
  javafx.deploy.disable.proxy=false
  javafx.deploy.embedJNLP=true
  javafx.deploy.icon=
  javafx.deploy.icon.native=
  javafx.deploy.includeDT=true
  javafx.deploy.installpermanently=false
  javafx.deploy.permissionselevated=false
  javafx.deploy.splash=
  # Set true to prevent creation of temporary copy of deployment artifacts before each run (disables concurrent runs)
  javafx.disable.concurrent.runs=false
  # Set true to enable multiple concurrent runs of the same WebStart or Run-in-Browser project
  javafx.enable.concurrent.external.runs=false
  # This is a JavaFX project
  javafx.enabled=true
  javafx.fallback.class=com.javafx.main.NoJavaFXFallback
  # Main class for JavaFX
  javafx.main.class=naps.Main
  javafx.preloader.class=
  # This project does not use Preloader
  javafx.preloader.enabled=false
  javafx.preloader.jar.filename=
  javafx.preloader.jar.path=
  javafx.preloader.project.path=
  javafx.preloader.type=none
  # Set true for GlassFish only. Rebases manifest classpaths of JARs in lib dir. Not usable with signed JARs.
  javafx.rebase.libs=false
  javafx.run.height=600
  javafx.run.width=800
  javafx.signing.blob=false
  javafx.signing.enabled=false
  javafx.signing.type=notsigned
  # Pre-JavaFX 2.0 WebStart is deactivated in JavaFX 2.0+ projects
  jnlp.enabled=false
  # Main class for Java launcher
  main.class=com.javafx.main.Main
  # For improved security specify narrower Codebase manifest attribute to prevent RIAs from being repurposed
  manifest.custom.codebase=*
  # Specify Permissions manifest attribute to override default (choices: sandbox, all-permissions)
  manifest.custom.permissions=
  manifest.file=manifest.mf
  meta.inf.dir=${src.dir}/META-INF
  mkdist.disabled=false
  native.bundling.enabled=false
  platform.active=default_platform
  run.classpath=${dist.jar}\:${javac.classpath}\:${build.classes.dir}
  run.test.classpath=${javac.test.classpath}\:${build.test.classes.dir}
  source.encoding=UTF-8
  src.dir=src
  test.src.dir=test
  
  ivy.classpath=lib/commons-beanutils-1.8.3.jar\:lib/commons-codec-1.6.jar\:lib/commons-collections-3.2.1.jar\:lib/commons-configuration-1.10-javadoc.jar\:lib/commons-configuration-1.10-sources.jar\:lib/commons-configuration-1.10.jar\:lib/commons-digester-1.8.1.jar\:lib/commons-jexl-2.1.1.jar\:lib/commons-jxpath-1.3.jar\:lib/commons-lang-2.6.jar\:lib/commons-logging-1.1.1.jar\:lib/commons-vfs2-2.0.jar\:lib/log4j-1.2.8.jar\:lib/maven-scm-api-1.4.jar\:lib/maven-scm-provider-svn-commons-1.4.jar\:lib/maven-scm-provider-svnexe-1.4.jar\:lib/plexus-utils-1.5.6.jar\:lib/regexp-1.3.jar\:lib/servlet-api-2.4.jar\:lib/xml-apis-1.0.b2.jar\:lib/xml-resolver-1.2.jar
  </code></pre>
  
  <p>UPDATE:
  Here is build.xml file changed to use an ivy retrieve pattern as mentioned by Mark Hunter</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;!-- You may freely edit this file. See commented blocks below for --&gt;&lt;!-- some examples of how to customize the build. --&gt;&lt;!-- (If you delete it and reopen the project it will be recreated.) --&gt;&lt;!-- By default, only the Clean and Build commands use this build script. --&gt;&lt;project name="Naps" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant"&gt;
      &lt;description&gt;Builds, tests, and runs the project Naps.&lt;/description&gt;
      &lt;import file="nbproject/build-impl.xml"/&gt;
      &lt;property name="one-jar.dist.dir" value="/home/tester/JAVA/one-jar-ant"/&gt;
      &lt;import file="${one-jar.dist.dir}/one-jar-ant-task.xml" optional="true"/&gt;
  
      &lt;target name="-check-for-ivy"&gt;
          &lt;available property="have.ivy" resource="fr/jayasoft/ivy/ant/antlib.xml"/&gt;
      &lt;/target&gt;
      &lt;target name="-ivy-define" depends="-check-for-ivy" unless="have.ivy"&gt;
          &lt;taskdef resource="fr/jayasoft/ivy/ant/antlib.xml" uri="antlib:fr.jayasoft.ivy.ant"&gt;
              &lt;classpath&gt;
                  &lt;fileset dir="${ivy.home}"&gt;
                      &lt;include name="ivy*.jar"/&gt;
                      &lt;include name="lib/*.jar"/&gt;
                  &lt;/fileset&gt;
              &lt;/classpath&gt;
          &lt;/taskdef&gt;
      &lt;/target&gt;
      &lt;target name="-ivy-retrieve" depends="-ivy-define" xmlns:ivy="antlib:fr.jayasoft.ivy.ant"&gt;
          &lt;ivy:resolve/&gt; &lt;!-- Tell Ivy to resolve dependencies --&gt;
          &lt;ivy:retrieve conf="napsjar" pattern="lib/[artifact].[ext]"/&gt;
          &lt;pathconvert property="ivy.classpath.computed" dirsep="/" pathsep=":"&gt;
              &lt;path&gt;
                  &lt;fileset dir="lib" includes="*.jar"/&gt;
              &lt;/path&gt;
              &lt;map from="${basedir}${file.separator}" to=""/&gt;
          &lt;/pathconvert&gt;
          &lt;propertyfile file="nbproject/project.properties"&gt;
              &lt;entry operation="=" key="ivy.classpath" value="${ivy.classpath.computed}"/&gt;
          &lt;/propertyfile&gt;
      &lt;/target&gt;
      &lt;target name="-pre-compile" depends="-ivy-retrieve"/&gt;
      &lt;target name="-pre-compile-single" depends="-ivy-retrieve"/&gt;
      &lt;target name="-post-clean"&gt;
          &lt;delete dir="lib"/&gt;
      &lt;/target&gt;
  
      &lt;!-- fix ivy task --&gt;
      &lt;target name="-pre-jfx-jar"&gt;
          &lt;move file="lib/JarL-NA.jar/JarL.jar" todir="lib"/&gt;
          &lt;delete dir="lib/JarL-NA.jar"/&gt;
      &lt;/target&gt;
  
      &lt;!-- one-jar task --&gt;
      &lt;target name="-post-jfx-jar"&gt;
          &lt;one-jar destfile="naps-one-jar.jar"&gt;
              &lt;manifest&gt;
                  &lt;attribute name="One-Jar-Main-Class" value="jarl.Main"/&gt;
              &lt;/manifest&gt;
              &lt;main&gt;
                  &lt;fileset dir="/home/tester/WORKSPACE/NetBeans/Naps/build/classes"/&gt;
              &lt;/main&gt;
              &lt;lib&gt;
                  &lt;fileset dir="/home/tester/WORKSPACE/NetBeans/Naps/lib"/&gt;
              &lt;/lib&gt;
          &lt;/one-jar&gt;
      &lt;/target&gt;    
  &lt;/project&gt;
  </code></pre>
  
  <p>here's ivy.xml using configurations, htough there is only so not sure why that should change anything</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ivy-module version="1.0"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:noNamespaceSchemaLocation="http://www.jayasoft.org/misc/ivy/samples/ivy.xsd"
  &gt;
      &lt;info organisation="org.naps" module="naps"/&gt;
      &lt;configurations&gt;
          &lt;conf name="napsjar" description="Jars used by application"/&gt;
      &lt;/configurations&gt;
      &lt;dependencies&gt;
          &lt;dependency org="commons-configuration" name="commons-configuration" rev="1.10" conf="napsjar-&gt;default"/&gt;
          &lt;dependency org="NA"  name="JarL" rev="NA" conf="napsjar-&gt;default"/&gt;
      &lt;/dependencies&gt;
  &lt;/ivy-module&gt;
  </code></pre>
  
  <p>These changes have resulted in lib/JarL-NA.jar/JarL-NA.jar becoming lib/JarL.jar/JarL.jar, which is still in a sub-directory of lib and now prevents my simple rename step form working.</p>
  
  <p>The rest of the dependencies are in lib as expected and as they were before.</p>
  
  <p>Addtionally, these changes have now preventd nb from resolving commons-configuration so the source can no longer import the class.</p>