Java——maven引用本地jar包的幾種方式


 方式一:build path

右鍵jar包,Build Path--Add to Build Path

方式二:通過systemPath引入

<dependency> <groupId>com.vmware</groupId> <artifactId>sso.client</artifactId> <version>6.5.3</version> <type>jar</type> <scope>system</scope> <systemPath>${basedir}/lib/ssoclient.jar</systemPath> </dependency>

方式三:通過maven-install-plugin打包到本地倉庫里

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-install-plugin</artifactId> <executions> <execution> <id>install-vim25</id> <phase>initialize</phase> <goals> <goal>install-file</goal> </goals> <configuration> <packaging>jar</packaging> <groupId>com.vmware</groupId> <artifactId>vim25</artifactId> <version>6.5.3</version> <file>./lib/vim25.jar</file> </configuration> </execution> </executions> </plugin>

打包之后,可以通過dependency正常引入: 

<dependency>
	<groupId>com.vmware</groupId>
	<artifactId>vim25</artifactId>
	<version>6.5.3</version>
</dependency>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM