maven相关

1、ojdbc无法获取

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc14</artifactId>
    <version>10.2.0.4.0</version>
</dependency>
    
[ERROR] Failed to execute goal on project xx: Could not resolve dependencies for projectxxx:jar:1.0-SNAPSHOT: Failure to find com.oracle:ojdbc14:jar:10.2.0.4.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR]

因为Oracle使用的授权协议,Maven的中央库不被允许托管其artifacts,你可以去下载相应的软件包到本地,然后将安装目录中的JDBC jar包install到本地的Maven仓库,Maven命令:

mvn install:install-file -Dfile={Path/to/your/ojdbc.jar} -DgroupId=com.oracle 
-DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar    

 其他方法可以查看---》 请点我

2、建立了父子模块的工程,子工程在进行package前面,需要先对父亲工程进行install操作,不然会提示说找不到相应的父亲工程的.pom文件,如后面截图:

 

 3、

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.3.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
这个依赖在aliyun镜像中不存在,在maven的setting中增加了
http://mvnrepository.com/这个仓库地址后问题解决;同时要指定下mirrorOf标签,<mirrorOf>central</mirrorOf>,这个是我对阿里云的mirrorOf设置;

4、maven排查依赖的子包

  1. <project>
  2. <modelVersion>4.0.0</modelVersion>
  3. <groupId>sample.ProjectA</groupId>
  4. <artifactId>Project-A</artifactId>
  5. <version>1.0-SNAPSHOT</version>
  6. <packaging>jar</packaging>
  7. ...
  8. <dependencies>
  9. <dependency>
  10. <groupId>sample.ProjectB</groupId>
  11. <artifactId>Project-B</artifactId>
  12. <version>1.0-SNAPSHOT</version>
  13. <exclusions>
  14. <exclusion>
  15. <groupId>sample.ProjectD</groupId> <!-- Exclude Project-D from Project-B -->
  16. <artifactId>Project-D</artifactId>
  17. </exclusion>
  18. </exclusions>
  19. </dependency>
  20. </dependencies>
  21. </project>

转载于:https://www.cnblogs.com/zhucezmf/p/10761398.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值