2016-04-15 84 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