1

I'm pretty new to maven so I am not sure how to fix this issue.

I am trying to package my maven project (mvn clean package) but I am getting this error:

Failed to execute goal on project TestSDK: Could not resolve dependencies for project com.company.idea.qe:qeTestSDK:jar:1.0-SNAPSHOT: Failure to find org.slf4j:slf4j-parent:jar:1.7.21 in http://nexus-proxy/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of Company-nexus has elapsed or updates are forced -> [Help 1]

I believe this is caused by Maven using the repository value as the only source of downloading dependencies. I require this to download the WebDriverBuilder artifact. Being new to Maven I'm not sure how to do this.

my pom.xml currently looks like this:

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

<groupId>com.company.idea.qe</groupId>
<artifactId>qeTestSDK</artifactId>
<version>1.0-SNAPSHOT</version>

<repositories>
    <repository>
        <id>company-nexus</id>
        <name>Compnay Nexus</name>
        <url>http://nexus-proxy/nexus/content/groups/public/</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.company.tools</groupId>
        <artifactId>WebDriverBuilder</artifactId>
        <version>2.3.3</version>
    </dependency>
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.9.10</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.53.0</version>
    </dependency>
    <!--  Gson: Java to Json conversion -->
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.6.2</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-parent</artifactId>
        <version>1.7.21</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19.1</version>
        </plugin>
    </plugins>
</build>

Liondancer
  • 15,721
  • 51
  • 149
  • 255

1 Answers1

4

Your dependency should be for sl4j-api and not sl4j-parent

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.7.21</version>
</dependency>
Shailendra
  • 8,874
  • 2
  • 28
  • 37
  • What is the difference between api and parent? – Liondancer May 16 '16 at 17:26
  • This is maven concept of creating a parent pom which contains build/dependency information which can be shared by children project. Anyway this has to to do with how the project is structured. For more info please refer to http://stackoverflow.com/questions/1992213/maven-parent-pom-vs-modules-pom – Shailendra May 16 '16 at 17:28