[无法在项目standalone-pom上执行目标org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate(default-cli):]

时间:2017-08-04 15:45:59

标签: maven scala-gatling

我正在尝试将maven与Gatling集成,我收到以下错误消息。这是我第一次这样做,我真的需要帮助。

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO] 
[INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO] 
[INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Batch mode
[WARNING] No archetype found in remote catalog. Defaulting to internal catalog
[WARNING] Archetype not found in any catalog. Falling back to central repository.
[WARNING] Add a repsoitory with id 'archetype' in your settings.xml if archetype's repository is elsewhere.
Downloading: https://repo.maven.apache.org/maven2/io/gatling/highcharts/gatling-highcharts-maven-archetype/2.2.1/gatling-highcharts-maven-archetype-2.2.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.203 s
[INFO] Finished at: 2017-08-04T11:18:56-04:00
[INFO] Final Memory: 14M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on project standalone-pom: The desired archetype does not exist (io.gatling.highcharts:gatling-highcharts-maven-archetype:2.2.1) -> [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/MojoFailureException
[ERROR] Maven execution terminated abnormally (exit code 1)

3 个答案:

答案 0 :(得分:2)

我刚刚在 Maven 自己的网站上找到了它。他们给出了如下:

mvn archetype:generate -B -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.1 -DgroupId=com.company -DartifactId=project -Dversion=1.0-SNAPSHOT -Dpackage= com.company.project

正如我们所见,还提到了 archeTypeVersion。它对我有用。所以会为你们工作。

答案 1 :(得分:1)

我遇到了同样的问题。如{Robert}在this github issue comment中所述,将mvn archetype:generate替换为mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate时会得到解决。

答案 2 :(得分:0)

你需要在你的pom.xml插入一个插件,你可以在下面找到插件:

<!-- To define the plugin version in your parent POM -->
<pluginManagement>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-archetype-plugin</artifactId>
      <version>3.0.1</version>
    </plugin>
    ...
  </plugins>
</pluginManagement>
<!-- To use the plugin goals in your POM or parent POM -->
<plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-archetype-plugin</artifactId>
    <version>3.0.1</version>
  </plugin>
  ...
</plugins>

您可以参考https://maven.apache.org/archetype/maven-archetype-plugin/plugin-info.html

了解更多信息

如果您已将此插件添加到pom.xml,那么您可以尝试删除.m2存储库文件夹并更新您的maven项目并重建项目并运行它。