Java - Missing artifact com.sun: tools: jar: 0 (POM.xml)

0

I'm taking this error in my POM.xml. Could anyone tell me what it could be?

<projectxmlns="http://maven.apache.org/POM/4.0.0" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

Markers

  

The container 'Maven Dependencies' references non existing library   'C: \ Users \ vinicius.current.m2 \ repository \ com \ sun \ tools \ 0 \ tools-0.jar' VR Build   path Build Path Problem The project can not be built until build path   errors are resolved VR Unknown Java Problem Missing artifact   com.sun: tools: jar: 0 pom.xml / VR line 1 Maven Dependency Problem

POM

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <!--PROJECT_AND_VERSION-->
  <groupId>POC</groupId>
  <artifactId>VR</artifactId>
  <version>0.0.1-ProveOfConceptBranch</version>
  <packaging>jar</packaging>

  <!--RELATED_INFO-->
  <name>VR</name>
  <url>http://qa360.com.br/</url>

  <!--BUILD_INFO-->
  <build>
       <plugins>
             <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <!--MAVEN'S VERSION-->
                    <version>3.3</version>
                    <configuration>
                           <!--JAVA'S_VERSION-->
                           <source>1.8</source>
                           <target>1.8</target>
                    </configuration>
             </plugin>
             <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <testFailureIgnore>false</testFailureIgnore>
                    <argLine>
                        -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
                        -Dcucumber.options="--plugin ru.yandex.qatools.allure.cucumberjvm.AllureReporter"
                    </argLine>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!--Needed only to show reports locally. Run jetty:run and
            open localhost:8080 to show the report-->
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.2.10.v20150310</version>
                <configuration>
                    <webAppSourceDirectory>${project.build.directory}/site/allure-maven-plugin</webAppSourceDirectory>
                    <stopKey>stop</stopKey>
                    <stopPort>1234</stopPort>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <excludeDefaults>true</excludeDefaults>
        <plugins>
            <plugin>
                <groupId>ru.yandex.qatools.allure</groupId>
                <artifactId>allure-maven-plugin</artifactId>
                <version>2.5</version>
            </plugin>
        </plugins>
    </reporting>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <cucumber.version>1.2.0</cucumber.version>
    <aspectj.version>1.8.10</aspectj.version>
  </properties>
  <dependencies>

  <!--JUnit-->
      <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>4.11</version>
             <scope>test</scope>
      </dependency>
      <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>1.2.5</version>
            <scope>test</scope>
      </dependency>

    <!-- SELENIUM -->
    <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>3.6.0</version>
        </dependency>
        <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-server</artifactId>
                <version>3.6.0</version>
        </dependency>
        <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-api</artifactId>
                <version>3.6.0</version>
        </dependency>

    <!-- CUCUMBER -->
       <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-core</artifactId>
            <version>1.2.5</version>
       </dependency>
       <dependency>
             <groupId>info.cukes</groupId>
             <artifactId>cucumber-java</artifactId>
             <version>1.2.5</version>
             <scope>test</scope>
       </dependency>
       <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-jvm-deps</artifactId>
            <version>1.0.5</version>
            <scope>provided</scope>
       </dependency>
       <dependency>
            <groupId>net.masterthought</groupId>
            <artifactId>cucumber-reporting</artifactId>
            <version>3.12.0</version>
        </dependency>

    <!-- GHERKIN PLUGIN -->
       <dependency>
             <groupId>info.cukes</groupId>
             <artifactId>gherkin</artifactId>
             <version>2.12.2</version>
             <scope>test</scope>
       </dependency>

     <!-- MOCKITO PLUGIN -->
     <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>1.10.19</version>
        <scope>test</scope>
    </dependency>  

     <!-- COBERTURA PLUGIN -->  
       <dependency>
            <groupId>net.sourceforge.cobertura</groupId>
            <artifactId>cobertura</artifactId>
            <version>2.1.1</version>
            <scope>test</scope>
       </dependency>

     <!-- ALLURE PLUGIN -->
       <dependency>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-cucumber-jvm-adaptor</artifactId>
            <version>1.6.4</version>
       </dependency>

     <!-- SLF4J PLUGIN 
       <dependency>
          <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.25</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.7.25</version>
        </dependency>
        <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-jdk14</artifactId>
                <version>1.7.25</version>
        </dependency>
        <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-nop</artifactId>
                <version>1.7.25</version>
        </dependency> -->

  </dependencies>

  <!--PROJECT_DESCRIPTION-->
  <description>Prove of concecpt which it's main purpose is to automate: &quot;Simule e Compre&quot; functionality available on 'https://www.vr.com.br/portal/portal-vr/area-publica/simule-e-compre/&quot;.

  Pre requirements are: 
 - Must be constructed with Selenium;
 - Must be constructed with BDD and Cucumber; 
 - Must have DDT support with Excel; 
 - Must have cross-browsing support using Selenium Grid;

This software was made by QA360 ALL RIGHTS RESERVED.</description>


  <organization>
    <name>VR Benefícios</name>
    <url>https://www.vr.com.br/</url>
  </organization>
</project>

Variables

CLASSPATH =% JAVA_HOME% \ lib;% JAVA_HOME% \ lib \ tools.jar;% JAVA_HOME% \ lib \ dt.jar;% JAVA_HOME% \ lib \ htmlconverter.jar;% JAVA_HOME % \ jre \ lib;% JAVA_HOME% \ jre \ lib \ rt.jar;

JAVA_HOME = C: \ Program Files \ Java \ jdk1.8.0_71

    
asked by anonymous 19.01.2018 / 14:44

2 answers

0

Try one of these three paths:

1) In Eclipse, go to Windows - > settings - > Java - > installed JREs - > select JDK and click Edit - > Add External JARs and add tools.jar (it stays in the lib folder within your jdk installation on your machine).

2) In the eclipse.ini file, BEFORE the -vmargs line, add the -vm parameter and, below it, the path of the bin folder of your jdk. For example:

-vm 
C:\Program Files\Java\jdk1.6.0_35\bin

3) In Eclipse, open your pom.xml file by right-clicking it and choosing Open With > Maven POM Editor. There you will have a tab called Dependency Hierarchy. It has a search box, where you type tools (the idea is to know if any lib of your project has dependency on the tools.jar lib). If it exists, you should create an exclusion for it on the pom. For a screenshot of both the tab and the deletion in pom.xml, click here .

    
19.01.2018 / 18:42
0

I managed to resolve. The problem was in maven's build when creating folders in .m2. I created the folders in hand and gave an update project. After that, everything went back to normal.

Obviously folks.

    
19.01.2018 / 19:04