Unable to add dependency in Maven | Selenium Forum
M
Posted on 10/07/2016
Hi ,

I am getting below error while adding dependency and compiling maven.
--------
Dependency added
-----------
<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>com.testing</groupId>
<artifactId>MyMavenProject</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>MyMavenProject</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-server</artifactId>
    <version>2.53.1</version>
</dependency>



</dependencies>
</project>



-------
Error on compiling:
C:\Users\sanjay\maven\MyMavenProject>mvn compile
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Malformed POM C:\Users\sanjay\maven\MyMavenProject\pom.xml: expected STA
RT_TAG or END_TAG not TEXT (position: TEXT seen ...<dependency>\r\n\ua0\ua0\ua0\
ua0<g... @20:7) @ C:\Users\sanjay\maven\MyMavenProject\pom.xml, line 20, column
7
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.testing:MyMavenProject:1.0-SNAPSHOT (C:\Users\sanjay\m
aven\MyMavenProject\pom.xml) has 1 error
[ERROR] Malformed POM C:\Users\sanjay\maven\MyMavenProject\pom.xml: expected
START_TAG or END_TAG not TEXT (position: TEXT seen ...<dependency>\r\n\ua0\ua0\
ua0\ua0<g... @20:7) @ C:\Users\sanjay\maven\MyMavenProject\pom.xml, line 20, co
lumn 7 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin
gException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseExce
ption

M
Replied on 11/07/2016

have you installed maven plugin for eclipse.