【问题标题】:Failed to execute goal org.apache.maven.plugins:maven未能执行目标 org.apache.maven.plugins:maven
【发布时间】:2016-08-11 11:05:45
【问题描述】:

我在运行 Maven 测试时收到此错误

未能执行目标 org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor 项目 amsframeworok 上的(默认描述符):提取插件时出错 描述符:'没有找到插件的 mojo 定义: ams5.0:amsframework。 -> [帮助 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>ams5.0</groupId>
    <artifactId>amsframeworok</artifactId>
  <version>1.0-SNAPSHOT</version>
    <packaging>maven-plugin</packaging>

    <name>amsframeworok</name>
 <url>http://maven.apache.org</url>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <angulargwt.version>1.1.2</angulargwt.version>
         <jdk.version>1.8</jdk.version>
        <module.fullName>ams5.0.My</module.fullName>

    </properties>

    <dependencies>
    <dependency>
     <groupId>com.mashape.unirest</groupId>
     <artifactId>unirest-java</artifactId>
     <version>1.4.5</version>
</dependency>
<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpcore</artifactId>
    <version>4.4.4</version>
</dependency>
<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.5.1</version>
</dependency>
        <dependency>
            <groupId>com.google.gwt.gwtmockito</groupId>
            <artifactId>gwtmockito</artifactId>
            <version>1.1.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>1.2.3</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-jvm</artifactId>
            <version>1.1.5</version>
            <type>pom</type>
        </dependency>


        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>1.2.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>gherkin</artifactId>
            <version>2.12.2</version>
        </dependency>
         <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>2.0.2-beta</version>
        </dependency>

        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-jvm-deps</artifactId>
            <version>1.0.5</version>
        </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.53.0</version>
    </dependency>
     <dependency>
    <groupId>org.apache.maven</groupId>
    <artifactId>maven-repository-metadata</artifactId>
    <version>2.2.1</version>
</dependency>

        <dependency>
      <groupId>com.sun</groupId>
      <artifactId>tools</artifactId>
      <version>1.5.0_06</version>
      <scope>system</scope>

   <systemPath>${env.JAVA_HOME}/lib/tools.jar</systemPath>
    </dependency>
     <dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.19.1</version>
</dependency>


    </dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-plugin-plugin</artifactId>
            <version>3.2</version>
            <configuration>
                <goalPrefix>amsframeworok</goalPrefix>
            </configuration>
            <executions>
                <execution>
                    <id>default-descriptor</id>
                    <goals>
                        <goal>descriptor</goal>
                    </goals>
                    <phase>process-classes</phase>
                </execution>
                <execution>
                    <id>help-descriptor</id>
                    <goals>
                        <goal>helpmojo</goal>
                    </goals>
                    <phase>process-classes</phase>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

</project>

【问题讨论】:

  • 你在尝试创建一个maven插件吗?
  • 你在“amsframeworok”中没有错字吗?
  • 当我点击 Run As -> Maven Test 上面的异常显示时,不只是使用 Maven 运行我的 Cucumber 测试。
  • 那你为什么有&lt;packaging&gt;maven-plugin&lt;/packaging&gt;
  • 我不确定应该设置什么?请指教。

标签: java maven


【解决方案1】:

尝试运行:

mvn clean install -U

然后将此命令导入 Eclipse:

mvn clean install eclipse:clean eclipse:eclipse -DskipTests=true

【讨论】:

    猜你喜欢
    • 2018-01-02
    • 2013-05-30
    • 2016-02-27
    • 2015-11-08
    • 2020-09-02
    • 2012-09-04
    • 1970-01-01
    • 1970-01-01
    • 2021-03-11
    相关资源
    最近更新 更多