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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:41:05+00:00 2026-05-26T16:41:05+00:00

I have a POM defined in the Ant file, the build works correctly, pulling

  • 0

I have a POM defined in the Ant file, the build works correctly, pulling the correct artifacts from the Repository, however, the artifact:install tasks pushes to ‘super-pom’ instead of the pom I specify

I use the following POM file

<project name="my-proj" default="build" 
         xmlns:artifact="antlib:org.apache.maven.artifact.ant">

  <!-- Define the Maven tasks -->
  <path id="mvn.classpath" 
        path="${env.MAVEN_HOME}/lib/maven-ant-tasks-2.1.1.jar" />
  <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
           uri="antlib:org.apache.maven.artifact.ant"
           classpathref="mvn.classpath" />


  <target name="set-deps">
    <artifact:pom id="jar.pom" packaging="jar"
                  groupId="com.me" artifactId="my-proj" 
                  version="1.0-SNAPSHOT">
      <dependency groupId="commons-logging" 
                  artifactId="commons-logging" 
                  version="1.1.1"/>
    </artifact:pom>

    <artifact:dependencies filesetId="project.jar.files" 
          pomRefId="jar.pom"/>
  </target>

  <target name="compile" depends="set-deps">
    <mkdir dir="${basedir}/output/casses"/>
    <javac srcdir="${basedir}/src" 
           destdir="${basedir}/output/classes" 
           classpathref="project.jar.files" />
  </target>

  <target name="build" depends="compile">
    <jar destfile="output/${project.name}.jar" 
         basedir="${basedir}/output/classes"/>
  </target>

  <target name="install" depends="build">
    <echo message="Installing JAR file - ${project.name}.jar"/>
    <echo message=" groupId - ${jar.pom.groupId}"/>
    <echo message="artifactId - ${jar.pom.artifactId}"/>
    <echo message=" version - ${jar.pom.version}"/>
    <artifact:install file="${basedir}/output/${project.name}.jar" 
          pomRefId="jar.pom"/>
  </target>
</project>

Calling ant build will build the JAR file correctly, so the POM is being set up correctly by the Ant script (at least from a dependency point of view).

However, calling ant install results in the JAR being installed on the local repository as super-pom version 1.0. installing a second time fails as a full version (1.0, no SNAPSHOT) already exists on the repository and only SNAPSHOT versions can be overwritten.

I’ve set the groupId/artifactId/version on the POM. How come they are not being picked up? I’ve tried setting these again on the install task (thinking maybe there were undocumented attributes for the task), but this task does not accept these attributes.

In fact, the correct values will get displayed before the install, so the POM knows it’s groupId/artifactId/version, but still fails the install using these settings.

BTW, if it’s any help, I’m using the 2.1.1 maven-ant-tasks JAR file, but the Maven version I have installed is 3.0.2 (not sure whether the tasks make external calls to the Maven Jars or if the functionality is internal to the ant task Jar).

PS. I’ve tried placing the dependencies in an external POM file and this seems to work, the pom.xml contains nothing but the dependencies and the groupId/artifactId/version (same as the in-memory pom defined above), the artifact:pom changes to:

<artifact:pom id="jar.pom" file="ant-pom.xml"/>

Nothing else changes, but ant install now works correctly. Is this a bug in the maven-ant-tasks or is there something I’m missing?

Where I’m working now use Ant, and I want to avoid giving more files to be managed as part of the build process. If I need to I will, but I’d rather avoid it!

  • 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-26T16:41:06+00:00Added an answer on May 26, 2026 at 4:41 pm

    OK, in lieu of waiting for a fix for this issue, I went with a work-around. I write out the POM in the install, then use the disk-based POM for the install:

    ...
    <target name="install" ...
      ...
      <artifact:writepom pomRefId="jar.pom" file="${basedir}/output/${project.name}-pom.xml" />
      <artifact:pom id="disk-based.pom" file="${basedir}/output/${project.name}-pom.xml" />
    
      <artifact:install file="${basedir}/output/${project.name}.jar" 
          pomRefId="disk-based.pom"/>
    </target>
    ...
    

    Hope this helps.

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

Sidebar

Related Questions

I have a maven pom.xml file with multiple instances of a same goal defined
I have defined the following profile in pom.xml: <profiles> <profile> <id>dev</id> <build> <plugins> <plugin>
Is it possible to build multiple artifacts in a single POM file? It is
I have a pom file which is generating source from WSDL files which is
My pom.xml is running an Ant task to deploy a file using FTP. However,
We have a number of modules defined in our parent pom, which are build
I have a super pom defined in which I specify a "resources" directory for
I have a maven POM file for a web service. For one of the
I have several testng test groups, e.g. group1,group2,group3... These are defined in my pom.xml
Is it possible to have a plugin defined in the parent POM which is

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.