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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:03:12+00:00 2026-06-16T01:03:12+00:00

I am stumped. I am using ant and maven-ant-tasks to build and deploy snapshot

  • 0

I am stumped. I am using ant and maven-ant-tasks to build and deploy snapshot artifacts (non-maven) to a remote nexus repository. The build process specifies the url of the repository. This is the ant target that is run:

<target name="shared_resources_war_deploy" depends="shared_resources_war">
    <artifact:pom id="sharedResourcesPom" file="${resourcesdir}/shared-resources-pom.xml" />
    <echo message="**************************${nexus.url}*************************" />
    <artifact:deploy file="${resourcesdir}/shared-resources.war">
        <remoteRepository url="${nexus.url}">
            <authentication username="${nexusUserName}" password="${nexusUserPassword}" /> 
        </remoteRepository>
        <pom refid="sharedResourcesPom"/>
    </artifact:deploy>
</target>

And results in:

shared_resources_war_deploy:
     [echo] **************************http://${nexusIP}:8081/nexus/content/repositories/snapshots*************************
[artifact:deploy] Deploying to http://${nexusIP}:8081/nexus/content/groups/public
[artifact:deploy] [INFO] Retrieving previous build number from nexus
[artifact:deploy] Uploading: com/xactsites/shared-resources/13.1.19-SNAPSHOT/shared-resources-13.1.19-20121211.172831-28.war to repository nexus at http://${nexusIP}:8081/nexus/content/groups/public
[artifact:deploy] Transferring 2K from nexus
[artifact:deploy] An error has occurred while processing the Maven artifact tasks.
[artifact:deploy]  Diagnosis:
[artifact:deploy]
[artifact:deploy] Error deploying artifact 'com.xactsites:shared-resources:war': Error deploying artifact: Failed to transfer file: http://${nexusIP}:8081/nexus/content/groups/public/com/xactsites/shared-resources/13.1.19-SNAPSHOT/shared-resources-13.1.19-20121211.172831-28.war. Return code is: 400
[artifact:deploy]

BUILD FAILED
C:\Users\11_1_15\build.xml:561: The following error occurred while executing this line:
C:\Users\11_1_15\build.xml:551: Error deploying artifact 'com.xactsites:shared-resources:war': Error deploying artifact: Failed to transfer file: http://${nexusIP}:8081/nexus/content/groups/public/com/xactsites/shared-resources/13.1.19-SNAPSHOT/shared-resources-13.1.19-20121211.172831-28.war. Return code is: 400

For some reason beyond my understanding, maven is trying to deploy to the public repository (not allowed by nexus) instead of the snapshot repository specified (note the nexus.url variable). No where in the build file is the public URL being specified.

To make things more curious, on one machine the same build script is successfully deploying the same artifact with this result:

shared_resources_war_deploy:
     [echo] **************************http://${nexusIP}:8081/nexus/content/repositories/snapshots*************************
[artifact:deploy] Deploying to http://${nexusIP}:8081/nexus/content/repositories/snapshots
[artifact:deploy] [INFO] Retrieving previous build number from remote
[artifact:deploy] Uploading: com/xactsites/shared-resources/13.1.19-SNAPSHOT/shared-resources-13.1.19-20121211.172031-27.war to repository remote at http://${nexusIP}:8081/nexus/content/repositories/snapshots
[artifact:deploy] Transferring 2K from remote
[artifact:deploy] Uploaded 2K
[artifact:deploy] [INFO] Retrieving previous metadata from remote
[artifact:deploy] [INFO] Uploading repository metadata for: 'snapshot com.xactsites:shared-resources:13.1.19-SNAPSHOT'
[artifact:deploy] [INFO] Uploading project information for shared-resources 13.1.19-20121211.172031-27
[artifact:deploy] [INFO] Retrieving previous metadata from remote
[artifact:deploy] [INFO] Uploading repository metadata for: 'artifact com.xactsites:shared-resources'

BUILD SUCCESSFUL

where the URL specified is actually used. In comparing the two machines, both ant (version 1.8.1) and the maven-ant-tasks (2.1.3) are the same version. The nexus logs suggest that the incoming request is different between the two (where one specifies the snapshot repository and the other the public repository) so I want to pin this error on Maven. However, I haven’t been able to determine any differences that would cause this.

What’s going on?!

UPDATE:

After sniffing the packets we found that the request from maven was being sent to: /nexus/content/groups/public/com/xactsites/shared-resources/13.1.19.2/shared-resources-13.1.19.2.war HTTP/1.1, confirming that maven is changing the URL before sending the request. So, any efforts to solve this can focus on maven (not nexus).

  • 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-06-16T01:03:14+00:00Added an answer on June 16, 2026 at 1:03 am

    After some painful research and a fluke typo by a coworker opened up a new path to explore we found the cause. Essentially, if the M2/M2_HOME environment variables are set as specified here, then the remote repository url is overwritten with that from our settings.xml file and uses the mirror that is set up for nexus (hence using the wrong, read-only URL for deployment).

    This appears to be an issue both within the pom using the <distributionManagement> element as well as using the <remoteRepository> element within the ant file. There is already a bug filed for this.

    Resolutions:

    We narrowed it down that having the <mirrorOf>*</mirrorOf> set where the ‘*’ causes this issue. Replacing the * with specific repositories (such as ‘central’) resolves this issue.

    Just as well, not setting the M2 environment variables fixes this as well, since it can’t get to the settings.xml file to get the URL. Of course, you wouldn’t want to go this approach if you rely on some other things in your settings.xml to be present when running the deploy.

    uggh, that was a painful bug to track down.

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

Sidebar

Related Questions

So, I am kind of stumped. I have been using a generic repository, and
When using ANT to build my Java application I keep getting this error. I
I'm stumped. I'm using jquery and ajax to POST some fields from a form
I'm using Wysihat in a rails project and am stumped by its inability to
I'm trying to create a pdf report using iTextSharp and I'm stumped as to
I am a little stumped with how to do this. I am using jQuery
I've been following through Ryan Bates' railscast on using cancan but am stumped as
I have a small problem, but I'm a bit stumped. I am using the
Im really stumped. Im using the wxHTTP class in wxWidgets to try and download
I'm a bit stumped with this. I would like to create some elements (using

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.