Maven best practices


Maven is an excellent project management tool. At present, the best book on the market is Maven.
Still can’t solve the problem:
1. Maven built-in variable
Maven built in variable description:
${basedir} project root
${ }Build a directory. The default is target
${ }The output directory of the construction process is target / classes by default
${ }Output name, default to${ project.artifactId }-${ project.version }Current version
${ project.packaging }The package type is jar by default
${ }The contents of any node in the current POM file

<project xmlns="" xmlns:xsi=""

An important feature of Maven is that it can write the value of classpath to the MF file of jar. This allows you to run the jar file directly.
You can do this with Maven jar plugin. < addclasspath > true < / addclasspath > means that the dependent package path is written to the MF file. But note that the classpath you write is just the name of the package, so the jar package you run should be in the same directory as the Lib package.

Maven can introduce another project into one project


Yes, artifactid is the artifactid of your other project. Is this much more convenient than using java build path to reference?

And use Maven dependency plugin to export these packages to the specified directory.

Besides, go for the configuration of the desired package.

Another problem: these configurations are not what you want. For example, search Apache CXF.
At this time, go to the official website to download sample and find the POM file configuration.

How to configure multiple source files for Maven: