<classifier>core</classifier>有什么作用?
答:
1.用法1
告诉maven依赖com\cloud\common-auth\0.0.1-SNAPSHOT目录下依赖哪个jar包,下面例子依赖common-auth-0.0.1-SNAPSHOT-core.jar包
假如这个目录下有以下两个jar包:
common-auth-0.0.1-SNAPSHOT.jar
common-auth-0.0.1-SNAPSHOT-core.jar
<dependency>
<groupId>com.cloud</groupId>
<artifactId>common-auth</artifactId>
<classifier>core</classifier>
</dependency>
2.用法2
使用maven-jar-plugin打包的时候,多打一个包,名字带有core的jar包
<!-- jar包plugin -->
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<!-- 添加core 修饰方便其它兄弟项目依赖此项目 -->
<classifier>core</classifier>
<includes>
<include>**/com/cloud/</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>