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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:12:23+00:00 2026-06-14T05:12:23+00:00

My application depends on a third-party ear (it deconstructs it, adds/modifies some items therein,

  • 0

My application depends on a third-party ear (it deconstructs it, adds/modifies some items therein, and reconstructs it into a new ear). The third-party ear must be built using a third-party build script.

I am trying to learn the “maven-y” way to set this up. I expect I will need to get the third-party ear installed into my repository.

I want to create a pom.xml for the third-party ear which will build the third-party ear and install/deploy it. I have created a pom.xml which successfully calls out to the third-party build script (via maven-antrun-plugin) and creates the ear in exactly the place that a default maven ear project would.

My problem is that maven’s install plugin fails because it can’t find the archive (it expects whatever plugin does the packaging to have set an attribute on the artifact object, which maven-antrun-plugin doesn’t do).

mvn package works fine and generates the ear.

The exact error message when running mvn install looks like this:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.3.1:install (default-install) on project third_party_ear: The
packaging for this project did not assign a file to the build artifact -> [Help 1]

Is there a better way to go about this?

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.thirdparty</groupId>
    <artifactId>third_party_ear</artifactId>
    <version>9.0</version>
    <packaging>ear</packaging>

    <name>third_party_ear</name>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-ear-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <id>default-ear</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>default-generate-application-xml</id>
                        <phase>none</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <configuration>
                            <target>
                                <subant target="build-ear" antfile="build.xml" buildpath="${project.basedir}"/>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
  • 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-14T05:12:25+00:00Added an answer on June 14, 2026 at 5:12 am

    When you specify <packaging>ear</packaging> you are telling Maven to invoke the full lifecycle specified for that packaging.

    In your case what you want to do is write a wrapper pom.xml that just shells out to your 3rd party build script without invoking the EAR lifecycle and attach the produced artifact to Maven’s reactor…

    Something like this should work

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
    
        <groupId>com.thirdparty</groupId>
        <artifactId>third_party_ear</artifactId>
        <version>9.0</version>
        <packaging>pom</packaging>
    
        <name>third_party_ear</name>
    
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.7</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <configuration>
                                <target>
                                    <subant target="build-ear" antfile="build.xml" buildpath="${project.basedir}"/>
                                    <attachartifact file="${project.build.directory}/${project.build.finalName}.ear" type="ear"/>
                                </target>
                            </configuration>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </project>
    

    There may be some slight glitches because the pom’s packaging differs… but as this is not a classpath relevant artifact they shouldn’t affect you.

    Note the attachartifact ANT task can attach an artifact from anywhere, so you need not have battled ANT to get the file in the “right” place… though it is nicer to follow that convention. You may want to not use the project.build.finalName and hardcode the filename.

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

Sidebar

Related Questions

I have a windows application which lets say Depends on X third-party application which
The app I'm currently developing depends on a third party application (OIFileManager). My question
I've inherited an application which depends on a third-party library, which in turn depends
We have an application that depends on a number of groups of third-party DLLs.
My application depends on another third-party framework and I need to make sure the
Some application we're using depends on TComponent descendants to easily save/load the state of
I have a problem providing some third party librarys (JAR-files) I am using when
I'd like to start external third party application from my Java application. This external
This must be quite a common problem. An application depends on Library A and
In a Java project, I am using a third-party library that loads some native

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.