[英]Adding external jar in a maven project
我有时会使用基于文件系统的 repos 来处理这种事情。
<repositories>
<repository>
<id>local-files</id>
<name>local-files</name>
<url>file://c:\test\filerepo</url>
</repository>
</repositories>
然后您可以将文件安装到文件仓库中...
mvn install:install-file -Dfile=onebusaway-gtfs-1.3.3 -DgroupId=org.onebusaway.gtfs -DartifactId=onebusaway-gtfs-1.3.3 -Dversion=1.0 -Dpackaging=jar -DlocalRepositoryPath=c:\test\filerepo
只需将上述<repoisitory>
条目包含在您想要访问文件 repo 的任何 pom 中。 例如:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>some-artifact</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<name>some-artifact</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>local-files</id>
<name>local-files</name>
<url>file://c:\test\filerepo</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.onebusaway.gtfs</groupId>
<artifactId>org-onebusaway-gtfs-1.3.3</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</project>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.