maven 打包Could not resolve dependencies for project和无效的目标发行版: 1.8
1.maven 打包Could not resolve dependencies for project
最近项目上使用的是idea ide的多模块话,需要模块之间的依赖,比如说系统管理模块依赖授权模块进行认证和授权,而认证授权模块需要依赖系统管理模块进行,然后,我就开始相互依赖,然后出现这样的问题:
“Could not resolve dependencies for project”,让我百思不得其解,最后网络搜了搜,最后给的解决方案是:
我也碰到这个问题,需要把parent工程,也就是package是pom的那个工程先install一下
然后我就找parent下面的pom,找到标签里是pom的那个包,然后install了一下,就好了。原因未知,但是的确救了很多碰到相似问题的人
简单一句话:对着父项目先 clean install 然后子项目clean package发布 ok
2.maven 打包无效的目标发行版: 1.8
保证所有打包的项目 使用的jdk为1.8的版本
—————————————————————————————————————————————
报错如下图
[ERROR] Failed to execute goal on project source-data: Could not resolve dependencies for project source-data:source-data:jar:1.0-SNAPSHOT: Failure to find com.hikvision.bigdata:app-framework-support-aksk-sdk:jar:1.2.1-SNAPSHOT in http://maven.XXXXX/repository/maven-public/ was cached in the local repository, resolution will not be reattempted until the update interval of citydo has elapsed or updates are forced -> [Help 1][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] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
解决方案是现在目录下打包
mvn install:install-file -DgroupId=com.hikvision.bigdata -DartifactId=app-framework-support-aksk-sdk -Dversion=1.2.1-SNAPSHOT -Dpackaging=jar -Dfile=/var/lib/jenkins/workspace/xyt_source_data/doc/lib/app-framework-support-aksk-sdk.jar
然后再去mvn install 生成target jar包
mvn clean install package