英文:
Explanation of new Spring project file structure
问题
我是新手对于 Spring,并且在使用他们的REST 教程,我注意到有一堆文件被创建了,供我开始使用。然而,在他们的教程中我没有看到任何关于这些文件具体作用的解释:
- spring-rest.iml
- mvnw.cmd
- mvnw
- 空的 application.properties 文件
这些文件的作用是什么?在我的 Spring 开发过程中会涉及到对它们的操作吗?
英文:
I am new to Spring and using their REST tutorial, I noticed that a bunch of files were created for me to start with. However I don't see any explanation in their tutorials as to what these files do, specifically:
- spring-rest.iml
- mvnw.cmd
- mvnw
- empty application.properties file
What do these files do? Will I be touching them in the course of my Spring development?
答案1
得分: 2
*.iml
文件是 IntellJ 自己的项目结构文件。有关详细信息,请阅读这里:.iml 文件与 pom.xml 文件之间的关系。mvnw.cmd
和mvnw
是 maven-wrapper 的一部分。这样你就不必在操作系统上安装 Maven 版本。
- mvnw:它是一个可执行的 Unix shell 脚本,用来代替完全安装的 Maven。
- mvnw.cmd:它是上述脚本的批处理版本。
- mvn:这个隐藏的文件夹包含了 Maven Wrapper Java 库及其属性文件。
- properties 文件存在于这里,以便轻松地配置应用程序以适应不同的环境。此外,你还可以在其中设置许多 Spring 配置。因此,你会经常用到它!
英文:
*.iml
files are IntellJs own project structure files. Have a read here for details: Relationship between .iml file and pom.xml file
mvnw.cmd
&mvnw
are part of the maven-wrapper. It's there that you don't have to install versions of maven on your OS.
> * mvnw: it's an executable Unix shell script used in place of a fully installed Maven
> * mvnw.cmd: it's the Batch version of the above script
> * mvn: the hidden folder that holds the Maven Wrapper Java library and its properties file
-
properties files are there to configure your application per environment easily. Also, you can set up a lot of spring configuration there. You will touch it therefore!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论