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
The maven quickstart archetype does NOT create
src/main/resourcesnorsrc/test/resources. There are several explanations:src/main/resourcesand not, say,src/main/assembly?In other words, just add
src/main/resources/META-INF/persistence.xmlmanually if you use this archetype.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:
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