2016-09-23 61 views
0

我是Maven的新手,我正嘗試在IntelliJ IDEA上創建我的第一個bdd測試,使用jbehave,maven和thucydides。當我嘗試點擊Maven面板上的驗證時,我收到一個錯誤消息。當我開始驗證時,maven依賴項錯誤

我該如何解決這個問題?提前致謝!

Apache Maven 3.3.9

錯誤消息

C:\Program Files\Java\jdk1.8.0_101\bin\java""-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition2016.2.4\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2016.2.4\plugins\maven\lib\maven3\bin\m2.conf" -Didea.launcher.port=7537 " - Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2016.2.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2016.2.4\plugins\maven\lib\maven3\boot\plexus-classworlds-2.4.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2016.2.4\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=2016.2.4 verify 

[INFO] Scanning for projects... 
[INFO]                   
[INFO] --------------------------------------------------------------------- 
[INFO] Building Sample Thucydides project 1.0-SNAPSHOT 
[INFO] --------------------------------------------------------------------- 
[INFO] --------------------------------------------------------------------- 
[INFO] BUILD FAILURE 
[INFO] --------------------------------------------------------------------- 
[INFO] Total time: 1.600s 
[INFO] Finished at: Fri Sep 23 10:36:29 AST 2016 
[INFO] Final Memory: 6M/16M 
[INFO] --------------------------------------------------------------------- 
[ERROR] Failed to execute goal on project bddtest: Could not resolve dependencies for project com.rostislavberezhnoy.bddtest:bddtest:jar:1.0- SNAPSHOT: Could not find artifact com.rostislavberezhnoy.bddtest:bddtest:jar:1.0-SNAPSHOT -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[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 read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException 

Process finished with exit code 1 

我的pom.xml:

<?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.rostislavberezhnoy.bddtest</groupId> 
<artifactId>bddtest</artifactId> 
<version>1.0-SNAPSHOT</version> 
<packaging>jar</packaging> 

<name>Sample Thucydides project</name> 

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <thucydides.version>0.9.268</thucydides.version> 
    <thucydides.jbehave.version>0.9.268</thucydides.jbehave.version> 
    <webdriver.driver>firefox</webdriver.driver> 
</properties> 

<dependencies> 
    <dependency> 
     <groupId>net.thucydides</groupId> 
     <artifactId>thucydides-core</artifactId> 
     <version>${thucydides.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>net.thucydides</groupId> 
     <artifactId>thucydides-junit</artifactId> 
     <version>${thucydides.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>net.thucydides</groupId> 
     <artifactId>thucydides-jbehave-plugin</artifactId> 
     <version>${thucydides.jbehave.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-simple</artifactId> 
     <version>1.6.1</version> 
    </dependency> 
    <dependency> 
     <groupId>org.easytesting</groupId> 
     <artifactId>fest-assert</artifactId> 
     <version>1.4</version> 
    </dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.11</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.googlecode.lambdaj</groupId> 
     <artifactId>lambdaj</artifactId> 
     <version>2.3.3</version> 
    </dependency> 
    <dependency> 
     <groupId>com.rostislavberezhnoy.bddtest</groupId> 
     <artifactId>bddtest</artifactId> 
     <version>1.0-SNAPSHOT</version> 
    </dependency> 
</dependencies> 
<build> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <version>2.11</version> 
      <configuration> 
       <skip>true</skip> 
      </configuration> 
     </plugin> 
     <plugin> 
      <artifactId>maven-failsafe-plugin</artifactId> 
      <version>2.11</version> 
      <configuration> 
       <includes> 
        <include>**/*Test.java</include> 
        <include>**/Test*.java</include> 
        <include>**/When*.java</include> 
        <include>**/*TestSuite.java</include> 
       </includes> 
      </configuration> 
      <executions> 
       <execution> 
        <goals> 
         <goal>integration-test</goal> 
         <goal>verify</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>2.3.2</version> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-javadoc-plugin</artifactId> 
      <version>2.9</version> 
     </plugin> 
     <plugin> 
      <groupId>net.thucydides.maven.plugins</groupId> 
      <artifactId>maven-thucydides-plugin</artifactId> 
      <version>${thucydides.version}</version> 
      <executions> 
       <execution> 
        <id>thucydides-reports</id> 
        <phase>post-integration-test</phase> 
        <goals> 
         <goal>aggregate</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 
</build> 

<profiles> 
    <profile> 
     <id>maven2</id> 
     <activation> 
      <file> 
       <missing>${basedir}</missing> 
      </file> 
     </activation> 
     <reporting> 
      <plugins> 
       <plugin> 
        <groupId>net.thucydides.maven.plugins</groupId> 
        <artifactId>maven-thucydides-plugin</artifactId> 
        <version>${thucydides.version}</version> 
       </plugin> 
      </plugins> 
     </reporting> 
    </profile> 
    <profile> 
     <id>maven3</id> 
     <activation> 
      <file> 
       <exists>${basedir}</exists> 
      </file> 
     </activation> 
     <build> 
      <plugins> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-site-plugin</artifactId> 
        <version>3.2</version> 
        <configuration> 
         <reportPlugins> 
          <plugin> 
           <groupId>net.thucydides.maven.plugins</groupId> 
           <artifactId>maven-thucydides-plugin</artifactId> 
           <version>${thucydides.version}</version> 
          </plugin> 
         </reportPlugins> 
        </configuration> 
       </plugin> 
      </plugins> 
     </build> 
    </profile> 
</profiles> 

回答

0

您的問題是你指的

<dependency> 
    <groupId>com.rostislavberezhnoy.bddtest</groupId> 
    <artifactId>bddtest</artifactId> 
    <version>1.0-SNAPSHOT</version> 
</dependency> 

未找到。

它似乎與您的Maven構建即將創建的工件名稱相同。

也就是說,你是從你的pom引用你自己。我會考慮重新提供這種依賴並重新運行。有人介紹這種依賴性很可能是一個錯誤。

+0

非常感謝! –

0

找不到神器com.rostislavberezhnoy.bddtest:bddtest:罐子: 1.0-SNAPSHOT - > [Help 1]

如果您使用私有mvn回購,您需要將其安裝在您的本地或首先將其部署到您的Maven回購站。您可以參考this安裝jar文件。

+0

如何將它安裝在我的本地目錄中? –

+0

@ R.Berezhnoy你可以參考這個https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html –