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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:08:17+00:00 2026-05-19T02:08:17+00:00

We have a number of third party dependencies that aren’t hosted anywhere. For each

  • 0

We have a number of third party dependencies that aren’t hosted anywhere. For each of these we have a jar file that we’d like to be able to install and/or deploy to our repository. Some of the jar files have their own dependencies and we also need to declare these.

We’ve made pom.xml files for each jar file that declare the groupId, artifactId, dependencies, etc. These pom.xml files all have a common parent pom that declares some of the common info (e.g. <repositories> and <distributionManagement>).

I’d like to be able to install or deploy these dependencies with something as simple as mvn install and mvn deploy (or maybe mvn install:install-file and mvn deploy:deploy-file) and have all the necessary properties for these commands (artifactId, repositoryId, etc.) be read from the pom.xml files.

To get this to work, at least for deploying, I tried putting the following in my parent pom:

<build>
  <plugins>
    <plugin>
      <artifactId>maven-deploy-plugin</artifactId>
      <version>2.4</version>
      <configuration>
        <file>${jarfile}</file>
        <pomFile>pom.xml</pomFile>
        <repositoryId>our-id</repositoryId>
        <url>our-url</url>
      </configuration>
    </plugin>
  </plugins>
</build>

and then having each of the child poms define the jarfile property. That allows me to run mvn deploy:deploy-file to deploy all the child pom artifacts. Presumably I could do something similar to get mvn install:install-file to work.

But with this approach, I’m unable to release the parent pom (which I must do since the child poms depend on it), and if I try to mvn release:perform on the parent pom, I get errors like:

Cannot override read-only parameter: pomFile

I feel like I’m probably going about this the wrong way. All I really want to do is:

  • Put the common code for all the third party jars in one shared parent pom
  • Write an additional minimal pom for each third party jar
  • Be able to run something like mvn install or mvn deploy without having to specify all those complicated command line properties

How can I best accomplish that?

Edit: Made it clearer above that ideally I’d like to be able to run something as simple as mvn install or mvn deploy and not have to specify properties on the command line.

  • 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-19T02:08:18+00:00Added an answer on May 19, 2026 at 2:08 am

    Ok, I found a solution that allows me to run just mvn install or mvn deploy and have the jar file installed to the local or remote repository. Inspired by a post to the maven-users list and using the build-helper plugin, in the parent pom, I have:

    <pluginManagement>
        <plugins>
            <!-- Attach the jar file to the artifact -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${artifactId}-${version}.jar</file>
                                    <type>jar</type>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </pluginManagement>
    

    And then in the child poms, I have:

    <packaging>pom</packaging>
    <groupId>...</groupId>
    <artifactId>...</artifactId>
    <version>...</version>
    ...
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
    

    Some of the pieces of this that initially tripped me up:

    • The attach-artifact execution should be under <pluginManagement> so it doesn’t get executed if you mvn install or mvn deploy the parent pom.
    • The children need to specify the build-helper-maven-plugin under the build plugins so that code from the parent <pluginManagement> gets run.
    • The children have to be declared as having <packaging>pom</packaging> because you can’t add a jar to an artifact if it has the same name as the artifact.

    The only downside I see to this approach is that the artifact gets deployed as type pom instead of type jar. But I haven’t seen any real consequences of that.

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

Sidebar

Related Questions

I have some third party plugins that are not available publicly. I would like
I have heard that Twitter limits the number of API calls a third party
We have an application that depends on a number of groups of third-party DLLs.
I have a rather large project which contains a number of third-party dependencies which
I have a java web app that makes back-end use of a third-party web
We have a Windows Forms application that uses a (third party) ActiveX control, and
I have an Industrial HMI written by a third party in C++ that communicates
I have a third party framework that I'm using to write out an excel
I have a third-party library which consists mainly of a large number of static
I have a third-party app that creates HTML-based reports that I need to display.

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.