Maven引入外部依赖包

  1. 在根目录下创建一个lib文件夹,放入jar包。
  2. 点击jar包右键add as library加到项目中。
  3. pom.xml文件中新增jar包对应的
<dependency>
    <groupId>test.groupIdgroupId>
    <artifactId>test-artifactIdartifactId>
    <version>0.0.1version>
    <scope>systemscope>
    <systemPath>${pom.basedir}/lib/test.jarsystemPath>
dependency>
  1. spring-boot-maven-plugin中加入以下配置:
<build>
	<plugins>
	    <plugin>
	        <groupId>org.springframework.bootgroupId>
	        <artifactId>spring-boot-maven-pluginartifactId>
	        <configuration>
	            <includeSystemScope>trueincludeSystemScope>
	        configuration>
	        <executions>
	            <execution>
	                <goals>
	                    <goal>repackagegoal>
	                goals>
	            execution>
	        executions>
	    plugin>
	plugins>
build>

你可能感兴趣的:(Maven,Spring,Boot,maven,java,spring,boot)