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 382075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:08:50+00:00 2026-05-12T15:08:50+00:00

I have maven project and ant task for it. In ant task i want

  • 0

I have maven project and ant task for it.
In ant task i want to get version property from pom.xml.
How to get it?

In pom.xml: <version>2.03.010</version>

  • 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-12T15:08:50+00:00Added an answer on May 12, 2026 at 3:08 pm

    The Maven Ant tasks provide some goals for POM processing

    To access the version from a POM, you can use the following:

    <artifact:pom id="mypom" file="pom.xml" />
    
    <echo>The version is ${mypom.version}</echo>
    

    Update: To use the tasks. You will need to install them. Install instructions

    You can either:

    1. Place the JAR in your Ant lib directory, include it in the CLASSPATH environment variable
    2. Pass it in to Ant using the -lib command line parameter
    3. Use a typedef declaration. This allows you to store the Ant Tasks’ library anywhere you like and put it’s location in the build file.

    With option 2. you modify your project as follows to make ant aware of the maven-ant-tasks schema:

    <project ... xmlns:artifact="antlib:org.apache.maven.artifact.ant">
      ...
    </project>
    

    With option 3. You specify the typedef as follows (assuming the maven-ant-tasks jar is in the lib directory of your project):

    <project ... xmlns:artifact="antlib:org.apache.maven.artifact.ant">
      ...
      <path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.0.10.jar" />
      <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
           uri="antlib:org.apache.maven.artifact.ant"
           classpathref="maven-ant-tasks.classpath" />
      ...
    </project>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following in my pom: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ant-plugin</artifactId> <version>2.3</version> <configuration> <target> <echo
I am switching a project from Ant to Maven. I have my unit tests
I am converting a project to use Ant/maven-ant-tasks. I have a local repository in
I am considering converting an Ant/Ivy project to Ant/Maven-Ant-Tasks. I do not want to
I have just translated an ant project into maven however since maven does not
I am currently migrating our build process from Eclipse/Ant to Maven/M2Eclipse/Artifactory. I have a
I have maven project that consists of several modules. I want to add an
I have a Maven Project Built in Netbeans 6.9... I want to export .html
I have a maven project with the following POM snippet: <modelVersion>4.0.0</modelVersion> <artifactId>Foo-Deploy</artifactId> <name>Foo-Deploy</name> <packaging>pom</packaging>
I have a maven project with the following packages (for illustration only): Root: src/main/java

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.