What is the advantage of the 'src/main/java'' convention?

前端 未结 5 1197
无人及你
无人及你 2020-12-04 11:51

I\'ve noticed that a lot of projects have the following structure:

  • Project-A
    • bin
    • lib
    • src
      • main
        • java
          • Ro
5条回答
  •  攒了一身酷
    2020-12-04 12:44

    Yes, this is a maven convention, but even if you're not using maven, there are benefits to using it:

    1. people new to the project will have an easier time coming up to speed, since it's a "standard"
    2. this convention is flexible and has a place for non-Java code and other things you don't have at this point. This is one reason it's popular and you may find it evolves better than a scheme you come up with on your own
    3. if you want to move to maven at some point it will be easy

    Although I wouldn't argue you should switch just to switch, when starting a new project there's really no reason to not use it-- unless you disagree philosophically with how it breaks the code up.

提交回复
热议问题