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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:35:31+00:00 2026-06-08T00:35:31+00:00

I build a jar file without using Gradle Jar task (I need to be

  • 0

I build a jar file without using Gradle Jar task (I need to be using Ant task for that inside my task). How do I configure uploadArchives to be able to install JAR in specified repository.

I have tried to override default artifact with

uploadArchives {
    repositories {
        mavenDeployer {
            // some Maven configuration
        }
    }
}

artifacts {
    archives file: file('bin/result.jar')
}

but I’m getting an error that there may not be 2 artifacts with the same type and classifier, which means this configuration adds rather that overrides configuration.

  • 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-08T00:35:32+00:00Added an answer on June 8, 2026 at 12:35 am

    You are right, artifacts closure can only add artifacts to the given configuration (see ArtifactHandler API).

    You have two options:

    1) Add an artifact filter as described here (see ch. 45.6.4.1. “Multiple artifacts per project”). If you use this, try declaring your archives configuration like:

    artifacts {
      archives file: file('bin/result.jar'), name: 'result', type: 'jar'
    }
    

    This way, you something like this in your artifact filter:

    addFilter('result') {artifact, file ->
      artifact.name == 'result'
    }
    

    2) Upload it as a separate maven module. If result.jar is the only jar you are uploading this may be a good solution.

    configurations {
      resultArchives
    }
    
    uploadResultArchives {
      repositories {
        mavenDeployer {
          repository(url: "same/url/here")
        }
      }
    }
    
    artifacts{
      resultArchives file: file('bin/result.jar')
    }
    

    Hope this helps.

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

Sidebar

Related Questions

I need to build a jar file that includes (other, external projects') Maven artefacts.
How to build jar using ant without META-INF folder? I have not specified any
I want to include a jar file ( ant-contrib.jar ) in my ant build.xml
Using Ant tasks that create subprojects such as <antcall> and <ant> may cause build
I am using NetBeans to build my executable JAR and haven't messed around with
I'm using the Maven 2 assembly plug-in to build a jar-with-dependencies and make an
So I'm writing a ant build file to run some tests, and I use
Good day! I created jar file (using Netbeans) and i can't start it. This
I'm trying to construct a jar file using the Amazon Mechanical Turk API. The
I want to install a file using the Windows command line. First I want

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.