输出:
阿里云maven镜像仓库: maven下载链接:https://maven.apache.org/ maven中央仓库:https://mvnrepository.com/ |
遇到的问题:
1、 在新建项目目录下mvn compile时,提示如下报错
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https://cmc.centralrepo.rnd.huawei.com/artifactory/product_maven/): transfer failed for https://cmc.centralrepo.rnd.huawei.com/artifactory/product_maven/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1] 黄色部分是maven settings.xml中设置的mirror url 红色部分报错参考链接: http://3ms.huawei.com/km/blogs/details/11283157 使用的证书文件参考链接: http://3ms.huawei.com/km/blogs/details/12395835 IDEA导入maven项目后,提示证书问题可以参考链接: 1、 在maven setting中增加VM 参数: 在maven importing下面的VM options for importer中添加: -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true 2、如果IDEA仍然显示插件导入失败,可以重新点击clean install |
2、 mvn compile出现如下结果
Downloading from central: https://cmc.centralrepo.rnd.huawei.com/artifactory/product_maven/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom [WARNING] The POM for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 is missing, no dependency information available Downloading from central: https://cmc.centralrepo.rnd.huawei.com/artifactory/product_maven/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.657 s [INFO] Finished at: 2022-07-13T14:51:57+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Could not find artifact org.apache.maven.plugins:maven-resources-plugin:jar:2.6 in central (https://cmc.centralrepo.rnd.huawei.com/artifactory/product_maven/) -> [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/PluginResolutionException |
3、mvn clean时报错
ugins:maven-clean-plugin:2.5:clean (default-clean) on project maven-project: Failed to clean project: Failed to delete D:\EgineeringCode\maven-project\target\surefire-reports 定位原因:这个目录被进程占用,无法删除 解决方案参考: idea Failed to clean project Failed to delete target_小北海的北海的博客-CSDN博客 |
4. 怎么使用maven创建多个module,将多个module展示在一个页面中
在java-project项目下创建子项目servlet-01
注意:如果servlet-01需要tomcat插件,则需要在子项目pom文件中定义,插件无法从父pom中继承到子pom