Packaging and dependency of War packages in Maven projects, mavenwar
Dependency references between two web projects. Web projects are referenced through war packages. For example, there are two projects, puzzle-web and puzzle-web-demo, both of which are web projects. puzzle-web-demo depends on puzzle-web. The specific configuration is as follows.
(1) configuration of packaging in pom. xml of puzzle-web project
A. Compile the plug-in version 2.4. Otherwise, A jar package with A date will appear in the war package.
B. Set archiveClasses to false. This configuration is used to control whether to automatically compress the files under classes into jar packages when puzzle-web-demo references the war package of the project. Fasle is used here, that is, it is not automatically packaged because the configuration file will be packaged together, so there will be problems when the project starts.
C. Set the attachClasses item to true to control whether to package a jar package to a private server. The puzzle-web-demo project is used for debugging and compilation.
(2) puzzle-web packaging on private servers
The private server has two packages, one war package and one jar package.
(3) configuration of reference to pom. xml in puzzle-web-demo project
The war package and jar package are referenced respectively. The jar package is mainly used for compilation, and its scope is provided.