Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build Path Issue with Maven Dependencies (jconsole-jdk.jar) [duplicate]

I switched to Wildfly 8.1 and can not resolve this build (path) problem, which somehow is eventually influenced by arquillian test framework.

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>

Errormessage (Eclipse):

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

Hope somebody can help me.

like image 219
budha Avatar asked Aug 18 '14 11:08

budha


3 Answers

Solution was to change eclipse vm to jdk. Eclipse used jre - also I configured jdk.

If somebody else has the same problem, add following in eclipse.ini:

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

Important:

The entry has to be placed in first two lines - as posted - in eclipse.ini !!! (Eclipse Luna and possibly others)

like image 88
budha Avatar answered Nov 13 '22 11:11

budha


I ran across this issue and adding jdk to eclipse.ini did not solve this problem.

Eclipse tries to resolve jconsole.jar by following path relative to eclipse jre path

/../lib/jconsole.jar

Eclipse default JRE must point to JRE inside of JDK folder, so it can resolve jconsole.jar.

In my case my JRE eclipse was pointing to C:\Program Files\Java\jre1.8.0_20

Correct should have been C:\Program Files\Java\jdk1.8.0_20\jre

like image 36
jbhardwaj Avatar answered Nov 13 '22 12:11

jbhardwaj


budha's solution doesn't work for me so I manually add the dependency in the pom:

    <dependency>
        <groupId>sun.jdk</groupId>
        <artifactId>jconsole</artifactId>
        <version>1.8</version>
        <scope>system</scope>
        <systemPath>C:\Program Files\Java\jdk1.8.0_60\lib\jconsole.jar</systemPath>
    </dependency>
like image 28
negstek Avatar answered Nov 13 '22 10:11

negstek