0

I have created pom.xml, in these I have create a dependency for junit, selenium-java and testng. But in these it displayed the "Multiple annotation found". Can anyone please help me to resolving it?

Pom.xml

<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>
  <groupId>WebdriverTest</groupId>
  <artifactId>WebdriverTest</artifactId>
  <version>0.0.1-SNAPSHOT</version>

   <dependencies>            
        <dependency>              
             <groupId>junit</groupId>                               
             <artifactId>junit</artifactId>                             
             <version>3.8.1</version>                               
             <scope>test</scope>                                
        </dependency>             
        <dependency>              
            <groupId>org.seleniumhq.selenium</groupId>                              
            <artifactId>selenium-java</artifactId>                              
            <version>2.45.0</version>                               
        </dependency>             
        <dependency>              
            <groupId>org.testng</groupId>                               
            <artifactId>testng</artifactId>                             
            <version>6.8</version>                              
            <scope>test</scope>                                     
       </dependency>              
</dependencies>

</project>

Multiple annotation found:

Multiple annotations found at this line:
    - ArtifactTransferException: Failure to transfer org.apache.httpcomponents:httpclient:jar:4.3.6 from http://repo.maven.apache.org/
     maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are 
     forced. Original error: Could not transfer artifact org.apache.httpcomponents:httpclient:jar:4.3.6 from/to central (http://
     repo.maven.apache.org/maven2): No response received after 60000
    - ArtifactTransferException: Failure to transfer net.sourceforge.nekohtml:nekohtml:jar:1.9.21 from http://repo.maven.apache.org/
     maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are 
     forced. Original error: Could not transfer artifact net.sourceforge.nekohtml:nekohtml:jar:1.9.21 from/to central (http://
     repo.maven.apache.org/maven2): No response received after 60000
    - ArtifactTransferException: Failure to transfer org.apache.commons:commons-exec:jar:1.1 from http://repo.maven.apache.org/
     maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are 
     forced. Original error: Could not transfer artifact org.apache.commons:commons-exec:jar:1.1 from/to central (http://repo.maven.apache.org/
     maven2): No response received after 60000
    - ArtifactTransferException: Failure to transfer org.seleniumhq.selenium:selenium-api:jar:2.45.0 from http://repo.maven.apache.org/
     maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are 
     forced. Original error: Could not transfer artifact org.seleniumhq.selenium:selenium-api:jar:2.45.0 from/to central (http://
     repo.maven.apache.org/maven2): No response received after 60000
    - ArtifactTransferException: Failure to transfer org.seleniumhq.selenium:selenium-remote-driver:jar:2.45.0 from http://
     repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has 
     elapsed or updates are forced. Original error: Could not transfer artifact org.seleniumhq.selenium:selenium-remote-driver:jar:2.45.0 from/to 
     central (http://repo.maven.apache.org/maven2): No response received after 60000
ChayanC
  • 201
  • 7
  • 29
  • update to junit 4+ selenium 2.47+ and try – Mrunal Gosar Oct 22 '15 at 06:20
  • @MrunalGosar I have updated the junit with versin 4.12.0 and selenium with version 2.48.2 but now I get the artifact transfer exception. Please check "ArtifactTransferException: Failure to transfer xalan:serializer:jar:2.7.2 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact xalan:serializer:jar:2.7.2 from/to central (http:// repo.maven.apache.org/maven2): No response received after 60000". – ChayanC Oct 22 '15 at 07:03
  • aarrghh..i think u have bad internet connection.hehehe..well u will have to delete ~m2/repository/ all the contents and run mvn commands again..to download things back – Mrunal Gosar Oct 22 '15 at 07:08
  • @MrunalGosar My internet connection is also working fine currently but still I get this issue. Can you suggest some solution for it? – ChayanC Oct 23 '15 at 10:13
  • delete .m2/repository complete and run any mvn command for maven to download everything again – Mrunal Gosar Oct 24 '15 at 06:13
  • @MrunalGosar Still the issue is not resolved.. :( – ChayanC Oct 25 '15 at 13:19
  • I got the same error with same symptoms but i resolved it like [this](https://stackoverflow.com/questions/45057594/maven-multiple-annotations-found-at-this-line/45057954#45057954) – Sal-laS Jul 12 '17 at 12:51

2 Answers2

0
  1. try: mvn -U clean
  2. Or clean .m2 and recreate it
  3. Add <scope>test</scope> at selenium-java
grebulon
  • 7,697
  • 5
  • 42
  • 66
question_maven_com
  • 2,457
  • 16
  • 21
0

As I didn't get any response here, I've explored for finding the solution of artifact expectation and get the result via below reference URL. In these it describes the detailed problem of it with solution.

URL: Dealing with "Xerces hell" in Java/Maven?

I've used below dependency which helps me to resolving it:

<dependency>
    <groupId>xerces</groupId>
    <artifactId>xercesImpl</artifactId>
    <version>2.11.0</version>
</dependency>
Community
  • 1
  • 1
ChayanC
  • 201
  • 7
  • 29