启动idea项目报错,maven一直出问题!终于解决了!

起因:从git上克隆项目,打开idea下载依赖的时候报错

错误1:[ERROR] Failed to execute goal on project wvp: Could not resolve dependencies for project com.gbcom:wvp:jar:1.1.0: Could not find artifact com.gbcom:hc_license_proxy:jar:2.6 in aliyunmaven (https://maven.aliyun.com/repository/public) -> [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] DependencyResolutionException - Apache Maven - Apache Software Foundation

这个错误的解决办法是:修改maven的setting.xml的阿里云配置,如果你没问题那就换一个阿里云仓库!!!

解决完之后又报错

错误2:[ERROR] Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:3.8:check (validate) on project wvp: You have 4854 PMD violations. For more details see: D:\wvp-server\target\pmd.xml -> [Help 1] 我真的服了,这个错误是说Maven 项目编译过程中检查出 PMD 违规;

解决办法:在项目的 pom.xml 文件中对 maven-pmd-plugin 进行相应的配置,忽略pmd校验;

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>3.8</version>
            <executions>
                <execution>
                    <id>validate</id>
                    <phase>validate</phase>
                    <goals>
                        <goal>check</goal>
                    </goals>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

又开始报第三个错了

错误3:java: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid'意思是什么使用了一个与编译器内部类不兼容的版本,查了一下网上资料;

解决办法:把 lombok依赖升级 为 1.18.30 ,jdk最新版;

如果还是报这个什么不兼容的错,就clean!我就是这样成功了!!太不容易了

一定要记得右击pom.xml点击maven,选择reload project!!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值