2016-04-15 80 views
2
<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"> 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.cucumber</groupId> 
    <artifactId>MavenCucumberPrototype</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>jar</packaging> 

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

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


     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.11</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>info.cukes</groupId> 
      <artifactId>cucumber-java</artifactId> 
      <version>1.1.2</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>info.cukes</groupId> 
      <artifactId>cucumber-picocontainer</artifactId> 
      <version>1.1.2</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>info.cukes</groupId> 
      <artifactId>cucumber-junit</artifactId> 
      <version>1.1.2</version> 
      <scope>test</scope> 
     </dependency> 
     </dependencies> 
     </project> 
+0

请修复代码部分。而你错过了'''标签。 – watery

+0

谢谢,代码已修复。 – vikas

回答

4

你有一个结束标签依赖但没有开始标记依赖

(缺少标签应该在性能标签以及firts依赖)

1

除了<dependencies>标签丢失,您对<project>标签的问题,以及这应做到:

<?xml version="1.0" encoding="UTF-8"?> 
<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.cucumber</groupId> 
    <artifactId>MavenCucumberPrototype</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>jar</packaging> 

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

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

    <dependencies> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.11</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>info.cukes</groupId> 
      <artifactId>cucumber-java</artifactId> 
      <version>1.1.2</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>info.cukes</groupId> 
      <artifactId>cucumber-picocontainer</artifactId> 
      <version>1.1.2</version> 
      <scope>test</scope> 
     </dependency> 
     <dependency> 
      <groupId>info.cukes</groupId> 
      <artifactId>cucumber-junit</artifactId> 
      <version>1.1.2</version> 
      <scope>test</scope> 
     </dependency> 
    </dependencies> 
</project> 
+0

谢谢dambros,非常感谢,因为我只是初学者在IT – vikas

+0

@Vikas没有问题。如果答案解决了您的问题,请将其标记为正确,以便将来可能帮助其他人。 – dambros

+0

@dambros,我有同样的错误,但我的POM看起来不错。我下载了starter spring项目。无法弄清楚发生了什么问题。 – Mav55