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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:23:32+00:00 2026-05-13T06:23:32+00:00

I have jar files that cannot be found on Maven Central repository. I would

  • 0

I have jar files that cannot be found on Maven Central repository. I would like to add the jar so I can just include extra tag in my pom.xml file and other developer can use the jar. What are the steps needed to upload the jar to http webserver webfolder? What file should I uploaded beside custom.jar? What other files need to exist on the webfolder side by side with custom.jar?

  • 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-13T06:23:32+00:00Added an answer on May 13, 2026 at 6:23 am

    If you already have a web server set up pointing on a web folder, a simple way to deploy your custom JAR would to use the deploy:deploy-file Mojo. As documented in the Usage page of the Maven Deploy Plugin:

    The deploy:deploy-file mojo is used
    primarily for deploying artifacts to
    which were not built by Maven. The
    project’s development team may or may
    not provide a POM for the artifact,
    and in some cases you may want to
    deploy the artifact to an internal
    remote repository. The deploy-file
    mojo provides functionality covering
    all of these use cases, and offers a
    wide range of configurability for
    generating a POM on-the-fly.
    Additionally, you can specify what
    layout your repository uses. The full
    usage statement of the deploy-file
    mojo can be described as:

    mvn deploy:deploy-file -Durl=file://C:\m2-repo \
                           -DrepositoryId=some.id \
                           -Dfile=your-artifact-1.0.jar \
                           [-DpomFile=your-pom.xml] \
                           [-DgroupId=org.some.group] \
                           [-DartifactId=your-artifact] \
                           [-Dversion=1.0] \
                           [-Dpackaging=jar] \
                           [-Dclassifier=test] \
                           [-DgeneratePom=true] \
                           [-DgeneratePom.description="My Project Description"] \
                           [-DrepositoryLayout=legacy] \
                           [-DuniqueVersion=false]
    

    Only the 3 first parameters are mandatory (short version). If you wonder what the repositoryId is, the documentation of the Mojo says:

    Server Id to map on the <id> under <server> section of settings.xml In most cases, this parameter will be required for authentication. Default value is: remote-repository.

    In other words, the simplest way to use this would be to copy your custom JAR on the machine hosting the web server and to use the file:// protocol when specifying the URL. There is no additional setup required. If you want to deploy remotely, then scp:// is often the preferred protocol (there are others but this one is pretty easy to setup). Below, an example using scp:

    mvn deploy:deploy-file -DgroupId=my.group -DartifactId=myartifact -Dversion=1.0 \
      -DgeneratePom=true \
      -Dpackaging=jar \
      -Dfile=custom.jar \
      -DrepositoryId=some.id \
      -Durl=scp://REMOTEMACHINE/PATH/TO/WEB_ROOT/maven2_repository
    

    Actually, using a web server to host your own Maven repository is perfectly fine but it can be a bit painful to initialize. One solution to solve this issue is to use a Maven proxy (like Nexus for example) instead of just a Maven repository. But this goes beyond your question.

    For more resources on this, check (the principles are still valid even if the implementation solutions are a bit outdated):

    • Using Maven in a corporate environment
    • Creating the repositories
    • Nexus Book: Repository Management with Nexus
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I take a jar file that I have and add it to
I have a .jar file that i've placed in my D:\Coldfusion8\wwwroot\web-inf\lib\ directory. The file
I have a jar file that has a file named client.ts in (when viewing
I have a javadoc doclet that requires an additional jar file to be on
I have a list of jar files, all containing slightly different versions of the
I need to setup LookAndFeel Files in JDK 1.6. I have two files: napkinlaf-swingset2.jar
I have an application that I'm trying to wrap into a jar for easier
I have a web-application written in java. I would like to run integration tests
Well I have 2 .jar files. The main jar file is the jar file
I have a specific need to unrar files found in different subdirectories during execution

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.