What are some additional directory conventions for Maven projects?

Maven 2 uses the standard directory for the projects described here:

http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html

I'm wondering: are conventions recommended for projects other than the Java library Java, Java EE, and WebApp? In particular, where to place ant files, run scripts, configuration files, sample applications, etc.

Also, what is the convention for placing files outside the src / directory tree? For example, is document distribution in a doc / document (like sibling src) common?

Is there a page that compiles these conventions? If not, can other readers provide examples from their own projects?

+5
source share
2 answers

I do not think that there is an official layout for desktop applications, but this is the layout that we use for ours.

  • src / main / config - configuration files copied and filtered to $ {project.build.directory} / config.
  • src / main / scripts - sh, bat, README and other text files that are copied and filtered in $ {project.build.directory}.
  • src / main / bin - Binary files that are not filtered and copied to $ {project.build.directory}.
  • src / main / build - any additional scripts, ant files or resources used by the build process, but are not included in the application.
  • src / main / assembly - assembly descriptor for creating the application assembly.
  • ${project.build.directory}/lib maven-dependency.
  • , , config lib, . -.sh,.bat .exe ;.jar,.zip,.txt,.pdf,.xml,.properties,.conf,.ico,.png,.jpg .
  • lib/prefix , maven-jar, runnable jar.
  • , , maven-assembly . -.
  • - src/level. src/site/(, src/site/sphinx) src/doc, .
  • / pom, . maven-dependency, maven-resources, maven-jar maven-assembly ( maven-jar).
+1

, , src/main/java/resources. . src/test/resources.

pom.xml . , . pom.xml

. http://maven.apache.org/pom.html#Resources

+2

All Articles