maven项目引进本地jar包
1.在项目根路径下新建bin文件夹
2.将所需jar包放入bin文件夹内(abc.jar)
3.在pom.xml中加入如下代码

<dependency>
    <groupId>XXX</groupId>
    <artifactId>YYY</artifactId>
    <version>ZZZ</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/lib/abc.jar</systemPath>
</dependency>
*其中 XXX,YYY,ZZZ根据自己情况填写*
    </build>
        </plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version> 
                <configuration>
                    <webResources>
                    <resource>
                        <directory>${project.basedir}/lib</directory>
                        <targetPath>WEB-INF/lib</targetPath>
                        <filtering>false</filtering>
                        <includes>
                            <include>**/*.jar</include>
                        </includes>
                    </resource>
                </webResources>
                </configuration>
              </plugin>
        </plugins>
    </build>

4.项目右键-Maven-Update Projet


notify_guo
1 声望1 粉丝

下一篇 »
线程的同步