创建新的 Apache Apex 项目时出现 Maven 原型错误

Posted

技术标签:

【中文标题】创建新的 Apache Apex 项目时出现 Maven 原型错误【英文标题】:Maven archetype error while creating a new Apache Apex project 【发布时间】:2017-02-16 06:48:09 【问题描述】:

我正在关注与帮助创建启动项目的 Apache Apex 相关的文档。 https://apex.apache.org/docs/apex-3.4/apex_development_setup/#creating-new-apex-project

在执行maven命令时,

@echo off
@rem Script for creating a new application
setlocal
mvn archetype:generate -DarchetypeGroupId=org.apache.apex -DarchetypeArtifactId=apex-app-archetype -DarchetypeVersion=3.5.0 -DgroupId=com.example -Dpackage=com.example.myapexapp -DartifactId=myapexapp -Dversion=1.0-SNAPSHOT
endlocal

我面临以下问题。

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.0.0:generate (default-cli) @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.0.0:generate (default-cli) @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:3.0.0:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[WARNING] Archetype not found in any catalog. Falling back to central repository (http://repo.maven.apache.org/maven2).
[WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere.
Downloading: http://repo.maven.apache.org/maven2/org/apache/apex/apex-app-archetype/3.5.0/apex-app-archetype-3.5.0.pom
[WARNING] Checksum validation failed, expected <!DOCTYPE but is 7fdb0195c216fb3cbb981a7d1454af1e1139c15f for http://repo.maven.apache.org/maven2/org/apache/apex/apex-app-archetype/3.5.0/apex-app-archetype-3.5.0
[WARNING] Checksum validation failed, expected <!DOCTYPE but is 7fdb0195c216fb3cbb981a7d1454af1e1139c15f for http://repo.maven.apache.org/maven2/org/apache/apex/apex-app-archetype/3.5.0/apex-app-archetype-3.5.0
Downloaded: http://repo.maven.apache.org/maven2/org/apache/apex/apex-app-archetype/3.5.0/apex-app-archetype-3.5.0.pom (2 KB at 0.7 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/apex/apex/3.5.0/apex-3.5.0.pom
[WARNING] Checksum validation failed, expected <!DOCTYPE but is 699f18e175976623c84ada3e48ef32301cf8c30b for http://repo.maven.apache.org/maven2/org/apache/apex/apex/3.5.0/apex-3.5.0.pom
[WARNING] Checksum validation failed, expected <!DOCTYPE but is 699f18e175976623c84ada3e48ef32301cf8c30b for http://repo.maven.apache.org/maven2/org/apache/apex/apex/3.5.0/apex-3.5.0.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/apex/apex/3.5.0/apex-3.5.0.pom (17 KB at 7.4 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/apex/apex-app-archetype/3.5.0/apex-app-archetype-3.5.0.jar
[WARNING] Checksum validation failed, expected <!DOCTYPE but is da76067a61f0fc02442cb2f09a9f8934e437cf2e for http://repo.maven.apache.org/maven2/org/apache/apex/apex-app-archetype/3.5.0/apex-app-archetype-3.5.0
[WARNING] Checksum validation failed, expected <!DOCTYPE but is da76067a61f0fc02442cb2f09a9f8934e437cf2e for http://repo.maven.apache.org/maven2/org/apache/apex/apex-app-archetype/3.5.0/apex-app-archetype-3.5.0
Downloaded: http://repo.maven.apache.org/maven2/org/apache/apex/apex-app-archetype/3.5.0/apex-app-archetype-3.5.0.jar (2 KB at 0.3 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.953s
[INFO] Finished at: Thu Feb 16 11:51:24 IST 2017
[INFO] Final Memory: 16M/491M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.0:generate (default-cli) on project standalone-pom: The defined artifact is not an archetype -> [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

这个错误的原因是什么?

【问题讨论】:

我尝试了 mvn 命令,它对我有用。不知道为什么它不适合你。失败是持续发生还是一次性发生? 其一致。重复同样的错误 【参考方案1】:

您与 maven 存储库的 Internet 连接可能存在问题。尝试手动下载必要的工件:

mvn dependency:get  -DremoteRepositories=http://repo1.maven.org/maven2/ -DgroupId=org.apache.apex -DartifactId=apex-app-archetype -Dversion=3.5.0

【讨论】:

以上是关于创建新的 Apache Apex 项目时出现 Maven 原型错误的主要内容,如果未能解决你的问题,请参考以下文章

创建新的基于文档的核心数据项目时出现问题

尝试创建新的 Google API 项目时出现 FAILED_PRECONDITION

尝试在生产中部署 apex 类时出现 INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY

运行动态Web项目tomcat时出现问题“只能导入一个类型。 org.hibernate.cfg.Configuration解析为一个包“

Idea创建Maven项目时出现Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1错误

创建新项目时出现 Grails 2.3.7 错误