title: ant task retrieve maven profile dependency
body: <p>i have a java project with a automatically generated ant files. so i'm forced to use ant to build the project. I needed to add some new libraries and i used the below maven pom file. i then use an ant task to retrieve the pom dependencies and copy them into a lib folder. however the following ant task misses the profile dependencies in the pom. 
  what i want to do is an ant task so that based on current os it will include the corresponding xurlrunner jar for the os. this is done by maven in the pom but how can i do it with ant ?</p>
  
  <p>---ant target task----</p>
  
  <pre><code>&lt;typedef resource="org/apache/maven/artifact/ant/antlib.xml"
               uri="urn:maven-artifact-ant"
               classpathref="maven-ant-tasks.classpath"/&gt;
  
      &lt;target name="retrieve-dependencies"&gt;
          &lt;artifact:dependencies filesetId="dependency.fileset"
                                 sourcesFilesetId="profiles.dependency.fileset"
                                 versionsId="dependency.versions"&gt;
              &lt;pom file="${basedir}/nbproject/pom.xml"/&gt;
          &lt;/artifact:dependencies&gt;
  
          &lt;delete dir="${lib.dir}/browser"/&gt;
          &lt;copy todir="${lib.dir}/browser"&gt;
              &lt;fileset refid="dependency.fileset"/&gt;
              &lt;mapper classpathref="maven-ant-tasks.classpath" classname="org.apache.maven.artifact.ant.VersionMapper"
                      from="${dependency.versions}" to="flatten"/&gt;
          &lt;/copy&gt;
  
      &lt;/target&gt;
  </code></pre>
  
  <p>---pom.xml-------</p>
  
  <pre><code>    &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;org.drOffice.browser&lt;/groupId&gt;
    &lt;artifactId&gt;embedded-browser&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
     &lt;build&gt;
                  &lt;plugins&gt;
                          &lt;plugin&gt;
                                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                                  &lt;configuration&gt;
                                          &lt;compilerVersion&gt;1.6&lt;/compilerVersion&gt;
                                          &lt;encoding&gt;UTF-8&lt;/encoding&gt;
                                          &lt;source&gt;1.6&lt;/source&gt;
                                          &lt;target&gt;1.6&lt;/target&gt;
                                          &lt;showDeprecation&gt;true&lt;/showDeprecation&gt;
                                  &lt;/configuration&gt;
                          &lt;/plugin&gt;
                          &lt;plugin&gt;
                  &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;descriptorRefs&gt;
                          &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                      &lt;/descriptorRefs&gt;
                  &lt;/configuration&gt;
  
                  &lt;/plugins&gt;
          &lt;/build&gt;
          &lt;repositories&gt;
                  &lt;repository&gt;
                          &lt;id&gt;atomation-repository&lt;/id&gt;
                          &lt;name&gt;atomation maven repository&lt;/name&gt;
                          &lt;url&gt;http://atomation-repository.googlecode.com/svn/trunk&lt;/url&gt;
                          &lt;releases&gt;
                                  &lt;enabled&gt;true&lt;/enabled&gt;
                                  &lt;updatePolicy&gt;always&lt;/updatePolicy&gt;
                                  &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
                          &lt;/releases&gt;
                          &lt;snapshots&gt;
                                  &lt;enabled&gt;true&lt;/enabled&gt;
                                  &lt;updatePolicy&gt;always&lt;/updatePolicy&gt;
                                  &lt;checksumPolicy&gt;warn&lt;/checksumPolicy&gt;
                          &lt;/snapshots&gt;
                          &lt;layout&gt;default&lt;/layout&gt;
                  &lt;/repository&gt;
          &lt;/repositories&gt;
          &lt;dependencies&gt;
                  &lt;dependency&gt;
                          &lt;groupId&gt;ru.atomation.jbrowser&lt;/groupId&gt;
                          &lt;artifactId&gt;jbrowser&lt;/artifactId&gt;
                          &lt;version&gt;1.9&lt;/version&gt;
                          &lt;scope&gt;compile&lt;/scope&gt;
                  &lt;/dependency&gt;
          &lt;/dependencies&gt;
  
          &lt;profiles&gt;
  
              &lt;profile&gt;
                          &lt;id&gt;generic&lt;/id&gt;
                          &lt;activation&gt;
                                  &lt;activeByDefault&gt;&lt;/activeByDefault&gt;
                          &lt;/activation&gt;
                  &lt;/profile&gt;
                  &lt;profile&gt;
                          &lt;id&gt;linux&lt;/id&gt;
                          &lt;dependencies&gt;
                                  &lt;dependency&gt;
                                          &lt;groupId&gt;ru.atomation.native&lt;/groupId&gt;
                                          &lt;artifactId&gt;xulrunner-linux&lt;/artifactId&gt;
                                          &lt;version&gt;1.9&lt;/version&gt;
                                  &lt;/dependency&gt;
                          &lt;/dependencies&gt;
                  &lt;/profile&gt;
                  &lt;profile&gt;
                          &lt;id&gt;solaris&lt;/id&gt;
                          &lt;dependencies&gt;
                                  &lt;dependency&gt;
                                          &lt;groupId&gt;ru.atomation.native&lt;/groupId&gt;
                                          &lt;artifactId&gt;xulrunner-solaris&lt;/artifactId&gt;
                                          &lt;version&gt;1.9&lt;/version&gt;
                                  &lt;/dependency&gt;
                          &lt;/dependencies&gt;
                  &lt;/profile&gt;
                  &lt;profile&gt;
                          &lt;id&gt;macosx&lt;/id&gt;
                          &lt;dependencies&gt;
                                  &lt;dependency&gt;
                                          &lt;groupId&gt;ru.atomation.native&lt;/groupId&gt;
                                          &lt;artifactId&gt;xulrunner-macosx&lt;/artifactId&gt;
                                          &lt;version&gt;1.9&lt;/version&gt;
                                  &lt;/dependency&gt;
                          &lt;/dependencies&gt;
                  &lt;/profile&gt;
                  &lt;profile&gt;
                          &lt;id&gt;windows&lt;/id&gt;
                          &lt;dependencies&gt;
                                  &lt;dependency&gt;
                                          &lt;groupId&gt;ru.atomation.native&lt;/groupId&gt;
                                          &lt;artifactId&gt;xulrunner-windows&lt;/artifactId&gt;
                                          &lt;version&gt;1.9&lt;/version&gt;
                                  &lt;/dependency&gt;
                          &lt;/dependencies&gt;
                  &lt;/profile&gt;
          &lt;/profiles&gt;
  &lt;/project&gt;
  </code></pre>