<!--   引入外部jar包  -->    

   <dependency>
            <groupId>com</groupId>
            <artifactId>paradox</artifactId>
            <version>1.4.1</version>
            <scope>system</scope>

<!--  外部jar包存放的路径  -->
            <systemPath>${basedir}/src/main/resources/static/lib/paradoxdriver-1.4.1.jar</systemPath>
        </dependency>

 

 

<!-- 打包war时把外部引入jar打进lib文件夹下 -->
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-war-plugin</artifactId>
               <configuration>
                  <failOnMissingWebXml>false</failOnMissingWebXml>
                  <webResources>
                     <resource>

<!--  此处为外部jar包在本地的路径   -->
                        <directory>${basedir}/src/main/resources/static/lib</directory>
                        <targetPath>WEB-INF/lib/</targetPath>
                        <includes>
                           <include>**/*.jar</include>
                        </includes>
                     </resource>
                  </webResources>
               </configuration>
            </plugin>

更多推荐