我有一个maven java项目,它构建正确,但在pom.xml中添加以下依赖项后:
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-api</artifactId>
<version>6.4.0.Final</version>
</dependency>
我收到以下错误:
无法在项目myproject上执行目标:无法解决项目com.myproject.app:myproject:jar:0.0.1-SNAPSHOT的依赖项:无法在org.kie上收集依赖项:kie-api:jar:6.4。 0.Final:无法读取org.kie的工件描述符:kie-api:jar:6.4.0.Final:无法传输工件org.jboss.dashboard-builder:dashboard-builder-bom:pom:6.4.0。最终来自/到jboss-public-repository-group(https://repository.jboss.org/nexus/content/groups/public/):sun.security.validator.ValidatorException:PKIX路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到要求的有效证书路径目标 - &gt; [帮助1]
我已通过InstallCert.java在C:\ Program Files \ Java \ jdk1.8.0_45 \ jre \ lib \ security \ cacerts
中导入证书当我运行时:keytool -list -v -keystore cacerts 我可以在证书中看到以下短语。
*******************************************
Alias name: repository.jboss.org
Creation date: Jun 24, 2016
Entry type: trustedCertEntry
Owner: CN=*.jboss.org, O=Red Hat Inc., L=Raleigh, ST=North Carolina, C=US
Issuer: C=SK, O="ESET, spol. s r. o.", CN=ESET SSL Filter CA
Serial number: bc5a03085090ce27714df01dd25ab4d
Valid from: Wed Jan 14 03:30:00 IRST 2015 until: Wed Jan 18 15:30:00 IRST 2017
Certificate fingerprints:
MD5: 4A:F0:5E:4D:60:E9:45:E3:7B:43:E7:37:9D:2E:98:7C
SHA1: 21:CB:F8:4C:32:25:32:CE:70:E9:21:99:B5:D0:7D:C0:D9:4C:A5:62
SHA256: 06:1D:1D:50:53:92:3D:20:A9:BD:CF:98:32:F6:B6:07:6A:95:2C:8C:F5:AE:F4:18:88:F6:2A:16:D4:EF:27:76
Signature algorithm name: SHA256withRSA
Version: 3
Extensions:
#1: ObjectId: 2.5.29.19 Criticality=true
BasicConstraints:[
CA:false
PathLen: undefined
]
#2: ObjectId: 2.5.29.37 Criticality=false
ExtendedKeyUsages [
serverAuth
clientAuth
]
#3: ObjectId: 2.5.29.17 Criticality=false
SubjectAlternativeName [
DNSName: *.jboss.org
DNSName: jboss.org
]
#4: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 5A 1E 3F C5 64 68 F4 C9 A2 77 51 B0 E8 EE 2A 13 Z.?.dh...wQ...*.
0010: D9 6C A1 D0 .l..
]
]
*******************************************
******************************************
然后我重新开始了。但我仍然得到同样的错误。
感谢。
答案 0 :(得分:1)
将以下内容添加到.m2 / settings.xml应解决:
class Ability
include CanCan::Ability
def initialize(user)
if user
if user.has_role? :admin
can :manage, :all
else
can [:edit, :update], Shop.with_role(:manager, user)
can :manage, Shop, :user_id => user.id
can :manage, User, id: user.id
can :read, :all
end
end
end
如果没有,那么将以下配置添加到您的项目POM应解决问题:
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>