平常開發用到的是oracle的jar包,但在maven中央庫裏沒有;須要手動引包,但這樣不利用項目之後的開發管理;java
mvn install:install-file -DgroupId=com.zaxxer -DartifactId=HikariCP -Dversion=2.4.7 -Dpackaging=jar -Dfile=C:/Users/yangqc/Downloads/HikariCP-2.4.7.jar
web
目錄爲src/main/lib,可根據我的習慣調整spring
<dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc7</artifactId> <version>12.1.0.2</version> <scope>system</scope> <systemPath>${basedir}/src/main/lib/ojdbc7-12.1.0.2.jar</systemPath> </dependency>
這裏的scope和systemPath都不能少apache
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> ---3.1 <artifactId>maven-compiler-plugin</artifactId> </plugin> <plugin> <groupId>org.springframework.boot</groupId> -----spring boot的maven編譯器 <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> <resources> <resource> <directory>src/main/webapp</directory> </resource> <resource> <directory>src/main/resources</directory> </resource> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource> <resource> ----3.2 在resource中添加jar包的目錄和打包目標目錄 <directory>src/main/lib</directory> <targetPath>BOOT-INF/lib/</targetPath> <includes> <include>**/*.jar</include> </includes> </resource> </resources> </build>