- 创建folder文件夹:项目右键->New->Folder;
- 把Jar拖入文件夹;
- 在pom.xml 写引入;
- 打war时,在pom.xml 指定含Jar文件夹;
1.创建folder文件夹:如lib文件,需要引入的jar都放入该文件;
2.在pom.xml 写引入;
3.打war时,在pom.xml 指定含Jar文件夹
项目右键,使用Maven 打包;
pom.xml代码示例
<dependency>
<groupId>com.ovjd</groupId>
<artifactId>encrypt</artifactId>
<version>0.0.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/encrypt.jar</systemPath>
</dependency>
pom.xml代码示例
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<webResource>
<directory>${project.basedir}/lib</directory>
<targetPath>WEB-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</webResource>
</webResources>
</configuration>
</plugin>