Packaging and Dependency of War Packages in Maven Projects

How dependencies are referenced between two web projects. Between web projects, references are made through war packages. For example, there are two projects, puzzle-web and puzzle-web-demo , both are web projects, puzzle-web-demo depends on puzzle-web , and the specific configuration is as follows.

 

( 1 ) Related configuration of packaging in pom.xml of puzzle-web project

 

A. The version of the compiled plugin should be 2.4 , otherwise, there may be a jar package with a date in the war package.

B. The archiveClasses item is configured as false , which is used to control: when puzzle-web-demo refers to the project war package, whetherthe files under classes are automatically typed into jar packages for use. Fasle is used here, that is, it is not automatically packaged, because packaging will package the configuration files together, so there will be problems when the project is started.

C. The attachClasses item is configured as true , which controls whether to type a jar package to the private server when packaging. The puzzle-web-demo project is used for debugging and compiling.

 

( 2 ) The situation of puzzle-web being packaged on private server

 

There are two packages on the private server, a war package and a jar package.

 

( 3 ) Related configuration when referenced by puzzle-web-demo project pom.xml

 

The war package and the jar package are referenced respectively when quoting . The jar package is mainly used for compilation, and its scope is provided

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326205699&siteId=291194637