Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6817181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:01:03+00:00 2026-05-26T21:01:03+00:00

In my ant build, I am using maven-ant-tasks to pull dependencies for my project.

  • 0

In my ant build, I am using maven-ant-tasks to pull dependencies for my project. The build is relatively complicated and moves/manipulates different artifacts in different places. To make my life easier, I want to remove the maven version labels from my dependencies within my ant script. The maven-ant documentation says that we can use the versionsId property of the dependencies task to accomplish this but I am not sure how to do it in ant.

The relevant part of my build is

 <artifact:pom id="mypom" file="pom.xml"/>
 <artifact:dependencies pathId="dep.classpath" filesetId="dep.fileset" pomRefId="mypom" useScope="compile" settingsFile="${maven.home}\conf\settings.xml" versionsId="dep.versions"/>

 <copy todir="${lib.dir}" flatten="true" overwrite="true">
    <fileset refid="${dep.fileset}"/>
 </copy>

After this call, the dep.versions variable holds a semi-colon separated list of all the version labels. However, I’m not sure how to remove labels in a nice/clean way.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:01:04+00:00Added an answer on May 26, 2026 at 9:01 pm

    Ok, guys, here’s how I solved this

    Maven has a custom mapper that is distributed with the maven-ant-tasks that will remove the version labels. You can pass in the versionIds variable from the dependencies tag.

    <artifact:pom id="mypom" file="pom.xml"/>
    <artifact:dependencies pathId="dep.classpath" filesetId="dep.fileset" pomRefId="mypom" useScope="compile" settingsFile="${maven.home}\conf\settings.xml" versionsId="dep.versions"/>
    
    <copy todir="${lib.dir}" flatten="true" overwrite="true">
      <fileset refid="${dep.fileset}"/>
      <mapper classname="org.apache.maven.artifact.ant.VersionMapper" from="${dep.versions}" to="flatten" />
    </copy>
    

    If you didn’t install the maven-ant-tasks in ANT_HOME/lib, you will have to define the classpath on the mapper as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I´m busy converting an existing project from an Ant build to one using Maven.
what's the point of using ant, maven, and buildr? won't the using build in
I have a Java project that I build using an Ant script. I am
I'm using ant to build my project, and use the 'svnversion' executable to insert
I'm trying to build my project using ANT. My project uses ActionbarSherlock, and Roboguice-Sherlock.
I am trying to build my android project using ant in command line mode.
I'm trying to execute with Maven some test written using Ant tasks. I generated
I'm working on a Java web project that uses Maven to build its artifacts.
I want to execute a build.xml (Ant buildfile) from using GMaven (Maven Plugin for
I am having a java project with a ant build file, using this ant

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.