【问题标题】:Maven add external jarMaven添加外部jar
【发布时间】:2021-10-24 12:52:18
【问题描述】:

我想添加以下jar

gson-extras-1.0-SNAPSHOT.jar

jar结构如下

查看清单版本是

清单版本:1.0

pom 如下

<repositories>
        <repository>
            <id>grupoicarep</id>
            <url>file:///C:/stix/stix_ica/stix2/lib/</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>com.google.gson</groupId>
            <artifactId>typeadapters</artifactId>
            <version>0.1</version>
        </dependency>
    

但它显示以下错误:

未能在项目 stix2 上执行目标:无法解析项目 es.grupoica:stix2:jar:0.0.1-SNAPSHOT 的依赖项:无法在 file:// 中找到 com.google.gson:typeadapters:jar:0.1 /C:/stix/stix_ica/stix2/lib/ 已缓存在本地存储库中,直到 grupoicarep 的更新间隔已过或强制更新后才会重新尝试解析 -> [帮助 1] [错误]

我尝试了很多组合,但我只是猜测并没有得到正确的结果

我不知道我做错了什么

提前多谢

安娜

【问题讨论】:

  • 给定的依赖 typeadapters 来自哪里?如果它来自谷歌,你必须使用正确的存储库,显然不是这样。

标签: java maven jar pom.xml external


【解决方案1】:

使用以下依赖项将本地机器中可用的 jar 包含到 maven 中。

<dependency>    
  <groupId>groupid</groupId>    
  <artifactId>artifactid</artifactId>   
  <version>1.0</version>    
  <scope>system</scope> 
  <systemPath>${basedir}\lib\JAR_NAME.jar</systemPath>  
</dependency>

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2018-10-05
  • 2021-01-15
  • 1970-01-01
  • 1970-01-01
  • 2021-11-05
  • 2013-07-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多