A complete idea spring boot project and pit---1.lib

When the jar package required by the project cannot be directly downloaded through manven in the pom, we need to find the corresponding jar package on the Internet to attract people. In this case, it is recommended to create a lib folder in the root directory for unified storage.

Next add in pom

!--Local Dependency-->
 <dependency>
             <groupId> ZXC </groupId
 > #Fill in at will             <artifactId> ss </artifactId> #Fill in at will        
            <version>1.0</version> 
          <scope>system</scope>
 <systemPath>${project.basedir}/lib/poi-3.14.jar</systemPath>
   </dependency>
dakeng

If you want to package it into a jar package in the future, the above reference cannot package the external jar package into the project. You need to add the underlined part in the following figure to the <build> node in the pom file. There is a big hole in it. Details See picture.

<build>
     <plugins>
         <plugin>
             <groupId> org.springframework.boot </groupId>
             <artifactId> spring-boot-maven-plugin </artifactId>
             <configuration>
                 <fork> true </fork>
 <!-- spring-boot:run Chinese garbled solution -->
 <jvmArguments> -Dfile.encoding =UTF-8 </jvmArguments>
             </configuration>
         </plugin>
     </plugins>
 <!--Super pit, only in the upcoming When using jar package, you can put a lot of external packages into the project, but! Be sure to log out after packaging, otherwise the error of Failed to auto-configure a DataSource will be reported when running the project!!-->
 <resources>
         <
resource>
            <directory>                                
        ${project.basedir}/lib</directory>
            <targetPath>BOOT-INF/lib/</targetPath>
            <includes>
                <include>**/*.jar</include>
            </includes>
        </resource>        <resource>
            <directory>src/main/resources</directory>
            <targetPath>BOOT-INF/classes/</targetPath>
        </resource>

    </resources>
</build>

Also pay for the download and address of the poijar package. This package is used to output the list collection as an excel sheet.

http://maven.outofmemory.cn/org.apache.poi/poi/3.14/

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325692456&siteId=291194637