假设存在多个项目的话 并且多个项目中所依赖的jar包都是相同的 那么从川传统的角度来看 硬盘中就会存在多个相同的jar包
同样的条件下 如果是Maven项目的话 那么他就会将jar包抽取为单独的文件 由多个项目去引用依赖 这样的好处在于减小体积 并且我们在进行项目共享的时候 共享的是除开jar包的项目 到时候会根据依赖关系自动下载所依赖的jar包
Maven主要用于自动化创建和管理Java项目
<properties>
<maven.compiler.source>8maven.compiler.source>
<maven.compiler.target>8maven.compiler.target>
<maven.compiler.compilerVersion>8maven.compiler.compilerVersion>
properties>

mvn archetype:generate的指令以后会出现项目类型选择的界面 我们通常会选择7 这其实是在创建一个普通的Java项目 那么如果我们想要创建一个web项目的话 其实选择的就是选项10mvn archetype:generate -DgroupId=com.axihh -DartifactId=01_test -Dversion=1.0-RELEASE -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp

UTF-8 8 14 8 java -jar jar包路径指令运行runnable jar)

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-jar-pluginartifactId>
<version>3.0.2version>
<configuration>
<archive>
<manifest>
<addClasspath>trueaddClasspath>
<classpathPrefix>libclasspathPrefix>
<mainClass>com.axihh.MainmainClass>
manifest>
archive>
<finalName>test1finalName>
configuration>
plugin>
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-dependency-pluginartifactId>
<version>3.1.2version>
<executions>
<execution>
<goals>
<goal>copy-dependenciesgoal>
goals>
<configuration>
<outputDirectory>${project.build.directory}/liboutputDirectory>
configuration>
execution>
executions>
plugin>
plugins>
build>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-assembly-pluginartifactId>
<version>3.3.0version>
<configuration>
<archive>
<manifest>
<mainClass>com.axihh.MainmainClass>
manifest>
archive>
<descriptorRefs>
<descriptorRef>jar-with-dependenciesdescriptorRef>
descriptorRefs>
<finalName>test1finalName>
<appendAssemblyId>falseappendAssemblyId>
configuration>
<executions>
<execution>
<phase>packagephase>
<goals>
<goal>singlegoal>
goals>
execution>
executions>
plugin>
plugins>
build>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-shade-pluginartifactId>
<version>3.2.3version>
<executions>
<execution>
<goals>
<goal>shadegoal>
goals>
<configuration>
<shadeArtifactAttached>trueshadeArtifactAttached>
<transformers>
<transform implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.axihh.MainmainClass>
transform>
transformers>
<finalName>test1finalName>
<appendAssemblyId>falseappendAssemblyId>
configuration>
execution>
executions>
plugin>
plugins>
build>
<build>
<plugins>
<plugin>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-maven-pluginartifactId>
<version>2.3.0.RELEASEversion>
<executions>
<execution>
<goals>
<goal>repackagegoal>
goals>
<configuration>
<mainClass>com.axihh.MainmainClass>
<finalName>javahahafinalName>
configuration>
execution>
executions>
plugin>
plugins>
build>


mvn install:install-file -Dfile=jar的路径 -DgroupId=组织 -DartifactId=库名 -Dversion=版本 -Dpackaging=jar