java - Maven 依赖项 (jconsole-jdk.jar) 的构建路径问题

标签 java eclipse maven jboss-arquillian

<分区>

我切换到 Wildfly 8.1 并不能解决这个构建(路径)问题,这最终不知何故受到了 arquillian 测试框架的影响。

pom.xml:

<properties>
    <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <version.org.jboss.arquillian>1.1.5.Final</version.org.jboss.arquillian>
    <version.org.wildfly>8.1.0.Final</version.org.wildfly>
    <version.junit>4.11</version.junit>
</properties>

<profiles>
    <profile>
        <id>arquillian-jbossas-remote</id>
        <dependencies>
            <dependency>
                <groupId>org.wildfly</groupId>
                <artifactId>wildfly-arquillian-container-remote</artifactId>
                <version>${version.org.wildfly}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </profile>
</profiles>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.jboss.arquillian</groupId>
            <artifactId>arquillian-bom</artifactId>
            <version>${version.org.jboss.arquillian}</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${version.junit}</version>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>org.jboss.logging</groupId>
        <artifactId>jboss-logging</artifactId>
        <version>3.1.4.GA</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
    </dependency>
    <dependency>
        <groupId>org.jboss.arquillian.junit</groupId>
        <artifactId>arquillian-junit-container</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jboss.arquillian.protocol</groupId>
        <artifactId>arquillian-protocol-servlet</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.17</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ejb-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <ejbVersion>3.1</ejbVersion>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${endorsed.dir}</outputDirectory>
                            <silent>true</silent>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>javax</groupId>
                                    <artifactId>javaee-endorsed-api</artifactId>
                                    <version>7.0</version>
                                    <type>jar</type>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!--This plugin's configuration is used to store Eclipse m2e settings 
                only. It has no influence on the Maven build itself. -->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        org.apache.maven.plugins
                                    </groupId>
                                    <artifactId>
                                        maven-dependency-plugin
                                    </artifactId>
                                    <versionRange>
                                        [2.6,)
                                    </versionRange>
                                    <goals>
                                        <goal>copy</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore></ignore>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

错误信息 (Eclipse):

The container 'Maven Dependencies' references non existing library 'C:\Users\user.m2\repository\sun\jdk\jconsole\jdk\jconsole-jdk.jar'

希望有人能帮助我。

最佳答案

解决方案是将eclipse vm 更改为jdk。 Eclipse 使用 jre - 我还配置了 jdk。

如果其他人遇到同样的问题,请在 eclipse.ini 中添加以下内容:

-vm 
C:\Program Files\Java\jdk1.7.0_60\bin\javaw.exe

重要:

该条目必须放在 eclipse.ini 中的前两行中 - 正如发布的那样! (Eclipse Luna 和其他可能)

关于java - Maven 依赖项 (jconsole-jdk.jar) 的构建路径问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25362127/

相关文章:

eclipse - 在ubuntu中没有环境变量的maven工作

eclipse - 类路径条目 org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER 将不会被导出

java - 由 : org. apache.maven.surefire.booter.SurefireBooterForkException 引起: fork 进程中出现错误 [错误] 无法实例化类

arraylist中的Java jbutton,我怎么知道点击了哪个

java - 展开和折叠重复叶节点的 Extjs 树面板不正确行为

java - jBCrypt 加密和解密

java - 如何从 Eclipse java 项目中删除 Maven?

java - 写入 OSX's/Library/Application Support 文件夹会抛出 IOException : Permission denied

java - CoAP 服务器无法启动

javascript - 最终有没有办法在 Eclipse Kepler 的 JavaScript 和 HTML 元素中进行重构?