springBoot項目經常使用maven依賴以及依賴說明

springBoot項目經常使用maven依賴以及依賴說明java

 

1:maven-compiler-plugin 

<build>
   <plugins>
      <!-- 指定maven編譯的jdk版本,若是不指定,maven3默認用jdk 1.5 maven2默認用jdk1.3 -->                                                                           
    <groupId>org.apache.maven.plugins</groupId>                                                                                               
    <artifactId>maven-compiler-plugin</artifactId>                                                                                            
    <version>3.1</version>                                                                                                                    
    <configuration>                                                                                                                           
        <!-- 通常而言,target與source是保持一致的,可是,有時候爲了讓程序能在其餘版本的jdk中運行(對於低版本目標jdk,源代碼中不能使用低版本jdk中不支持的語法),會存在target不一樣於source的狀況 -->                    
        <source>1.8</source> <!-- 源代碼使用的JDK版本 -->                                                                                             
        <target>1.8</target> <!-- 須要生成的目標class文件的編譯版本 -->                                                                                     
        <encoding>UTF-8</encoding><!-- 字符集編碼 -->
        <skipTests>true</skipTests><!-- 跳過測試 -->                                                                             
        <verbose>true</verbose>
        <showWarnings>true</showWarnings>                                                                                                               
        <fork>true</fork><!-- 要使compilerVersion標籤生效,還須要將fork設爲true,用於明確表示編譯版本配置的可用 -->                                                                     
    </configuration>                         
    </plugins>
</build>

 

2:spring-boot-maven-plugin

Spring Boot Maven plugin可以將Spring Boot應用打包爲可執行的jar或war文件,而後以一般的方式運行Spring Boot應用。mysql

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.0.1.RELEASE</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

 

 

 <dependencies>
        <!--操做數據庫-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <!-- Druid 數據庫鏈接池 -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid-spring-boot-starter</artifactId>
            <version>1.1.5</version>
        </dependency>
           <!--mysql鏈接-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mybatis.spring.boot</groupId>
            <artifactId>mybatis-spring-boot-starter</artifactId>
            <version>1.3.1</version>
        </dependency>
        <!-- MyBatis 分頁插件 -->
        <dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper-spring-boot-starter</artifactId>
            <version>1.2.10</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <!--配置文件xml或properties處理器-->
        <dependency>
            <groupId> org.springframework.boot </groupId>
            <artifactId> spring-boot-configuration-processor </artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

 

 

..........git

相關文章
相關標籤/搜索