The jar springboot externally introduced into the bag package war

The oracle as an example:

The first step: introducing jar package, $ {basedir} is a system parameter

<!-- oracle驱动包 -->
<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>12.1.0.1-atlassian-hosted</version>
    <scope>system</scope>
    <systemPath>${basedir}/lib/ojdbc6-12.1.0.1-atlassian-hosted.jar</systemPath>
</dependency>

Step: Add the following configuration in <plugins> tag

<! - set the maven-war-plugins plugins, or external dependencies can not be reached the war package -> 
< plugin > 
    < groupId > org.apache.maven.plugins </ groupId > 
    < artifactId > Maven-war-plugin </ the artifactId > 
    < Configuration > 
        < WebResources > 
          < Resource > 
               < Directory > lib </ Directory > 
               < The targetPath > the WEB-INF / lib / </ The targetPath > 
               <includes>
                    <include>**/*.jar</include>
                </includes>
          </resource>
        </webResources>
    </configuration>
</plugin>

The third step: Execute Package command mvn clean package

Guess you like

Origin www.cnblogs.com/zhengOK/p/11121526.html