idea中使⽤⾃带maven打包package,install,deploy的时候报
在install成功iql-common后,同时iql-web和iql-engine这两个刚才中引⽤到了iql-common包,打包iql-web和iql-engine的时候,出现了
如下错误:
"C:\Program Files\Java\jdk1.8.0_161\bin\java" -Dmaven.multiModuleProjectDirectory=D:\ideatest\IQL\iql-web -Dmaven.home=E:\apache-maven-3.5.3 -Dc [INFO] Scanning
[INFO]
[INFO] ---------------------------< cn.i4:iql-web >----------------------------
[INFO] Building iql-web 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.977 s
[INFO] Finished at: 2018-11-19T14:56:05+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project iql-web: Could not resolve dependencies for project cn.i4:iql-web:jar:1.0-SNAPSHOT: Failed to collect dependencies a [ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] /confluence/display/MAVEN/DependencyResolutionException
Process finished with exit code 1
初步确实是maven中央仓库环境问题引起的:
报错提⽰是⽆法到⽗⼯程的cn.i4:iql:pom:1.0-SNAPSHOT包,去本地repository查询确实没有此jar包,同时报了另外⼀个错
maven打包本地jar包
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project admin: Deployment failed: repository elemen
故在maven的l⽂件中加如下配置:
在l中添加配置:
<servers>
<!-- 发布Releases版的账号,ID要与distributionManagement中的Releases ID⼀致 -->    <server>
<id>nexus-releases</id>
<username>admin</username>
<password>******</password>
</server>
<!-- 发布snapshot版的账号,ID要与distributionManagement中的snapshot ID⼀致 -->    <server>
<id>nexus-snapshot</id>
<username>admin</username>
<password>******</password>
</server>
</servers>
同时在项⽬的⽗⼯程l⾥⾯添加如下:
pom⽂件没有配置distributionManagement:
发布仓库⼀般分为Releases版和snapshot版,所以要配置2个仓库地址
<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>corp nexus-releases</name>
<url>你的nexusIP:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshot</id>
<name>corp nexus-snapshot</name>
<url>你的nexusIP:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
然后直接对⽗⼯程l进⾏打包package,相关⼦⼯程jar都成功打包

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。