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

  • Home
  • SEARCH
  • 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 453111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:08:22+00:00 2026-05-12T22:08:22+00:00

When building my EJB project with maven, maven expects the ejb-jar.xml to be in

  • 0

When building my EJB project with maven, maven expects the ejb-jar.xml to be in META-INF/. However; I need to be able to put it in directoryA/META-INF.

maven-ejb-plugin doesn’t seem to provide a parameter for specifying where ejb-jar.xml is.

Can you point me in the right direction?

  • 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-12T22:08:22+00:00Added an answer on May 12, 2026 at 10:08 pm

    Indeed, the maven-ejb-plugin doesn’t provide any parameter to change the location of the deployment descriptor which is expected to be available at META-INF/ejb-jar.xml (the location is hard coded in the EjbMojo) or the build will fail at packaging time when building EJB 2.X (which makes sense).

    So, one way to achieve your goal would be to use the maven-antrun-plugin before the packaging phase to copy the content of directoryA (assuming directoryA was in a resources directory like src/main/resources and has been copied to target/classes) to the expected location (i.e. the root of target/classes) and do some clean up, something like this:

    <plugin>
      <artifactId>maven-antrun-plugin</artifactId>
      <executions>
        <execution>
          <phase>prepare-package</phase>
          <configuration>
            <tasks>
              <copy todir="${project.build.outputDirectory}">
                <fileset dir="${project.build.outputDirectory}/directoryA"/> 
              </copy>
              <delete dir="${project.build.outputDirectory}/directoryA"/>
            </tasks>
          </configuration>
          <goals>
            <goal>run</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
    

    I don’t find this very clean but it works.

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

Sidebar

Related Questions

We are building our EAR & EJB projects with maven. It will build all
Building the same project (without any changes) produces binary different exe-files: some small regions
I am building a tool for out-of-container EJB testing. I have managed to run
Building on How Do You Express Binary Literals in Python , I was thinking
Building a client-side swing application what should be notified on a bus (application-wide message
Building on what has been written in SO question Best Singleton Implementation In Java
When building a VS 2008 solution with 19 projects I sometimes get: The GenerateResource
When building projects in C++, I've found debugging linking errors to be tricky, especially
When building some of my PHP apps, a lot of the functionality could be
Im building a web application which is a process management app. Several different employee

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.