SpringBoot引入外部Jar(打包)

版权声明:版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_37598011/article/details/90080150

第一步:Maven导入配置

		<dependency>
			<groupId>ImApi</groupId>
			<artifactId>ImApi</artifactId>
			<version>1.0.0</version>
			<scope>system</scope>
			<systemPath>${project.basedir}\src\main\resources\jar\ImApi.jar</systemPath>
		</dependency>
	<build>
		<plugins>

			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>repackage</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<includeSystemScope>true</includeSystemScope>
				</configuration>
			</plugin>
		</plugins>


	</build>

核心是这块:

第二步:外部jar引入

所以在pom文件中:${project.basedir}\src\main\resources\jar\ImApi.jar

做好以上几步就能打包了:

今天对接外部短信服务用到了第三方接口,最后boot打包是用这个解决方案。有效无报错!!!

猜你喜欢

转载自blog.csdn.net/qq_37598011/article/details/90080150