缺少的工件“sun.jdk:jconsole:jar:jdk” [英] Missing artifact "sun.jdk:jconsole:jar:jdk"

查看:787
本文介绍了缺少的工件“sun.jdk:jconsole:jar:jdk”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


缺少工件sun.jdk:jconsole:jar: jdk




 < dependency> 
< groupId> org.jboss.arquillian.junit< / groupId>
< artifactId> arquillian-junit-container< / artifactId>
< version> 1.1.7.Final< / version>
< / dependency>
<依赖关系>
< groupId> org.jboss.arquillian.extension< / groupId>
< artifactId> arquillian-persistence-dbunit< / artifactId>
< version> 1.0.0.Alpha7< / version>
< / dependency>

(消息不是问题,但是因为它拒绝编译项目,Maven作品,虽然。)



自然,我做的第一件事是试图从Maven依赖关系中排除它( wildfly-arquillian-container-managed 依赖关系树指出依赖关系来自哪里):

 < dependency> 
< groupId> org.wildfly< / groupId>
< artifactId> wildfly-arquillian-container-managed< / artifactId>
<排除>
< exclude>
< artifactId> jconsole< / artifactId>
< groupId> sun.jdk< / groupId>
< / exclusion>
< / exclusions>
< / dependency>

没有变化。我试图用 -vm C:\Program Files\Java\jdk1.8.0_60\bin 启动Eclipse。并尝试在首选项 - >已安装的JRE中编辑JDK以在工具目录中包含JAR。但没有任何效果。



我该怎么办?

解决方案

我把我的依赖关系这样,它的工作正常:

 <依赖性> 
< groupId> org.jboss.arquillian.junit< / groupId>
< artifactId> arquillian-junit-container< / artifactId>
< scope> test< / scope>
< / dependency>
<依赖关系>
< groupId> org.wildfly< / groupId>
< artifactId> wildfly-arquillian-container-embedded< / artifactId>
< version> 8.1.0.CR1< / version>
< scope> test< / scope>
< / dependency>
<依赖关系>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-simple< / artifactId>
< version> 1.7.15< / version>
< scope> test< / scope>
< / dependency>
<! - Arquillian - >

<依赖关系>
< groupId> org.wildfly< / groupId>
< artifactId> wildfly-embedded< / artifactId>
< version> 8.1.0.CR1< / version>
<排除>
< exclude>
< groupId> sun.jdk< / groupId>
< artifactId> jconsole< / artifactId>
< / exclusion>
< / exclusions>
< scope> test< / scope>
< / dependency>

看到排除标记位于wildfly-embedded依赖关系...



不要忘记命令mvn install,并单击右键,在项目和Maven更新,如果它不工作尝试删除文件夹〜/ .m2 / repository并再次下载所有依赖项。


When adding Arquillian to a Maven build I get the above exception in Eclipse:

Missing artifact sun.jdk:jconsole:jar:jdk

    <dependency>
        <groupId>org.jboss.arquillian.junit</groupId>
        <artifactId>arquillian-junit-container</artifactId>
        <version>1.1.7.Final</version>
    </dependency>
    <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-persistence-dbunit</artifactId>
        <version>1.0.0.Alpha7</version>
    </dependency>

(The message is not the problem, but that Eclipse refuses to compile the project because of it. Maven works, though.)

Naturally the first thing I did was trying to exclude it from the Maven dependencies (wildfly-arquillian-container-managed is where the dependency tree states the dependency comes from):

    <dependency>
        <groupId>org.wildfly</groupId>
        <artifactId>wildfly-arquillian-container-managed</artifactId>
        <exclusions>
            <exclusion>
                <artifactId>jconsole</artifactId>
                <groupId>sun.jdk</groupId>
            </exclusion>
        </exclusions>
    </dependency> 

There was no change. I tried to start Eclipse with -vm C:\Program Files\Java\jdk1.8.0_60\bin. And tried to edit the JDK in "Preferences -> Installed JREs" to contain the JAR in the tools directory. But nothing works.

What can I do?

解决方案

I put my dependencies like this and it works fine:

<dependency>
        <groupId>org.jboss.arquillian.junit</groupId>
        <artifactId>arquillian-junit-container</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.wildfly</groupId>
        <artifactId>wildfly-arquillian-container-embedded</artifactId>
        <version>8.1.0.CR1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.7.15</version>
        <scope>test</scope>
    </dependency>
    <!-- Arquillian -->

    <dependency>
        <groupId>org.wildfly</groupId>
        <artifactId>wildfly-embedded</artifactId>
        <version>8.1.0.CR1</version>
        <exclusions>
            <exclusion>
                <groupId>sun.jdk</groupId>
                <artifactId>jconsole</artifactId>
            </exclusion>
        </exclusions>
        <scope>test</scope>
    </dependency>

See that the exclusion tag is in the "wildfly-embedded" dependency...

Don't forget to command "mvn install" and click right button at project and "Maven Update", if it doesn't work try delete folder "~/.m2/repository" and download all the dependencies again.

这篇关于缺少的工件“sun.jdk:jconsole:jar:jdk”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆