The jar file includes Java ordinary classes, resource files and normal files. In maven, all files under the src/main/java and src/main/resources resource folders are packaged. When packaging, the MATA-INF folder will be automatically generated to store maven's pom information and MANIFEST.MF file. For example:
The war file contains all web applications, that is, all Java classes, configuration information, and static resources such as jsp and js. However, it should be noted that when war refers to war, all the resources applied to war will be copied to the same file in the current war, and the files with the duplicate name will be replaced. For example:
War package dependencies:
<dependency> <groupId>com.my.module</groupId> <artifactId>module1</artifactId> <version>0.0.1-SNAPSHOT</version> <type>war</type> //From this view what package to use</dependency>
The position to be packaged, this is my direct right-click on the project -> run as->maven clean After finishing maven install
introduction:
Everyone must have used full-text search tools in daily life, and the most commonly used Baidu and Google are typical of them. If you can do one, wouldn’t you be full of style if you think about it? Apache provides us with such a framework.
The following is a small demo that added Lucene to actual development.
This project is based on the SSM built using IDEA.
Write Lucene Tools
I won't mention the specific code in this tool class separately. I have commented on each key point, so I will discuss it if it is not clear.
This brief discussion on the difference between maven's jar package and war package and the packaging method are all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.