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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:31:42+00:00 2026-05-16T08:31:42+00:00

I read this article on the maven project web page that lists the different

  • 0

I read this article on the maven project web page that lists the different directory layouts (like: src/main/resources which is for Application/Library resources).

The problem is that when I run the following command (found here):

mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

the src/main/resources/META-INF directory isn’t created. It’s important for me because I’d like to reach the “persistence.xml” that is found in that directory.

Should I add an option in the mvn command? How can I automatically generate the “src/main/resources” that contains the “META-INF/persistence.xml” file?

Thank you,
Regards

  • 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-16T08:31:43+00:00Added an answer on May 16, 2026 at 8:31 am

    The problem is that when I run the following command (…) the src/main/resources/META-INF directory isn’t created. It’s important for me because I’d like to reach the “persistence.xml” that is found in that directory.

    The maven quickstart archetype does NOT create src/main/resources nor src/test/resources. There are several explanations:

    • As stated by its name, this archetype allows to quickstart a project, it’s up to you to shape it.
    • Why should this archetype create src/main/resources and not, say, src/main/assembly?
    • Creating empty directories was actually not possible during a long time (see ARCHETYPE-57).

    In other words, just add src/main/resources/META-INF/persistence.xml manually if you use this archetype.

    Should I add an option in the mvn command? How can I automatically generate the “src/main/resources” that contains the “META-INF/persistence.xml” file?

    You can’t with this archetype – and I don’t really understand why this is a such big issue.

    There is a JPA archetype though:

    mvn archetype:create \
      -DgroupId=com.mycompany.project \
      -DartifactId=my-project-domain \
      -DpackageName=com.company.project.domain \
      -DarchetypeGroupId=com.rfc.maven.archetypes \
      -DarchetypeArtifactId=jpa-maven-archetype  \
      -DarchetypeVersion=1.0.0  \
      -DremoteRepositories=http://maven.rodcoffin.com/repo
    

    That creates the following bootstrap JPA project:

    $ tree my-project-domain/
    my-project-domain/
    ├── pom.xml
    └── src
        ├── main
        │   ├── java
        │   │   └── com
        │   │       └── company
        │   │           └── project
        │   │               └── domain
        │   │                   └── User.java
        │   └── resources
        │       └── META-INF
        │           └── persistence.xml
        └── test
            ├── java
            │   └── com
            │       └── company
            │           └── project
            │               └── domain
            │                   ├── DbUnitDataLoader.java
            │                   └── UserTest.java
            └── resources
                └── user.db.xml
    
    16 directories, 6 files
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read in this article that a company has created a software capable of
I read This article and i found it interesting. To sum it up for
I did some timing tests and also read some articles like this one (last
I read this PHP RegEx page , but either I'm missing something, misreading something,
I read this answer and its comments and I'm curious: Are there any reasons
I read this post last night, and I noticed it was from 2006. I
I have read this post about how to test private methods. I usually do
Update: Please read this question in the context of design principles, elegance, expression of
I just read this post about why new-line warnings exist, but to be honest
Today I read this blog entry by Roger Alsing about how to paint a

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.