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

Asked

Viewed 1,583 times

0

I’m making that mistake on my POM.xml. Would anyone know what to say?

Missing artifact com.sun:tools:jar:0

<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">

Markers

The container 'Maven Dependencies' References non existing library 'C: Users Vinicius.ribeiro.m2 Repository com sun tools 0 tools-0.jar' VR Build path Build Path Problem The project cannot 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

  • How are your dependencies? And your plugins?

  • 1

    You could post your "pom.xml" instead of the image it would be easier to offer a solution.

  • The error is indicated in the first line, but not necessarily it actually lives in the first line. It may be something there on the 800 line

  • I added POM and Dependencies.

2 answers

0

Try one of these three ways:

1) In Eclipse, go to Windows -> Settings -> Java -> installed Jres -> select JDK and click Edit -> Add External Jars and add tools.jar (it’s in the folder lib inside your jdk installation on your machine).

2) In the eclipse.ini file, BEFORE line -vmargs, add the parameter -vm and, below it, the path of your jdk bin folder. 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 in tools (the idea is to know if any lib of your project is dependent on lib tools.jar). If it exists, you should create an delete for it in pom. For a screenshot of both the tab and the delete in pom.xml, click here.

0

I was able to fix it. The problem was in the build of Maven when creating the folders in . m2. I created the folders by hand and updated project. After that everything’s back to normal.

Obg, you guys.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.